Received: by 2002:a05:7412:85a1:b0:e2:908c:2ebd with SMTP id n33csp187434rdh; Mon, 30 Oct 2023 19:30:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFcTFtdJxffVilXrIEtzL+6+38flu3qpoGN3DyTHC+mITTB4d3YYsu3WAdHO/yT5V0hiOkT X-Received: by 2002:a05:6a21:a598:b0:17b:7dda:c0fc with SMTP id gd24-20020a056a21a59800b0017b7ddac0fcmr11334065pzc.8.1698719448656; Mon, 30 Oct 2023 19:30:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698719448; cv=none; d=google.com; s=arc-20160816; b=WednyTmgoLAPZXHwM2qHUXvdZkqimNsCrMt6QQ1ql5kXJyMhKegFwM5FmDv0QSLRNP 4CpZu4+RvdkyspDsyWoMaRarvJYd4Tk2WjB9KIwEc5zHHWS30wPK7ZLtRGNv6fEsg6jg FWYIM818ryu91kVwPsJ7SCP9ZkmikU7UvrcgS7zgUMHzsC/TG0oRFEQzJT8UCuRfbcxY h/A16ail2HSKxC6whxGHTw9bIgoWftPnKlOnaY5bB6HMs0mtOAbfO45c6qpbbfiIfqKr w3KMJRRVQAcvVogdTVOlwjSrnJhFQBK4rctwqISGibZEt3sq5dugLXK6Er9xYAV/Exhh V+LQ== 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=s3D3NG9Rr5nexXkejnTZubHojYTPIvCsAncG92DOezQ=; fh=ft8xnfTdyDA82P6tb5GyvpFCup8Qu3Ix3ykMXzGmNcQ=; b=vF9APZz1Zrnm1HeF2j4+ULNGhv4qMfia/r0te4Ar3D6FHt/j/c3NvEWKZhjzpb30f5 sD46o3FVlmjDLSksA39caye3Ta4NfDQZ63SOOMwOFfb3QmVGox1Wr1O+brZ86IjMupuh 1bg5NIEWAWBRdLOjxWviGKeS4y4He0DORQAEIrdC804Vi9TOSGmTX1HzKWOOdTkgJ5rm xx8iM07RIEroYFgXVYIiknFMpzkYSZt+7IKX91W7d1+FoVmV3bwbUSNRsKCIJZg0dovs bEH24u5005gv77OacIY5gwIgdb+vbz43eqhiIr65Zo1tZsmxwo+WCAUlrS6zOzjGEVwh Sz4w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=hRg+Yo3Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (pete.vger.email. [2620:137:e000::3:6]) by mx.google.com with ESMTPS id p14-20020a056a000a0e00b006933caa6f03si296108pfh.165.2023.10.30.19.30.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 19:30:48 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 as permitted sender) client-ip=2620:137:e000::3:6; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=hRg+Yo3Y; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:6 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 pete.vger.email (Postfix) with ESMTP id 92E7E80A1A14; Mon, 30 Oct 2023 19:30:38 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231551AbjJaCab (ORCPT + 99 others); Mon, 30 Oct 2023 22:30:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46392 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230409AbjJaCa3 (ORCPT ); Mon, 30 Oct 2023 22:30:29 -0400 Received: from out-171.mta1.migadu.com (out-171.mta1.migadu.com [95.215.58.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE144C5 for ; Mon, 30 Oct 2023 19:30:26 -0700 (PDT) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1698719425; 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=s3D3NG9Rr5nexXkejnTZubHojYTPIvCsAncG92DOezQ=; b=hRg+Yo3YilYdpwUOalAS1b9MuHcI/s8JdbFEwfZhaStPXBmmwzD67ar2kTezMVGcTXLIPj b+1e0sKFI01VF3F2XWYKdtstzZhrIXy6Zz664pEHQirjdclh2ZnSJBEP/e1aTLbhmM5LbC 8YRGA4xKKwn4RKT72ZUnyxREve+V54w= Date: Tue, 31 Oct 2023 10:29:53 +0800 MIME-Version: 1.0 Subject: Re: [RFC PATCH v3 0/7] slub: Delay freezing of CPU partial slabs Content-Language: en-US To: Vlastimil Babka , Christoph Lameter 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> <04cbf4cd-3f62-9068-b4fd-c90158f2f116@suse.cz> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou In-Reply-To: <04cbf4cd-3f62-9068-b4fd-c90158f2f116@suse.cz> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.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 (pete.vger.email [0.0.0.0]); Mon, 30 Oct 2023 19:30:38 -0700 (PDT) On 2023/10/31 00:19, Vlastimil Babka wrote: > On 10/28/23 04:36, Chengming Zhou wrote: >>> >>> >>> After this patch the PG_workingset indicates the state of being on the partial lists. >>> >>> What does "frozen slab" then mean? The slab is being allocated from? Is that information useful or can we drop the frozen flag? >> >> Right, frozen slab is the cpu slab, which is being allocated from by the cpu that froze it. >> >> IMHO, the "frozen" bit is useful because: >> >> 1. PG_workingset is only useful on partial slab, which indicates the slab is on the node >> partial list, so we can manipulate its list in the __slab_free() path. >> >> 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. > > Well, we could extend the meaning of PG_workingset to mean "not a cpu slab > or pecpu partial slab" i.e. both on node partial list and full. However it > would increase the number of cases where __slab_free() has to lock the > list_lock and check the PG_working set. "slab->freelist == NULL" might > happen often exactly because the freelist became cpu freelist. Ah, right, it's possible to do like this. > >> 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. > > And together with this point, I don't see a reason to drop the frozen bit. > It's still useful for cpu slabs. It just wasn't the best possible solution > for percpu partial slabs. > >> Maybe I missed something, I don't know how to drop the frozen flag. > > Should be possible, but not worth it IMHO. Agree, we'll just keep "frozen" for the cpu slabs. Thanks!