From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 5FBACC4332F for ; Thu, 2 Nov 2023 02:48:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id E59618E0010; Wed, 1 Nov 2023 22:48:43 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E09B88E0009; Wed, 1 Nov 2023 22:48:43 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CF8638E0010; Wed, 1 Nov 2023 22:48:43 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id C1B688E0009 for ; Wed, 1 Nov 2023 22:48:43 -0400 (EDT) Received: from smtpin13.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 8088BC0E35 for ; Thu, 2 Nov 2023 02:48:43 +0000 (UTC) X-FDA: 81411481326.13.3F2E067 Received: from out-183.mta1.migadu.com (out-183.mta1.migadu.com [95.215.58.183]) by imf28.hostedemail.com (Postfix) with ESMTP id 8F0D8C0013 for ; Thu, 2 Nov 2023 02:48:41 +0000 (UTC) Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=s3TDnI7N; spf=pass (imf28.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.183 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1698893321; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=kchOEnv+0+G+NTW2ZTXj19K8ovH9eGO5OxgkkLRBKSc=; b=LdFdYMriBYDRMcADkDgHc/0E98vw3tDJGZihjfzT/3grzSH8ZVYiGLM+ubmYCJO1mi/His 8VvRJ1x6hskuJGXZL0SxwqnpqBjtCyExIKpTWYuaRMd+WX7P7kskX0KdAQWdOM57b/mEeP jEZfClmWsknFV+60sIIlXPOpSszHnh0= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1698893321; a=rsa-sha256; cv=none; b=Kvy8eGuGj8AKrkTO3ge57MYsSHIMSpwaXU4dXY8QA02o6qlm0hG9whYQAnVfbjReyua9Ua MT43q3qQUMSt9+SFZN22UG4hv7IJ2qX1D35sGgnF2hivRFf5PfsA+o4nr7Xi63dYSVI/VU EF2p+t+V7j/t12spSd2Nhzo/TwuJzNw= ARC-Authentication-Results: i=1; imf28.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=s3TDnI7N; spf=pass (imf28.hostedemail.com: domain of chengming.zhou@linux.dev designates 95.215.58.183 as permitted sender) smtp.mailfrom=chengming.zhou@linux.dev; dmarc=pass (policy=none) header.from=linux.dev Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1698893319; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=kchOEnv+0+G+NTW2ZTXj19K8ovH9eGO5OxgkkLRBKSc=; b=s3TDnI7NaTzsW5+1iIijs5G+fJJjdXby6MT2LJOvjPjIVlcKzEVEwIjZd5Q9tC2k5Vofn7 luHa3KYhVXZ/wGRAx8/pcgiJj3WYKgqWAXfDOTePM56UBpJEdDLQlSbe3wJfNtDPtfbjvI UJPZ8YE7YSeIlEthD2kYj34DgLsU5NU= Date: Thu, 2 Nov 2023 10:48:10 +0800 MIME-Version: 1.0 Subject: Re: [RFC PATCH v4 9/9] slub: Update frozen slabs documentations in the source Content-Language: en-US To: Vlastimil Babka , cl@linux.com, penberg@kernel.org, willy@infradead.org Cc: rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Chengming Zhou References: <20231031140741.79387-1-chengming.zhou@linux.dev> <20231031140741.79387-10-chengming.zhou@linux.dev> <211ac705-5972-9b39-73f1-a608e65b6de3@suse.cz> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou In-Reply-To: <211ac705-5972-9b39-73f1-a608e65b6de3@suse.cz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Stat-Signature: ze5ezmbyj93iuhm8phgwcuph1ymnaj9t X-Rspamd-Server: rspam10 X-Rspamd-Queue-Id: 8F0D8C0013 X-Rspam-User: X-HE-Tag: 1698893321-80818 X-HE-Meta: U2FsdGVkX19qWdUY7Dt0NGkKR/jrRpIsKPF8TVB5GYDJqnSnWGXzJd9WMVa/XNzbdtWIJ+zxo2atxDn40ht17yeNnUtA2cuWIhhOsUovt0BE1PWiEp/JJ4nWDo5BkxWASxT0Y1HsXZCIyYAWZSxYFfD9A1bg56KNqluwMavFsvaEWlubcxyPG5tjB0JtetTlJ6h/GfT22MPhfNL220JI49LsHfm9+Vop9t5JwbOVWYtc6PvylkWZVxgIdqMRzq/uxphWU3w4X4CsGDU8tXT1LLmuM6eaedQsGufn+Ne5Z10gv6f7CbrVImhkmszEJ/tgLfa7Bdy76dsIiKzxJr6+w6ZswAsY+KdpliZM6FvFFAqE7tvqUPH2dfjBe1PSRchni7OasKGvGKCfPZGZTzjhPu9Wt2kli77y3iX3wZrdUe43zM6fhykZSe48YM3Jf9jPPgM4hAuv8ubaOEQ6tJxb1j0IQxJV/Hp1EvyVkErA4+WXjrMbxE9dFFrALCYxk40zTqERw24qc4GbuKubyKx41qm405AkpryFLHHqgPr9BBki4RRSqbcXo7oNgQGMKNVxpQYGf8jxqlUCfw+48J84jtjQRFALygLEXmqz2OjoePbjViXiLwf4f25C+8MuiNZrIAeR79PDiXtNUhM5B1uvsquuo/zzCoNcT9aNFvJ4gmqDdfAsmorfst2IcOG59qihIwEyRluQseBOINE3BI+hvCk+mTnWRtWEUa768DXsq0QL0KS0UdEkeWOHd9HlWyHZldFF8r3JNoBDTMviaoRxad6GDAVXEn40HeeN27aBmSpRQ3pT5Krf8C1dM8uhgybERDx/VitfV5fBBu6SkVkJjkOR2sbVZAXu8JVKXM+tJYsdpsXFAHApZmRTxRhCBgikcC8FrkwNaS4pOrbXMtfSMXnOqKKqOR0HWAgSIN7OxhsWgXI9rOnCPZvm4J9wBjEao6J4Soc9mnQvDbHAjA2 xHNOOU9w WgMa4aEEv+Yj976R5jvcKEW7dqXiUSlreBGxqVJUK2HRPb+/Tq6fLklAEOQdsJeuFXyrh47vj34aXVtoSjIBcTRvWfpWTh8N8yxkuCEbwq3Lbj0XXBIiE1aRuWW99dmGIa8xBv7Zd+qLxdnKMKatFnFxT71yplMt0X3GRNiL6dp5JZhliFJhF3gcFgyxUrAQRPxLIFdDNBQFe9yosuYwzNfWJOUDo3YxwzeSP X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On 2023/11/1 21:51, Vlastimil Babka wrote: > On 10/31/23 15:07, chengming.zhou@linux.dev wrote: >> From: Chengming Zhou >> >> The current updated scheme (which this series implemented) is: >> - node partial slabs: PG_Workingset && !frozen >> - cpu partial slabs: !PG_Workingset && !frozen >> - cpu slabs: !PG_Workingset && frozen >> - full slabs: !PG_Workingset && !frozen > > It could be useful to put this also to the initial comment description. > Towards the end of the comment, there's a block explaining > "slab->frozen". It could be extended to cover all 4 combination (but not > all of them need such long explanation). > Ok, I will extend it and put in the cover letter of v5. >> >> The most important change is that "frozen" bit is not set for the >> cpu partial slabs anymore, __slab_free() will grab node list_lock >> then check by !PG_Workingset that it's not on a node partial list. >> >> And the "frozen" bit is still kept for the cpu slabs for performance, >> since we don't need to grab node list_lock to check whether the >> PG_Workingset is set or not if the "frozen" bit is set in __slab_free(). >> >> Update related documentations and comments in the source. >> >> Signed-off-by: Chengming Zhou >> --- >> mm/slub.c | 16 ++++++++++++---- >> 1 file changed, 12 insertions(+), 4 deletions(-) >> >> diff --git a/mm/slub.c b/mm/slub.c >> index bb7368047103..89d3f7a18a73 100644 >> --- a/mm/slub.c >> +++ b/mm/slub.c >> @@ -76,13 +76,22 @@ >> * >> * Frozen slabs >> * >> - * If a slab is frozen then it is exempt from list management. It is not >> - * on any list except per cpu partial list. The processor that froze the >> + * If a slab is frozen then it is exempt from list management. It is >> + * the cpu slab which is actively allocated from by the processor that >> + * froze it and it is not on any list. The processor that froze the >> * slab is the one who can perform list operations on the slab. Other >> * processors may put objects onto the freelist but the processor that >> * froze the slab is the only one that can retrieve the objects from the >> * slab's freelist. >> * >> + * CPU partial slabs >> + * >> + * The partially empty slabs cached on the CPU partial list are used >> + * for performance reasons, which speeds up the allocation process. >> + * These slabs are not frozen, but also exempt from list management, > > ^ are also > > (otherwise somebody could read it as "also are not") > Ah, will fix. Thanks!