Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2596856pxb; Mon, 19 Apr 2021 09:12:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJznJGaUBF7BAhe4gW/GdEdVWbxb7odDtnFQbbKd6nZC6g/TcPXGJ4xMqiBxXbcUBLWjUF2T X-Received: by 2002:a17:906:c419:: with SMTP id u25mr23350040ejz.332.1618848749596; Mon, 19 Apr 2021 09:12:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618848749; cv=none; d=google.com; s=arc-20160816; b=sljjF6hCAcvZuZ93nxSsfq+ebavtiPsXOjLX5Fe5gvYDf+WtnzaTeII8eZJjo98V3x N2teY8Nzq/P2pJV3/u7Jb0iPPU3/PwLGPYzlMvC7oGXS8U9hFwLrV0d5im75c+zaqmkn i6vwcLGle4MgS+B+dg4eaxyd9NEfEXf9veapMBfgdvqzdfz3I/H90VIKQafOZD3dTFWk a2zpQB90rGad8HNRWrJX27ZmLvw9WqRBKM6G7Q7b6a9YnS8SsJLwlj7+Gp8HgmH5CdWC haWWxSKSrACmENQfuacDLWTnsxi3QOoaLYDL90uRpmPH6fPdI2HhCqSJgcI6WqlrRdlJ 5Vzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:content-transfer-encoding :in-reply-to:mime-version:user-agent:date:message-id:references:cc :to:subject:from:dkim-signature; bh=T04/99zjOhCEQHzWZ92KH2vVjDJkKk+5bJDNm7yYZ9I=; b=SS3n4AC2F1nk7k6BF7tp8RvGYZJgsMIc4baXlv3fIrZkqyFea0qWZyA5CTaDMQL3Tk 1YNSx+zRP/WUtaM+ntIF47Q5tQ2V0RgzZGbsN5364Z7tLnTCaeTvS10Mb51GKVoe+tOK CbqsFTPkzxbZ7tsc+Jae1rJRAUFV4eTOzpxiY84mN0oL/OMvYWXxyKwYaPgwXkH6t2Xx s7+D11dDU2MkCHGpXpoAxvX718Oy6P2s9ziV71gTi4pLU76xyjoYaDJH3AHgqUW9C/lJ H1KWFmidOFzU3rlYge9lxqE6mg4kkUYxOTvFerkZ/WjZGFtYb0B+YrO0Zhxxl6mNBPW0 Zrug== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Yz8t62AE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id mp39si11992588ejc.182.2021.04.19.09.12.02; Mon, 19 Apr 2021 09:12:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=Yz8t62AE; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240190AbhDSPWZ (ORCPT + 99 others); Mon, 19 Apr 2021 11:22:25 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:39569 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233733AbhDSPWY (ORCPT ); Mon, 19 Apr 2021 11:22:24 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618845714; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=T04/99zjOhCEQHzWZ92KH2vVjDJkKk+5bJDNm7yYZ9I=; b=Yz8t62AEIdCodLz8yVPDhieOP+S0kLKMVRSXA1zM0d+Q3b7wGEhfyaDFEETMcQR2hTIHs6 U/mk1F911Boygf6/3zENVKNx8K2f+pAQxraiffdnB8obp4mQRvBrU91OR9sd5UtqzifOS0 LAJZIvSCLLogYiWGxEiOiNMoUmxGo1s= Received: from mail-qv1-f70.google.com (mail-qv1-f70.google.com [209.85.219.70]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-283--WbYvcD0PZ2qE8tCcljJYA-1; Mon, 19 Apr 2021 11:21:53 -0400 X-MC-Unique: -WbYvcD0PZ2qE8tCcljJYA-1 Received: by mail-qv1-f70.google.com with SMTP id e20-20020ad442b40000b029019aa511c767so9533303qvr.18 for ; Mon, 19 Apr 2021 08:21:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:cc:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding :content-language; bh=T04/99zjOhCEQHzWZ92KH2vVjDJkKk+5bJDNm7yYZ9I=; b=rwD5aWcvVWcWSYakPEERIGFmYqOrWzmXSyvBUjVvcISvbB/h8xYvOmBh9/DtdguI52 Qv0za/cb3lGR7OIX0BNprnLinS52d169uCl5l37bKQGpn1oo9Pl/+0MjQ6Fh6ZEj1Ss4 vABZNlqkO/Vxw4fw7IzdBDqOQjSjmRym8ZBztd0Q/LXHhoaihDQ9vZTyXKDmcBsZCF3G ufHt7xFJ9+q8s8gNSYC06AE8TPdvZKbzzzyYMP6Gy9n/TvaHOt2k7UK+99yIkOeUgzN+ Hi57Wn99hGuNQJvo8v9MB+xRib73BQQ72pT+PPIcqjBqusGf10oYw0aXOjawOQF/89GS Xd4Q== X-Gm-Message-State: AOAM532SameKoXxR53iugmm6bvHVDW/rJP1krf1a1isiyDq5fyc+i7KW 90p/IPwu2IdH8mEMnd1Xz6oltWIEWwUD6z3npwMZ7n1Jr5o7dqaFYUKh2f3HeWc1J4TpDggsYTk 281i3FkGGMqDyrUsEZ3lss6VH X-Received: by 2002:a0c:f514:: with SMTP id j20mr22772788qvm.14.1618845712867; Mon, 19 Apr 2021 08:21:52 -0700 (PDT) X-Received: by 2002:a0c:f514:: with SMTP id j20mr22772760qvm.14.1618845712728; Mon, 19 Apr 2021 08:21:52 -0700 (PDT) Received: from llong.remote.csb ([2601:191:8500:76c0::cdbc]) by smtp.gmail.com with ESMTPSA id n136sm9882372qka.133.2021.04.19.08.21.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Apr 2021 08:21:52 -0700 (PDT) From: Waiman Long X-Google-Original-From: Waiman Long Subject: Re: [PATCH v4 1/5] mm/memcg: Move mod_objcg_state() to memcontrol.c To: Johannes Weiner Cc: Michal Hocko , Vladimir Davydov , Andrew Morton , Tejun Heo , Christoph Lameter , Pekka Enberg , David Rientjes , Joonsoo Kim , Vlastimil Babka , Roman Gushchin , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-mm@kvack.org, Shakeel Butt , Muchun Song , Alex Shi , Chris Down , Yafang Shao , Wei Yang , Masayoshi Mizuma , Xing Zhengjun , Matthew Wilcox References: <20210419000032.5432-1-longman@redhat.com> <20210419000032.5432-2-longman@redhat.com> Message-ID: Date: Mon, 19 Apr 2021 11:21:50 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.9.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/19/21 11:14 AM, Johannes Weiner wrote: > On Sun, Apr 18, 2021 at 08:00:28PM -0400, Waiman Long wrote: >> The mod_objcg_state() function is moved from mm/slab.h to mm/memcontrol.c >> so that further optimization can be done to it in later patches without >> exposing unnecessary details to other mm components. >> >> Signed-off-by: Waiman Long >> --- >> mm/memcontrol.c | 13 +++++++++++++ >> mm/slab.h | 16 ++-------------- >> 2 files changed, 15 insertions(+), 14 deletions(-) >> >> diff --git a/mm/memcontrol.c b/mm/memcontrol.c >> index e064ac0d850a..dc9032f28f2e 100644 >> --- a/mm/memcontrol.c >> +++ b/mm/memcontrol.c >> @@ -3150,6 +3150,19 @@ void __memcg_kmem_uncharge_page(struct page *page, int order) >> css_put(&memcg->css); >> } >> >> +void mod_objcg_state(struct obj_cgroup *objcg, struct pglist_data *pgdat, >> + enum node_stat_item idx, int nr) >> +{ >> + struct mem_cgroup *memcg; >> + struct lruvec *lruvec = NULL; >> + >> + rcu_read_lock(); >> + memcg = obj_cgroup_memcg(objcg); >> + lruvec = mem_cgroup_lruvec(memcg, pgdat); >> + mod_memcg_lruvec_state(lruvec, idx, nr); >> + rcu_read_unlock(); >> +} > It would be more naturally placed next to the others, e.g. below > __mod_lruvec_kmem_state(). > > But no deal breaker if there isn't another revision. > > Acked-by: Johannes Weiner > Yes, there will be another revision by rebasing patch series on the linux-next. I will move the function then. Cheers, Longman