Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1331474ybl; Fri, 10 Jan 2020 16:30:42 -0800 (PST) X-Google-Smtp-Source: APXvYqxnrcAAIQjaxuPoWyWnB5l/HATd4doSCTEgEJTlviDacPTaVL0J1LpmaVkALSKdat+DGoHT X-Received: by 2002:aca:e084:: with SMTP id x126mr4399147oig.97.1578702642033; Fri, 10 Jan 2020 16:30:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578702642; cv=none; d=google.com; s=arc-20160816; b=0YbTcvs9E/b7vQ1fx/DGZeRUp3mqPJPp7m8MQZxEOe80GqXofWd3eQ4qzDhrTZEx4P QjYXWNOmjrERngIp7WAuolBfDs8fuuxAC69TuXTqYvoFU5VAYx496Y94q8uM4uH73VKf wGiHxiNBNtK1kOlcySpeZn+CvbTRdEf5g4WenuStqZZOXE1PGXbKKhC4WKRNUVzCCDin 3OCEq9E69ce/gy5BKuB+etELOU+77E2P6474B9/tPtr+C33U8PQQN9MmwlmYh8VldKTP VW0vDy4yPvX6CkxB4/BMYSakqpNSpqI2lf6685ikLqqHq0khnw9dEDkFGuGbFUyNR07k VExw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=NJNkeTlQeivzybUuWcx9iwSzhzlDjNiYUt081VfoN4c=; b=Zm1iu81+xbQaWvKCZPGUPKFA2+qE7YoLogyla28Qiq/69/G2kLBorjL3cwEOiAyl1Y KyK797/FbcklbYGYsorKEok/TWdMwKNji/HCyvxKXBQopgPk7k5uS/8HtMS3w0DTmjCi TtKpldavXMXOSM7or1qcEXJGtSmf8w4FUC3Z16mKMSkk0M6kLtNpoqfIA44OzZG6i1Uf ky9xSiJff0ha4c2mip4iGEpRsUGFrpm/5G1yVkGmAMeaM+6/xtyOaqtjRIwl7ZnCoYBc yEcuQuk42FT5Mbs0WgfGMgrLHJfOGK8jewMG8EIWVukIW3+FTSHqqchnH6rtqBipuouV pHPQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="TwKbw/ma"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id u62si2160219oig.29.2020.01.10.16.30.30; Fri, 10 Jan 2020 16:30:42 -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=@google.com header.s=20161025 header.b="TwKbw/ma"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727782AbgAKA2e (ORCPT + 99 others); Fri, 10 Jan 2020 19:28:34 -0500 Received: from mail-ot1-f66.google.com ([209.85.210.66]:32845 "EHLO mail-ot1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727544AbgAKA2e (ORCPT ); Fri, 10 Jan 2020 19:28:34 -0500 Received: by mail-ot1-f66.google.com with SMTP id b18so3741256otp.0 for ; Fri, 10 Jan 2020 16:28:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=NJNkeTlQeivzybUuWcx9iwSzhzlDjNiYUt081VfoN4c=; b=TwKbw/maTje9O+6K+AaSChQ3qI7lnU05ARSs0EJm+ULMqILrCJLwsvhBP7NhMsDYVW Sy+DSLyCZwJr/9LoAfM/h+x6S+FrcD/7ASrj5IVeb8j6lE0mlxL2Hj8ajX9gV9mm5ZC8 H9dB/o9QJQlpmb8VeCy1owDzjedi0JBlbAag2P6wvvmbzTC+zWK618sI9T0Ip6obAU61 fqPrK3D+C3bQowSmWKnZyGThkNiBpLN3Z9vkbSEhZ/7mG6FKhJOaNmH3cJ8Masbu962F AmtS6Ns7Tn2J87fZDOcddZkZzcdTBA5E28OjaKb7qkCFG76BKUnNZSvm22nTKpEsAout y/og== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=NJNkeTlQeivzybUuWcx9iwSzhzlDjNiYUt081VfoN4c=; b=tuL8CcBm1TeF/F4hMG4XFDp1eHyxaJno7WGCsFOKfgUx3CwFD3BWCe6/qvX9Om3qPO iboUXP/0U1tm25oSaQ8awOT578J7zK8YRnUWWat9GitD1C7q6z6K/ktPu3fTqI2NO1+J tF/EWARu8YpDzah7QOOeN244H8L8gNDQKDz8gS2erlrtGcya2gryHoU1OmVcB/NYzDTx NcFNWbf62Qo/X3Qnd3CXvHhwd4IusTyuwTIvGpL9Rd5Hr3zFDmq0y+Xr2K1ApdLC4nkk 6vzO/ip5eHQ9yUmV1qziVe9+/fO1673j1M4depaKt/M6j0wKtVIaUF9TonzKBWDUkJmR j+pw== X-Gm-Message-State: APjAAAXm6bEsfg8C4YvEuIEl/U0embRI3TJhRkqlbGPoGI+spHCsaqUz 2vQoVck9TDog76HjBH2jgM5aBn5JqTEIuT3+kXs/HA== X-Received: by 2002:a9d:7c8a:: with SMTP id q10mr4622088otn.124.1578702513230; Fri, 10 Jan 2020 16:28:33 -0800 (PST) MIME-Version: 1.0 References: <20200109202659.752357-1-guro@fb.com> <20200109202659.752357-6-guro@fb.com> In-Reply-To: <20200109202659.752357-6-guro@fb.com> From: Shakeel Butt Date: Fri, 10 Jan 2020 16:28:22 -0800 Message-ID: Subject: Re: [PATCH v2 5/6] mm: memcg/slab: cache page number in memcg_(un)charge_slab() To: Roman Gushchin Cc: Linux MM , Andrew Morton , Michal Hocko , Johannes Weiner , Vladimir Davydov , LKML , Kernel Team Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 9, 2020 at 12:27 PM Roman Gushchin wrote: > > There are many places in memcg_charge_slab() and memcg_uncharge_slab() > which are calculating the number of pages to charge, css references to > grab etc depending on the order of the slab page. > > Let's simplify the code by calculating it once and caching in the > local variable. > > Signed-off-by: Roman Gushchin Reviewed-by: Shakeel Butt