Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1092195pxb; Thu, 4 Mar 2021 03:06:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJzTp5DJ8t1zUH/r5hfBFVn4VOHCcsq7x3ki+P2EK7BP91DvlucLssxXmRY6sjJ+bpRUFPAd X-Received: by 2002:a17:906:2804:: with SMTP id r4mr3498869ejc.521.1614855974090; Thu, 04 Mar 2021 03:06:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1614855974; cv=none; d=google.com; s=arc-20160816; b=XuTcSkmqAMYiMIP/FWS9LCCGXDeaMCsyKbolqU3j0R63SEsgkrsx4JLOIv6X2VP0q0 bK53tEQaLooD3s6QvEwqOnGoImGYB4raswOP522RVTnZd2eDrtq05tjjm82akbH06S1V FDXPa3SXCtfOqiKeyuloydxSP6N+5Uokyxo0NR9xOrVEUAUhRmUK3ey4bsnGlPT3mIMx oEP1NOPIwOfANUQEcS1XvpiUp4v2UptEY/PAnDXLMTQ2oQ7+6DknWWhGZIvG/i6n/Ake 4wRm7yDMuA4Xhgsy1J4zHfW2Ss5X47bBvZUp7BIBpctoJogBKE2k17iWQLX/CC0MycH+ QXww== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ZH1C/G3uhNYXYHLyRoi9Xr5MI5GoH8WMp548MeloCis=; b=oCJx9QYL/L16zN9t3ccB4ieoTr6v1VNp5bvhS0+SGBVTOHP9SXqNV/ulwSH6Cq4meK ME2SUUreB1erWuIUdv8aJIRdaCqm9p6tFWNUWHHTKD+Qbf7dYXAwW/A/g2+CH+DYMJNJ nULiUkddInYWyhSFhgZfskwSKaWYHozOOBRfUyZV61Ezd6+Jd0TsLpajKKFzXoBcD+7I LvbtlNo5Q43MWDkvpXf+rBpBlD5reJSapFTwIAYZKLSswVaKBZpEGZG3S0ue3YHaUvzj z0plCEnZK5QALuXhTiQp2/nrWeGSoeg5xolMEd3iqFZnM9/4Y56SDw/OPdzkB2a5ZJmb hklQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Crw7M0Lc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id go37si1097954ejc.406.2021.03.04.03.05.51; Thu, 04 Mar 2021 03:06:14 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=Crw7M0Lc; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386048AbhCCRqO (ORCPT + 99 others); Wed, 3 Mar 2021 12:46:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1383350AbhCCObR (ORCPT ); Wed, 3 Mar 2021 09:31:17 -0500 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 667E6C061226 for ; Wed, 3 Mar 2021 06:27:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=ZH1C/G3uhNYXYHLyRoi9Xr5MI5GoH8WMp548MeloCis=; b=Crw7M0Lc+wxp42QJC8iqj/AodZ RBoFd5Okwm21AmLXrF02/0bXsuEpYbm5LHfL2Hi+FVyTD2p0D9JOyaDVJ0fOOm6SLU9qXgUxtsEW4 g7x8hiSCt6uoXKbxfPiNyYOWUFcBedpQLmiwOz5fWSwBzQUv8DbiIr0eYB+h3Cvr2y/fzPb7xVu7k hsu2FoIEa0DE4nBW2VNJX150lB3Rdd08e/af9NuwOB0m2FT+sLStRlngPoQMnh6E+qQuXrQmv9lP9 MBPuAkOwWcIUVW89FiyXwFJU2zAh+tx95RRNjhPSU4A4XLXADV3NKgo3PKRisXjZnSvxEaJ+Gn/zf O1y/OVMA==; Received: from willy by casper.infradead.org with local (Exim 4.94 #2 (Red Hat Linux)) id 1lHSS4-002wEW-N2; Wed, 03 Mar 2021 14:26:14 +0000 Date: Wed, 3 Mar 2021 14:26:12 +0000 From: Matthew Wilcox To: Christoph Lameter Cc: Xunlei Pang , Vlastimil Babka , Wen Yang , Roman Gushchin , Pekka Enberg , Konstantin Khlebnikov , David Rientjes , linux-kernel@vger.kernel.org, "linux-mm@kvack.org" Subject: Re: [PATCH v2 3/3] mm/slub: Use percpu partial free counter Message-ID: <20210303142612.GC2723601@casper.infradead.org> References: <1597061872-58724-1-git-send-email-xlpang@linux.alibaba.com> <1597061872-58724-4-git-send-email-xlpang@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 02, 2021 at 10:14:53AM +0100, Christoph Lameter wrote: > On Mon, 10 Aug 2020, Xunlei Pang wrote: > > - atomic_long_t partial_free_objs; > > + atomic_long_t __percpu *partial_free_objs; > > A percpu counter is never atomic. Just use unsigned long and use this_cpu > operations for this thing. That should cut down further on the overhead. What about allocations from interrupt context? Should this be a local_t instead?