Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp602097yba; Thu, 18 Apr 2019 06:40:02 -0700 (PDT) X-Google-Smtp-Source: APXvYqz7Q1BiycSh0+BXxkkxrAA/Z4T9yhLwbTiotqIjfm7M2ZtDnhLks76ZLUSYkh9Kz9a9Rge8 X-Received: by 2002:a62:6807:: with SMTP id d7mr93778369pfc.75.1555594802638; Thu, 18 Apr 2019 06:40:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555594802; cv=none; d=google.com; s=arc-20160816; b=0DLuL2VOdNZsr3c8P1gCXRZbDTRDJfnbSdrFI/qFSy9B/zIxqSdrW80qwAOXAu5qOV JkFsSpUnM0PkClZhFimQPASkk48Wax0Emlzo6Wlx+OagAtbnKyc1q0bnjB4kZ1tW9zjz DqlTFbMfCfZZ+5+J6DszQ/K5vVSMIw6lowyjNH7aHBfaA+Y/4msYzyrH6ZZPw6yYf4Xm mdn0Fa2ApTrDMggOOR2DbqCbV2dAJdR8KP65CUXLREYGFHFiBT0xgXbBxQwXsTNNxHls ZRsft8lFvGH/CwEmCLyGumClbkxV4FgQdXz97a+2MXN3ZCcoonBUMusR+aw4raAsgkDg D8BA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:feedback-id:mime-version:user-agent :references:message-id:in-reply-to:subject:cc:to:from:date :dkim-signature; bh=YooluqR2zLnyx9kIzkVplFE7uY5Qn68HU3DwywbdkkE=; b=X+J1DioV2uM66l8JERbGRR9PULAxS9X4DkAuB+VzWTcLehnV28Paq9fXMbmvY+mTTd ma9QmINpf1wqiPqFUsa+RbW7FEwH1BeB8qAlNYHS5pxjB66GDJ8Bw5VoB7WAv+t8Iyd1 JBlw4qr6bJSbtblNHQ61xaoXuOggBFddp3ecCm5GwEJirOMbdNRuuCk8f7yY0RmLfw3U lbj7fsNHDafgjxoa/A9i1Li+M2xdYNYMAotgJGLy3IZpk7/u66Eb8af+RxqR8o9pOYpO woWu4hq10Tb9/P/gsuzLA1CgEkPn12Z1V1SMGzH7U9fro7s99I6Az+zOA2Q0QBWsgO67 KsHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=X8JPWrXu; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id k3si2162927pfi.229.2019.04.18.06.39.46; Thu, 18 Apr 2019 06:40:02 -0700 (PDT) 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=@amazonses.com header.s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw header.b=X8JPWrXu; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388817AbfDRNip (ORCPT + 99 others); Thu, 18 Apr 2019 09:38:45 -0400 Received: from a9-46.smtp-out.amazonses.com ([54.240.9.46]:50444 "EHLO a9-46.smtp-out.amazonses.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733205AbfDRNip (ORCPT ); Thu, 18 Apr 2019 09:38:45 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/simple; s=6gbrjpgwjskckoa6a5zn6fwqkn67xbtw; d=amazonses.com; t=1555594724; h=Date:From:To:cc:Subject:In-Reply-To:Message-ID:References:MIME-Version:Content-Type:Feedback-ID; bh=Mn2jJaVyXnfxUugHqDabQsqBL//yamSkxsI3eXyDlrA=; b=X8JPWrXuwI/DmpMMQRAri2xJUwQ0i7jWaes61IDWWWuJLbXYDrbCni8Zo0sXjXuW yuEhkjEnFwk2btLft+ero1yzF/zwR+mKYyrtIAMwHcfTE867Fpu+T5ENro+L+x0VPM8 HiGNCzzwCW0kHJo5F8RXhjgVSKoGCFVBJ3UtdK4A= Date: Thu, 18 Apr 2019 13:38:44 +0000 From: Christopher Lameter X-X-Sender: cl@nuc-kabylake To: Roman Gushchin cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, Johannes Weiner , Michal Hocko , Rik van Riel , david@fromorbit.com, Pekka Enberg , Vladimir Davydov , cgroups@vger.kernel.org, Roman Gushchin Subject: Re: [PATCH 4/5] mm: rework non-root kmem_cache lifecycle management In-Reply-To: <20190417215434.25897-5-guro@fb.com> Message-ID: <0100016a30abc330-011d895a-b4af-40a9-8937-990297ed4ffd-000000@email.amazonses.com> References: <20190417215434.25897-1-guro@fb.com> <20190417215434.25897-5-guro@fb.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII X-SES-Outgoing: 2019.04.18-54.240.9.46 Feedback-ID: 1.us-east-1.fQZZZ0Xtj2+TD7V5apTT/NrT6QKuPgzCT/IC7XYgDKI=:AmazonSES Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 17 Apr 2019, Roman Gushchin wrote: > static __always_inline int memcg_charge_slab(struct page *page, > gfp_t gfp, int order, > struct kmem_cache *s) > { > - if (is_root_cache(s)) > + int idx = (s->flags & SLAB_RECLAIM_ACCOUNT) ? > + NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE; > + struct mem_cgroup *memcg; > + struct lruvec *lruvec; > + int ret; > + > + if (is_root_cache(s)) { > + mod_node_page_state(page_pgdat(page), idx, 1 << order); Hmmm... This is functionality that is not memcg specific being moved into a memcg function??? Maybe rename the function to indicate that it is not memcg specific and add the proper #ifdefs? > static __always_inline void memcg_uncharge_slab(struct page *page, int order, > struct kmem_cache *s) > { > - memcg_kmem_uncharge(page, order); > + int idx = (s->flags & SLAB_RECLAIM_ACCOUNT) ? > + NR_SLAB_RECLAIMABLE : NR_SLAB_UNRECLAIMABLE; > + struct mem_cgroup *memcg; > + struct lruvec *lruvec; > + > + if (is_root_cache(s)) { > + mod_node_page_state(page_pgdat(page), idx, -(1 << order)); > + return; > + } And again.