Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp154388ybf; Wed, 26 Feb 2020 10:31:53 -0800 (PST) X-Google-Smtp-Source: APXvYqzz4W+yW887NUUgjFdXJBwSqGtHgHYwMQIcJHz7M6R9swR8HbnxyapvIpiYK6gZjOAztgMy X-Received: by 2002:a05:6808:4cc:: with SMTP id a12mr265123oie.115.1582741913150; Wed, 26 Feb 2020 10:31:53 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582741913; cv=none; d=google.com; s=arc-20160816; b=aAzW13Uu30nFwnKIJ1S3WScLtwU3VBobbDKv2EIsMTm32CzgfJezN3nON4pCQMWwO9 rMdlpO2vF2AR/Co7d7Y+BrUNMcqf+dbwGQNHu+VFHxwYdg3zh+MaL03vt69DYu35RU/7 2LE5+c3GzhDLPMM9BUu+DM54dQCm1hxhPGbZmAyIbSFnN+jWpBPPOBK3tOu1MixAjRWU 7LnKKTj6eyOIRPBS2y+14QlPXSzl0Wv+BOB9mIVozCPCXWxRqz9DipGFlXVbVYrSZA6G wCpV3nycrhgQhp7lZifA4ZwTI3ELm90fHlgHfuPdTaZFIKzwD0xLSS4pmYa2dvrpYcYQ 7n0g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=Ki+HCU01BbwvDUZli0W01BgG7HqFgR984Nj2Wv2/T1E=; b=kBbw3Cnr5AxNGDpWyLG9muwXjFMcUu/7HxW6OVXWbOEwjKSod3Ing2hZ+gi8IOrMAd 8bzLYzCcrIlK6qFtdby2YmOrJ9Y/FsZsBDOLuXUEILUM9lP/CXUD4PAaOsHf+xCKU6KT r3YlEQVOTWJ/NpzsvcHb+VK4AveuWNSs1sWGJ7NGbttAzdnFBZWGisFc/BESmpvFaq2f YHn+ykwLisj5nKoU3yFHWTQkSmntiuJO48JPb5H87nbjlzptdWsw7fYRJ8FNAyqJo97+ Z2G7WTv6xzorN+57qaNtsFLeGdBO89+/X+IYpYfgD5M2zwqe0uNWNLenPLf9qgNdcCj8 KSpw== ARC-Authentication-Results: i=1; mx.google.com; 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 v26si222621otj.0.2020.02.26.10.31.38; Wed, 26 Feb 2020 10:31:53 -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; 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 S1726980AbgBZSb3 (ORCPT + 99 others); Wed, 26 Feb 2020 13:31:29 -0500 Received: from gentwo.org ([3.19.106.255]:58966 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726789AbgBZSb3 (ORCPT ); Wed, 26 Feb 2020 13:31:29 -0500 Received: by gentwo.org (Postfix, from userid 1002) id 885B43EC05; Wed, 26 Feb 2020 18:31:28 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id 875FF3EC04; Wed, 26 Feb 2020 18:31:28 +0000 (UTC) Date: Wed, 26 Feb 2020 18:31:28 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: Roman Gushchin cc: Wen Yang , Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Xunlei Pang , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm/slub: improve count_partial() for CONFIG_SLUB_CPU_PARTIAL In-Reply-To: <20200224165750.GA478187@carbon.dhcp.thefacebook.com> Message-ID: References: <20200222092428.99488-1-wenyang@linux.alibaba.com> <20200224165750.GA478187@carbon.dhcp.thefacebook.com> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 24 Feb 2020, Roman Gushchin wrote: > > I suggest that you simply use the number of partial slabs and multiply > > them by the number of objects in a slab and use that as a value. Both > > values are readily available via /sys/kernel/slab/<...>/ > > So maybe something like this? > > @@ -5907,7 +5907,9 @@ void get_slabinfo(struct kmem_cache *s, struct slabinfo *sinfo) > for_each_kmem_cache_node(s, node, n) { > nr_slabs += node_nr_slabs(n); > nr_objs += node_nr_objs(n); > +#ifndef CONFIG_SLUB_CPU_PARTIAL > nr_free += count_partial(n, count_free); > +#endif > } Why would not having cpu partials screws up the counting of objects in partial slabs? You dont need kernel mods for this. The numbers are exposed already in /sys/kernel/slab/xxx.