Received: by 2002:a05:7412:b795:b0:e2:908c:2ebd with SMTP id iv21csp113900rdb; Wed, 1 Nov 2023 19:49:15 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGdNzii0Gl8874LC5S9zY8TGUBdXQmFldHl7ZVglQXEnjPvZEMR50ILpoHZKaLJQ6VKlIDS X-Received: by 2002:ac2:5234:0:b0:508:264e:2ded with SMTP id i20-20020ac25234000000b00508264e2dedmr13190413lfl.38.1698893354938; Wed, 01 Nov 2023 19:49:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698893354; cv=none; d=google.com; s=arc-20160816; b=ijlZAuyyde8VIvJ+mqK1UBHYx6Rpb+Xscb30C8uMS7sZWvnNfbs30lqxWLP2DQw8fI oZSFCn2SW91bHZ9R+RR6pjZsZVOkHXs3gVq7Tf0kqjix5GjccNo3WW2StTCaU919lN3F +XYSs/pmF7MiHDL0QcnKIk1UkNDmjo4zmZf+UMhzLBdkmXgJtjTEDNXCoGyxhvYF/Gs5 3tg9MI0kIapRMOQBe4WcSjYazEmGTu+EbaozoDb5b5wX5gvTSbpQzmmViPgFDNCOHkCN j78nT6dpbYXGrSEpxerw8h+pXMBKu4gVelJhK6Vbrt6YtFeQ4tJA0qXBsGeyqRjTo3/F pEmw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:mime-version:date :dkim-signature:message-id; bh=kchOEnv+0+G+NTW2ZTXj19K8ovH9eGO5OxgkkLRBKSc=; fh=T1ZC7/Kdo62exLELpwaylu4S95LWUVFM7vuv7oQTIAQ=; b=wRGuwXGOfspWfXo+yv5mmys1Xmp7weYKkfbUEpDk30Fu7Onnm0REcTDd/XcFPA6Xdf copJDF7pzs203AJdueRo0ybiMUOBmEb/0y00F/W+hWIoBeMCijfoVhWhNHKgrh0FLhSg 7TRJatPetSw8W6KloWvEJZRAk8HNvEPzvbhZouuUK4OHrJPSK0um9O3jd3m29Zv9bser sLFmKc4G5H7PRnNJrzqLbH/7PlBYUUIXwb89Ou5ycXAKY9jpbwRVbG0KXdat68axAjDO OxCRQAG6l1Z+D/pgIXVLTRKPEgzAS9+aL7ZGT91OGQWmzZuhfi+2r5gRS9zNI/amX8+w k66w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=s3TDnI7N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from groat.vger.email (groat.vger.email. [23.128.96.35]) by mx.google.com with ESMTPS id z21-20020a05640235d500b00533ef1e4bf4si1251343edc.216.2023.11.01.19.49.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 01 Nov 2023 19:49:14 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) client-ip=23.128.96.35; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=s3TDnI7N; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.35 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by groat.vger.email (Postfix) with ESMTP id 894D1807105C; Wed, 1 Nov 2023 19:49:08 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232963AbjKBCss (ORCPT + 99 others); Wed, 1 Nov 2023 22:48:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231574AbjKBCsr (ORCPT ); Wed, 1 Nov 2023 22:48:47 -0400 Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [95.215.58.170]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6280D8E for ; Wed, 1 Nov 2023 19:48:41 -0700 (PDT) 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-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (groat.vger.email [0.0.0.0]); Wed, 01 Nov 2023 19:49:08 -0700 (PDT) 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!