Received: by 2002:a25:1506:0:0:0:0:0 with SMTP id 6csp1879460ybv; Sun, 23 Feb 2020 17:29:32 -0800 (PST) X-Google-Smtp-Source: APXvYqxRM+GAGnjCCiz+e3jxIEqJl3j35posRYElOEl3pRKz5dYVdiVAzzm9FCf1JkW2W146mLfn X-Received: by 2002:a9d:7a47:: with SMTP id z7mr39183700otm.179.1582507772329; Sun, 23 Feb 2020 17:29:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582507772; cv=none; d=google.com; s=arc-20160816; b=eTLIiIcWm1xKlMuIgybSMfZ477Jw053Ev+qaG0GVlyuqgrqkNdShurDiOYSZj9Z4yu G4HpUdITrOifv4PWOLQMZKvfAK7LuiojsdL6tSHz/1B2AZsPnpC5Ce2Tcx9WZ5LZm10z k7oyiUHz7eWAETrTeeCvxCu8PpHqXnMd2OuMGBVuL57MEBZSYd68p/1M3rEkAFPHz4ck 8kdY1TLmadg0iBPLK1wkIgN6xYCFRbP1gTDNErrFhIrh87yoMRLM442BcOMwag7ryK9e ZJhbTjqk4pkkmTeAmU1WAuWePbiAXc3rz7tjfkPbGTu3Io7eJf3Fc3zlDfosNypkgBsG V5UQ== 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=dOiyWLXEWNzPoruxlm3bNEFFoIdLBPA8kzvv001Z0CE=; b=n/HfzbleOmOxekV2oP4/y8AKnKg6mQH15nlhzcs75Wypi+qUc6lNqaDTnqofOD6eOU qn9k+GmjXQNGGq2VWl5rw18zy1z8TrArbt2tbs5oli0hbpIkMjJsKF0eRkTGTuqXTJip rqYUnr1vdxf7cbDdxtTG7RZmG4g2UOMmy/5DkfMGwL71xWBEmOY9EFPipbLW/ywBI1fP CKd/bGSuls+Uy2Ci+7tn7Up6qKT6ZhGhkmJ0G3rMUEW+sSQSLaI9bjZkDNbLNaMmruyq b4Q/MRPkHhLnZ3ebKN+CjbYtAoIGvQarWpQmPfl5YMm7+zR4fmCu5aGaUe39a2Nh0gME I4nw== 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 d10si5781301oti.226.2020.02.23.17.29.21; Sun, 23 Feb 2020 17:29:32 -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 S1727239AbgBXB3K (ORCPT + 99 others); Sun, 23 Feb 2020 20:29:10 -0500 Received: from gentwo.org ([3.19.106.255]:58838 "EHLO gentwo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727151AbgBXB3K (ORCPT ); Sun, 23 Feb 2020 20:29:10 -0500 Received: by gentwo.org (Postfix, from userid 1002) id D49103F070; Mon, 24 Feb 2020 01:29:09 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id D3A8B3E951; Mon, 24 Feb 2020 01:29:09 +0000 (UTC) Date: Mon, 24 Feb 2020 01:29:09 +0000 (UTC) From: Christopher Lameter X-X-Sender: cl@www.lameter.com To: Wen Yang cc: Pekka Enberg , David Rientjes , Joonsoo Kim , Andrew Morton , Roman Gushchin , 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: <20200222092428.99488-1-wenyang@linux.alibaba.com> Message-ID: References: <20200222092428.99488-1-wenyang@linux.alibaba.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 Sat, 22 Feb 2020, Wen Yang wrote: > We also observed that in this scenario, CONFIG_SLUB_CPU_PARTIAL is turned > on by default, and count_partial() is useless because the returned number > is far from the reality. Well its not useless. Its just not counting the partial objects in per cpu partial slabs. Those are counted by a different counter it. > Therefore, we can simply return 0, then nr_free is also 0, and eventually > active_objects == total_objects. We do not introduce any regression, and > it's preferable to show the unrealistic uniform 100% slab utilization > rather than some very high but incorrect value. 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/<...>/ You dont need a patch to do that.