Received: by 2002:a05:7412:f589:b0:e2:908c:2ebd with SMTP id eh9csp23583rdb; Mon, 30 Oct 2023 21:58:14 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEGig93CTqyRKxRH64cFqr77N+xQiyK/FU9mjQj/qFpaOTJ/Znzhf8rWbogbVhwZD/Aw6QO X-Received: by 2002:a05:6358:52cb:b0:169:81cc:d7fd with SMTP id z11-20020a05635852cb00b0016981ccd7fdmr2140675rwz.0.1698728293887; Mon, 30 Oct 2023 21:58:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698728293; cv=none; d=google.com; s=arc-20160816; b=f1llGwlpw7e17FzGaGLfdV7FWsGU3QlqVl8sGjkzmOOe8LXAGWmEP9EYGiWV0mq+6s Dzgi6Kz+ToLJhrITciK8fA3NtE2jelC2/saHlAE/jhnPOBm5NKq2gRFDCqFK/ekYSDg/ x2jHh+/iijvDQzveok2eBfivoPWr3eTeinN2lmU4ovNROj32LeZIUr3M4PHX2i85b6pY HFWPykfnSRAMCxq/VvtId4LQDvi3jXtbaSslfGXvv+iq3NPKB9YNOBF/qaJHLeNAqbNg u/3/YuqQkzdANiV7913Yky7mcXDcthx3SF7Q2Fq1INlT8LM25wl3uUoaVTR2CvP3lWqr A2VA== 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=glWEhzZHw9Q8o2NIQUVWc3t/rkBW4T0mk7G578550ZM=; fh=qciuLGN8I63sRFcZWxB1DUJvtrR4BYia8vKRbj06iNg=; b=AyV2fN19Z503kXdT4QS7T2qLV7zHLg4x7X4wZusVEYL0PbrX1pjs4+al0sUe2mqerh MPppkNQULMPJtuHfbYwnxWD/i/47uEJYprc8FJ9+XbxehjsX8gE/XGJg9YmnlGk52Yb2 fl0OlscINr/hEDjntwsEGLd3CypYS9qNFqdSynWsPdE8S8dElzz4JjmOKEvHM51i9GOm KfIVAuCoYe2QRdCuvbmh7zOOoqpS/M+TLEujs9G06PBERRgige4XoinoKE9Px6U9VcFK Ap9IzU7v/eReoWgqLA90t7dGxXWOEyn4k1WjLM6F9ZIxtl4JxxRqNyLhYNmvhnoS2Uzw v5ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="NJhb/Usj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (lipwig.vger.email. [2620:137:e000::3:3]) by mx.google.com with ESMTPS id n19-20020a637213000000b005b8615b9fe6si480750pgc.287.2023.10.30.21.58.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Oct 2023 21:58:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 as permitted sender) client-ip=2620:137:e000::3:3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="NJhb/Usj"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:3 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 lipwig.vger.email (Postfix) with ESMTP id 4917D80A1399; Mon, 30 Oct 2023 21:58:11 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234735AbjJaE6C (ORCPT + 99 others); Tue, 31 Oct 2023 00:58:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54640 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231652AbjJaE6B (ORCPT ); Tue, 31 Oct 2023 00:58:01 -0400 Received: from out-185.mta0.migadu.com (out-185.mta0.migadu.com [IPv6:2001:41d0:1004:224b::b9]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4470CC9 for ; Mon, 30 Oct 2023 21:57:58 -0700 (PDT) Message-ID: <82797556-eb7b-4867-86a1-859d11598fc9@linux.dev> DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1698728276; 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=glWEhzZHw9Q8o2NIQUVWc3t/rkBW4T0mk7G578550ZM=; b=NJhb/Usj6xad87QL0WNtaCOAmbeXuKQfq+jsoJOwO7gOwL4fogLqIAPnNnjrVQuTZT1AG4 GxP2z/vcct3bhuY5AnRe2M4gD2trbrWGyqpZQmh1kTJxpDrL/ktryO6GrXi4U2Tpb5jev7 2ybIqJFQAOWF3aAXyb4ImbrEcAJD970= Date: Tue, 31 Oct 2023 12:57:23 +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 Cc: vbabka@suse.cz, 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> <1dcc9969-da5b-4384-96d8-d03c835f198e@linux.dev> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou In-Reply-To: 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 lipwig.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 (lipwig.vger.email [0.0.0.0]); Mon, 30 Oct 2023 21:58:11 -0700 (PDT) On 2023/10/31 11:47, Christoph Lameter wrote: > On Tue, 31 Oct 2023, Chengming Zhou wrote: > >> 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 > > And then the frozen flag needs to be set. Otherwise slab_free() would conclude it is on a partial list? > - cpu partial slabs: !PG_Workingset && !frozen Here comes the optimization that "frozen" is not set for the cpu partial slabs, slab_free() will grab node list_lock then check by !PG_Workingset that it's not on a node partial list. >> - cpu slabs: !PG_Workingset && frozen (set or clear using cmpxchg together with freelist) > > > >> - full slabs: !PG_Workingset > > And frozen is clear? Otherwise it is the same as a cpu partial slab. > Right, - full slabs: !PG_Workingset && !frozen Yes, it's the same as a cpu partial slab from only these two flags, but slab_free() also know whether it was full or not. >> 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! >>