Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp3970600ybl; Mon, 3 Feb 2020 10:00:45 -0800 (PST) X-Google-Smtp-Source: APXvYqyBKg4viuzsWUaBdTR55klHYBaEfuzbTXK+fZc4KwpXiN/A/3nA690uIG7jFLb7NxSuGTUl X-Received: by 2002:aca:f1c6:: with SMTP id p189mr160519oih.159.1580752845057; Mon, 03 Feb 2020 10:00:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1580752845; cv=none; d=google.com; s=arc-20160816; b=RX2hX+xB2bc+BUcZtD9qRMLtIgqUdB1VLHKKLtwrSRFH0pK6obfJ+1YhRh0hgiaWX8 Qb0BQhc/dMJQzKUUkpHCkbbQgVcQI7d/BST8qUfiz/CQMFIr4w9jm9zjaDCRMD/TZsyS ec37M3sMhDLrxYOtWuaxcMYoF/x6PLb9WtKJ+3ly2jzmu1wI9fTwIYKCbYTy7vWihmSj WnQ4FkcMvUgi+g8fY+x3RtqE7rviYkqw0orrYJWgHw7ISor4MUKUJJT+s25dedjHy+3+ 4stsK7X6Fpg3A9qfN2w5tPyY0nJcxtWJsfMlEgz4IOm7X/BmQRa0PblH1rR/TJVUHEqj WZyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=xac4z+kG6ArFscWeRKYKZoGo960QSwcJzeCpon9xiZU=; b=Z3w2APOY6gWVye0US1pzgBh5deoK1WkYa4NV9DHEvt3h1Jp/PEeX2/jShFXBapqu3V rjE+JWu68QWdRVkuI240kMuuc8fnreeNTZG2Q7dxY8EjIRwC+TzNknKcG5oueKe4UlpR 3lnZ2IUlvQVdgWSoPkUHU92pH5ldY0AuPXDIGFeYlSUY8hi4NNLCOa+bPTcrMxOhHQLt 53wo652b6eFyp5Msc5KYl7BCwqcA+KEEe1/S6qLa7Kx1orXvDOAzU3cy07uahVAt6rAm VR1xjFDmJHRFG9ItI1MxldSwcLqXrimOrLfQ6O93Jc+v6/9xyguQ/8xxegyRI6xsKJGy LVfQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=rkkuqk+T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j20si9746282otp.147.2020.02.03.10.00.32; Mon, 03 Feb 2020 10:00:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@cmpxchg-org.20150623.gappssmtp.com header.s=20150623 header.b=rkkuqk+T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=cmpxchg.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728389AbgBCQFJ (ORCPT + 99 others); Mon, 3 Feb 2020 11:05:09 -0500 Received: from mail-qk1-f194.google.com ([209.85.222.194]:39013 "EHLO mail-qk1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728037AbgBCQFJ (ORCPT ); Mon, 3 Feb 2020 11:05:09 -0500 Received: by mail-qk1-f194.google.com with SMTP id w15so14694085qkf.6 for ; Mon, 03 Feb 2020 08:05:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=cmpxchg-org.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=xac4z+kG6ArFscWeRKYKZoGo960QSwcJzeCpon9xiZU=; b=rkkuqk+TP7TBMTzKraV2XbzaWdxz1n6c3srYOQBY22YsyYFVbWlQt6OkgNv7k+8ctf KgwZEhi6f54kRTjERln1rNfyGEapu/cpTCidoZ8psVYge/pI/fAApIhFBkA3ZrzRNnXq cRzvTThQ0GprU+Lv4TwYWipU7nEFIBCfK3GMPRD39LP5nmJjFPLp+aje+q4rcLN677aH 6qZUgKzlyapKpR7czcHlCWWjXS7N/MYLF2kIGFQPRAVcZmfaEOO/19oasCItvXAJtn7q VOiakTJuYlg9Q3jnxjhp+7TJxaZGuN34UxMltimvmaD/mqRkYnloufSkLNIkr1VscGee +3hA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=xac4z+kG6ArFscWeRKYKZoGo960QSwcJzeCpon9xiZU=; b=miy1+/8Czl+Ia9mdOoxq+itJgv/gcJpZjzrdCatA/wJmb3SMM970ugM2MztgSdkkJI 4JCTbcGyWTwHJ6ngIae2+R198FIWtinx1+pdeYfl6IcRGQRAm1hHp4y8BoyOzcO/UK1u 8tH/cc6AvhXRMtazE23bsMp+SBnC9+dGF2aKuOHdkoo1chEdvEsk6+GfHqvfmmfdVcn8 pCu4Sq2BFYvFQoCH6FwxrHCBA95ioDmsc9r2tL7tcnp4dgAQox9bx6cFf7RVd8qihjQz RjF7KpRxRO06KBzuq3A7/xDz4D982U1KWsEQ7yWLFzmFOLi3jfirvNLPLv0rTe3qo7qm Z4Cg== X-Gm-Message-State: APjAAAWN7RXEAuJnlYpWTGqllTFy3Kzl0+yCfvaXCtXQd6P4E1AgaGil CcywywZWECwe+duMTeojMvCSYA== X-Received: by 2002:a37:68a:: with SMTP id 132mr23231359qkg.139.1580745907969; Mon, 03 Feb 2020 08:05:07 -0800 (PST) Received: from localhost ([2620:10d:c091:500::3:c810]) by smtp.gmail.com with ESMTPSA id i4sm2350466qkf.111.2020.02.03.08.05.06 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 03 Feb 2020 08:05:07 -0800 (PST) Date: Mon, 3 Feb 2020 11:05:06 -0500 From: Johannes Weiner To: Roman Gushchin Cc: linux-mm@kvack.org, Andrew Morton , Michal Hocko , Shakeel Butt , Vladimir Davydov , linux-kernel@vger.kernel.org, kernel-team@fb.com, Bharata B Rao , Yafang Shao Subject: Re: [PATCH v2 07/28] mm: memcg/slab: introduce mem_cgroup_from_obj() Message-ID: <20200203160506.GA1697@cmpxchg.org> References: <20200127173453.2089565-1-guro@fb.com> <20200127173453.2089565-8-guro@fb.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200127173453.2089565-8-guro@fb.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Jan 27, 2020 at 09:34:32AM -0800, Roman Gushchin wrote: > @@ -757,13 +757,12 @@ void __mod_lruvec_state(struct lruvec *lruvec, enum node_stat_item idx, > > void __mod_lruvec_slab_state(void *p, enum node_stat_item idx, int val) > { > - struct page *page = virt_to_head_page(p); > - pg_data_t *pgdat = page_pgdat(page); > + pg_data_t *pgdat = page_pgdat(virt_to_page(p)); > struct mem_cgroup *memcg; > struct lruvec *lruvec; > > rcu_read_lock(); > - memcg = memcg_from_slab_page(page); > + memcg = mem_cgroup_from_obj(p); > > /* Untracked pages have no memcg, no lruvec. Update only the node */ > if (!memcg || memcg == root_mem_cgroup) { This function is specifically for slab objects. Why does it need the indirection and additional branch here? If memcg_from_slab_page() is going away later, I think the conversion to this new helper should happen at that point in the series, not now.