Received: by 2002:a05:6a10:17d3:0:0:0:0 with SMTP id hz19csp2612842pxb; Mon, 19 Apr 2021 09:33:54 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwcCdDGLITSHOAqrj3Y600mV95gk1ks3ptA0tzXUybanISQbgrMLWoEPTD1kbCR2hg9lz9a X-Received: by 2002:a17:906:4881:: with SMTP id v1mr3773998ejq.383.1618850034251; Mon, 19 Apr 2021 09:33:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1618850034; cv=none; d=google.com; s=arc-20160816; b=c5T+Qa2ra6rrls/hIlr1sgb2KfLEqnvih85/GTXgtJzcmdyPA19z3EDL7M4nu3ASKt bn6A64fGksK7hAntetsVg6fpcNzdq5POu2HS04Q+trcwxEoyrCxZSgGjIIVPNlB2WdWa stRCIdg3WqEjPv2hF01fGGSRaK98NNm93yX7MybHrA5bdovY/0kiGAoFuvPTUwGNJ6tS sRYvX4X8jxNvxszm9vJM+3q0hQOha5j2U8k89s6lP9y1BaW780GMu+s/22EyLK/P/wIo 4bQGpIZwR6QnW1H0u7cTaJQ+255wuS0BhliXwKJeghrKXUh6JP+akaFGqo657VBVQB6d AH5g== 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=fqJmgeuiMFVLhBvmQoDThETkhKCzy/6fbNKOoBifg+Y=; b=L30ngx7ph3tOltPnxAmQD5/CUT3p8aL5VW1rPwoExxTU/M0thIBqTZRbqoZcNgUORN XdndP5M17xeBTZAenZn6q5YgFQG/VkkIM2IH1VWCR46Z9wlx2MQg6PGF+q3jpfEPBRe7 lBgSIbjdKiVxGKHCxLIdrybUbGlzwSNlumcQetiPIyae0rC8V4G7UOjKnf8KAUxw0SnB o/Ul6rc80pFC5k2Xateaearx6a1i1uxfHN62YhYG0SkIIDgvHx+9LQNsWr9JiCusOfWV ynFHU0dASBg0viQ5Sb5iA4EzO9mEVahS9/sBta7Lbg5h/uzC5I/PG3XRaUsMwAV5qGxC E8qQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=NRcYV6oj; 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 s9si12256411edd.56.2021.04.19.09.33.30; Mon, 19 Apr 2021 09:33:54 -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=NRcYV6oj; 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 S233878AbhDSQTV (ORCPT + 99 others); Mon, 19 Apr 2021 12:19:21 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:57405 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233752AbhDSQTM (ORCPT ); Mon, 19 Apr 2021 12:19:12 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1618849117; 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=fqJmgeuiMFVLhBvmQoDThETkhKCzy/6fbNKOoBifg+Y=; b=NRcYV6ojY6LySCLGkZmWUkVR5bevhvhwA5qG6grUSUYZf1pmLPP3AS7e5v3pAB+zWwSxel 5ySVZBYq0JHg8zPLqF68NL/J3IadS8a1H++6b+fiOa50VU+wcmSYHOI7+JjZw8ptsyv54c 9lx27nln9sf6DNxxdqsr5LDLqoBCAGg= Received: from mail-qk1-f199.google.com (mail-qk1-f199.google.com [209.85.222.199]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-553-YAeJLw_sMmyzCkYxUjoAnw-1; Mon, 19 Apr 2021 12:18:35 -0400 X-MC-Unique: YAeJLw_sMmyzCkYxUjoAnw-1 Received: by mail-qk1-f199.google.com with SMTP id g184-20020a3784c10000b02902e385de9adaso4604016qkd.3 for ; Mon, 19 Apr 2021 09:18:32 -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=fqJmgeuiMFVLhBvmQoDThETkhKCzy/6fbNKOoBifg+Y=; b=oWnARPmZqr+yWOYCBdBChGNK2XOPhGnTVTccbbJeBuc1zfpujeAelpxAwV6bQLsvsm OfsG0c5aD3kM/kBEdziR7unYJDr4rdEeUgi3iEamNOKZoq/R2L9r60Hy91wJcuAeuTCr yq2oUsTlwE9/Gw+r47ySSbwy0Ht1YNo+ur0XhATIFXWQ1oWMOclqmuiyQXTySxTnIoKt l9c4d9uMNED7BKrzruV/MyfRRw5+4n6NghoV59fVMg0cbUf5L5sqFltpm/rhRsqGse3m rEo7eg1TFUm4yENMesiuNlsN19HT9HcpGNhrFpJAVlvWPcwMHKoOR25M9JnYZhhqduVT Axyw== X-Gm-Message-State: AOAM532u0MxNRZI3Ou1O+TbI31YuwhIHb1TomDPLGtA2Ui2gaXgXhkdU t5aW3np1GdKlT/lkN1LAU9pr54hI/U6neboCx7vklH8idIQ9wkHFR+6DnGqkiEA9Bja9oJSZYIR jPfJlGM8RCINt75QHMckCR1CC X-Received: by 2002:a37:9cb:: with SMTP id 194mr5491932qkj.4.1618849111634; Mon, 19 Apr 2021 09:18:31 -0700 (PDT) X-Received: by 2002:a37:9cb:: with SMTP id 194mr5491908qkj.4.1618849111409; Mon, 19 Apr 2021 09:18:31 -0700 (PDT) Received: from llong.remote.csb ([2601:191:8500:76c0::cdbc]) by smtp.gmail.com with ESMTPSA id f16sm10296757qkl.25.2021.04.19.09.18.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Apr 2021 09:18:30 -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: <140444ea-14e7-b305-910f-f23fafe45488@redhat.com> Date: Mon, 19 Apr 2021 12:18:29 -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: 8bit Content-Language: en-US Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 4/19/21 11:21 AM, Waiman Long wrote: > 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. OK, it turns out that mod_objcg_state() is only defined if CONFIG_MEMCG_KMEM. That was why I put it in the CONFIG_MEMCG_KMEM block with the other obj_stock functions. I think I will keep it there. Thanks, Longman