Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1339936rdh; Fri, 27 Oct 2023 11:07:24 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcEm6180pu6dFd1Gdc5UJMYhCuTouqwK6gC2SRkvT+xcIDlJsDLfYTJ67ZfeeCy7uNJEwG X-Received: by 2002:a05:6808:f15:b0:3b2:e519:192c with SMTP id m21-20020a0568080f1500b003b2e519192cmr4124278oiw.9.1698430044063; Fri, 27 Oct 2023 11:07:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698430044; cv=none; d=google.com; s=arc-20160816; b=eaU7gWrgyZ6r05M7d0lSD/fmPBDETUWdHoy1fcso/tDUd8YC0fTnDKlQMtxvcaZdrV Os91GMlZLUNXxJtxNnKPcVvd67UVpzbvedTdE6R4zHJvrHByago2s6rG1FmVgWH8aCr1 PyX9Vn1OCvbrlh1ta4vzJ64sHIs5sIiTxVHaZkaZkRP8MIQGhqn2zJkkFFA3lv2rTZD/ lvvFZY6Cr4CWSnLtPggqHebnhSEaBIW4zqdv1iNjTUwUNiu64jH+AAz8RCvrDJ+Vrlo2 sxgMNZFSsfmQWUjYpKV6dKgGwDL5rNa8MkY4+cWpFoAcTJE/OqKvxVaHREFDCnKECULj jKBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:references:message-id:in-reply-to :subject:cc:to:from:date; bh=tBuQ2De1uqk1UoE6hAufFkbWj9xENdiPywcicIetkqY=; fh=46P4LY+dNmSXdwnkkrRQKEjztwXuY6GhhdnizLfFlwE=; b=gZ70zj3FxmCeNPS3247V2odZgULkjBmy4XW+yUluvfwgULNbt2NnmCN0F+LXOBkLdo NnjEixr5Kf02wBwzoZox/eAlYpEAgISbJg4qZokAfLQ81/lkghjvYJad3xeo3QCft0ZN 76vYEMqdtAuRehLeerQJNvRv9x01X/JEfmIChkYCZVp4/NEWrxDeoxajZTG+H+0fNvb4 gIdBhcCmNC4DYKsyye1rYdL1JJiK7l70bqpjfgurmW9fXdpujmNgLGBqT0+66gt5apsL pLoLMNqrN50fGJguXzA+wwuShkE6hxHPWsPfp1EqOcDYJvZDt8Tcu0AMefctZNiOi10l 3L4w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id l2-20020a25cc02000000b00da0cee99994si4050206ybf.254.2023.10.27.11.07.23 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 11:07:24 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) client-ip=2620:137:e000::3:4; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:4 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linux.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 6211B83B0083; Fri, 27 Oct 2023 11:07:21 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232279AbjJ0SHG (ORCPT + 99 others); Fri, 27 Oct 2023 14:07:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46310 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231360AbjJ0SHG (ORCPT ); Fri, 27 Oct 2023 14:07:06 -0400 X-Greylist: delayed 545 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Fri, 27 Oct 2023 11:07:03 PDT Received: from gentwo.org (gentwo.org [62.72.0.81]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CDA9AC for ; Fri, 27 Oct 2023 11:07:03 -0700 (PDT) Received: by gentwo.org (Postfix, from userid 1003) id BD2E348F4E; Fri, 27 Oct 2023 10:57:56 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by gentwo.org (Postfix) with ESMTP id BC6E9489FB; Fri, 27 Oct 2023 10:57:56 -0700 (PDT) Date: Fri, 27 Oct 2023 10:57:56 -0700 (PDT) From: Christoph Lameter To: chengming.zhou@linux.dev cc: penberg@kernel.org, rientjes@google.com, iamjoonsoo.kim@lge.com, akpm@linux-foundation.org, vbabka@suse.cz, roman.gushchin@linux.dev, 42.hyeyoo@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Chengming Zhou Subject: Re: [RFC PATCH v3 0/7] slub: Delay freezing of CPU partial slabs In-Reply-To: <20231024093345.3676493-1-chengming.zhou@linux.dev> Message-ID: References: <20231024093345.3676493-1-chengming.zhou@linux.dev> MIME-Version: 1.0 Content-Type: text/plain; format=flowed; charset=US-ASCII X-Spam-Status: No, score=-0.8 required=5.0 tests=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 howler.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 (howler.vger.email [0.0.0.0]); Fri, 27 Oct 2023 11:07:21 -0700 (PDT) On Tue, 24 Oct 2023, chengming.zhou@linux.dev wrote: > 2. Solution > =========== > We solve these problems by leaving slabs unfrozen when moving out of > the node partial list and on CPU partial list, so "frozen" bit is 0. > > These partial slabs won't be manipulate concurrently by alloc path, > the only racer is free path, which may manipulate its list when !inuse. > So we need to introduce another synchronization way to avoid it, we > reuse PG_workingset to keep track of whether the slab is on node partial > list or not, only in that case we can manipulate the slab list. > > The slab will be delay frozen when it's picked to actively use by the > CPU, it becomes full at the same time, in which case we still need to > rely on "frozen" bit to avoid manipulating its list. So the slab will > be frozen only when activate use and be unfrozen only when deactivate. I think we have to clear our terminology a bit about what a "frozen" slab is. Before this patch a frozen slab is not on the node partial list and therefore its state on the list does not have to be considered during freeing and other operations. The frozen slab could be actively allocated from. From the source: * 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 * 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. * 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? Update the definition?