Received: by 2002:a05:7412:85a1:b0:e2:908c:2ebd with SMTP id n33csp193199rdh; Mon, 30 Oct 2023 19:51:59 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEhVYQiKbAUcepWj6gp4EBWVdjv+b2RuHlaU01ZeNHZjAEk15riGY2YcGFU08taiDfXKcRs X-Received: by 2002:a17:902:d1cc:b0:1cc:2469:f2ff with SMTP id g12-20020a170902d1cc00b001cc2469f2ffmr9361714plb.9.1698720719259; Mon, 30 Oct 2023 19:51:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698720719; cv=none; d=google.com; s=arc-20160816; b=BJkCo5fgYEI/ajEkLpa+2aEumzdaFQ4Xz6ADd9Kp9dI54MNFpjlxMiz/drvXVhDWzd TS19ZPEwpuEgceFTQYjH36bmzuRgtKhJ7AjeCnkreq4s+Kmgh74MMKEGfQn2vas+tTwm D0gcwQ7e70+3Uii8pSWQNAL5HY54xsfq8fUAMJfLMthAdF7S7Nu/kceqL8w9b5StMg32 nuXr7YWJzxGZZS9Fr1qZlZmO6UjeiAWvdN65t5Z5+P91tyU2BCZiAzehtyk6qngdLHLC 8X4KmgJVyeF0/PkzyWBH+nMTOPExwgGPc58JOWZJHIFnRBzdxa4UbM8C50jjjkfdWgpI 4KzQ== 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=sJGocIrvJOpdyaBLIvTHhgCm+KI16lXmHvQhyhxns3g=; fh=9+LKvNWEPXcB2FUOf4+AY1lj40C7mJUfmsrovpQHQN4=; b=b32/sYBOZ3uhFsAsDWkHhNkBXz0zy5PfOBBEHzRdSWQLQkEuAJYBxZhDyn1aI5FRmp IfzedS2d5WByssWktp84/8vSu1cZ8z3I8NEEDwJ2zFZArpmzCdxtZynd7QmVoVXyT48f iahA82BQbekPu0ssz0ebOcIz1qUFuDkGoJeyhvhrw6x561M60VjrrMQUA1e4p6fB4oSI HoDbzlynvizsP328ygHgh2kOPL9zApKMHAneG/zIdW8cXnrBYtjkq+SVpn3OqYsRg8XG gNnFBHpl69ecsxfnMhxVa/5TV4ISpgggji620+77IYm4kgqjtBTUVDdIrcxGcUUe9M1B WCdg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=DaUqksiP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (snail.vger.email. [23.128.96.37]) by mx.google.com with ESMTPS id m9-20020a170902db0900b001cc665df825si325988plx.436.2023.10.30.19.51.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 19:51:59 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 as permitted sender) client-ip=23.128.96.37; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=DaUqksiP; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.37 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 snail.vger.email (Postfix) with ESMTP id BA52F807754C; Mon, 30 Oct 2023 19:51:14 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at snail.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233834AbjJaCvK (ORCPT + 99 others); Mon, 30 Oct 2023 22:51:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59936 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233213AbjJaCvJ (ORCPT ); Mon, 30 Oct 2023 22:51:09 -0400 Received: from out-173.mta1.migadu.com (out-173.mta1.migadu.com [95.215.58.173]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 89D21ED for ; Mon, 30 Oct 2023 19:51:05 -0700 (PDT) Message-ID: <1dcc9969-da5b-4384-96d8-d03c835f198e@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1698720663; 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=sJGocIrvJOpdyaBLIvTHhgCm+KI16lXmHvQhyhxns3g=; b=DaUqksiPCxsm2P165op2FK7Z8jYJPEvUwhHu13OegGDh0aU+2Tiwtn57XudzehhMgoy8UP U8AQyOlzpM2iuBqadciwZOGw1uL+zJ+Ff+tWhoRJkd9utrVWeNs0dpamyA6/eApsWZlxwe Lbsc9oPhgDPuaSRlZzVNAb6sVtZuBZY= Date: Tue, 31 Oct 2023 10:50:33 +0800 MIME-Version: 1.0 Subject: Re: [RFC PATCH v3 0/7] slub: Delay freezing of CPU partial slabs Content-Language: en-US To: Christoph Lameter , vbabka@suse.cz Cc: penberg@kernel.org, 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: <20231024093345.3676493-1-chengming.zhou@linux.dev> <1199315b-63ce-4be4-8cde-b8b2fd29f91a@linux.dev> <7f70d130-c05a-3cb7-9509-41c21c3014fb@linux.com> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou In-Reply-To: <7f70d130-c05a-3cb7-9509-41c21c3014fb@linux.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (snail.vger.email [0.0.0.0]); Mon, 30 Oct 2023 19:51:14 -0700 (PDT) On 2023/10/31 03:25, Christoph Lameter wrote: > On Sat, 28 Oct 2023, Chengming Zhou wrote: > >> 2. But for full slab (slab->freelist == NULL), PG_workingset is not much useful, we don't >>   safely know whether it's used as the cpu slab or not just from this flag. So __slab_free() >>   still rely on the "frozen" bit to know it. >> >> 3. And the maintaining of "frozen" has no extra cost now, since it's changed together with "freelist" >>   and other counter using cmpxchg, we already have the cmpxchg when start to use a slab as the cpu slab. >> >> Maybe I missed something, I don't know how to drop the frozen flag. > > > Maybe frozen is now = PG_Workingset | cmpxchg-frozen? > > The current scheme (which this series implemented) is: - node partial slabs: PG_Workingset (set or clear with per-node list_lock protection) - cpu partial slabs: !PG_Workingset - cpu slabs: !PG_Workingset && frozen (set or clear using cmpxchg together with freelist) - full slabs: !PG_Workingset As Vlastimil noted, it's possible to drop "frozen" bit for cpu slabs, but we keep it for performance, since we don't need to grab node list_lock to check whether PG_Workingset is set or not if the "frozen" bit is set. Thanks!