Received: by 2002:a05:7412:a9a2:b0:e2:908c:2ebd with SMTP id o34csp1527394rdh; Fri, 27 Oct 2023 18:32:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGMeFTZGBReh+JieUxfqv4mju5anfYvBvho4b/QT9koy2BOQNnrMAIdSvui2nUg9dfx5ZIr X-Received: by 2002:a05:6358:720a:b0:168:dc41:b7b0 with SMTP id h10-20020a056358720a00b00168dc41b7b0mr5802949rwa.0.1698456736056; Fri, 27 Oct 2023 18:32:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1698456736; cv=none; d=google.com; s=arc-20160816; b=S6Ve/ZJH6hMS6oiXfCwQ8wCtDE8jelCWrAMwFhorGsJwosm4Rt8PAETLU3BMs8UpB3 WW6ojoUTeqzMkYhMR9uYBBztgLw9XyaS83QC0TbBeYdFxrH+qoebnwdnZ/9pLhKsZoBq 2jCaxJJOzVSVQlWKqbyLnj+PEP+k48uG8GMC5oH+YGLAh1WFhgfWsyozKsNBRW6We76k fPtxX+ybdG4BG3CwIFrWLL0eK9CSS24NWkBEoIpavsfudsUOc6YtCQxFGmUJBjHjmwA0 AuILTyo6zX7k3YkgFnJh38ZH8dlpOXPfJL86CgGqn0ncEAQQda0cOHPhqD73QeWq1GqD 7ypg== 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=lvs+eTtJ66DLSNeg3WuDmtpcRjw+t6vm77/M+6Bl8Z4=; fh=GByU5QLApU3jp7p0BuonIBRvwuX48GPFCOtpPTX5gno=; b=ELjxpQGEsz5ymumzVLYYeBDW1iuCNcTcgU87hPZsFiWS5nWr3yCYCc0147zqKa2o1P vIFzkAa7kcfc5/O85aoPMDAA+KtywXTYIShf9yts6KNiiHC45nbMGirLW7+6JhAVdQwE BM8p9NlQUJ7eEZxsEGy0IEIA6oNyxYcvCaSjzhIywDXqb/3UFlavS3caCQJxZBZSTeFs cT8PAKXbGEv0+nmc2qotGB4xQmI/TBn0X/ef8RbjIhR8phTpSUdLoaS5oQqsyGw4W4Tj n9e8atABWg22Hhmjkg15CFEnlckpG551wbq03MgSYytcRrMCT2H+0cQPHDVqew0+TUJM CnDg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="rRUEy/vz"; 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 bz15-20020a056a02060f00b005b90e67f438si28648pgb.106.2023.10.27.18.32.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Oct 2023 18:32:16 -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="rRUEy/vz"; 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 C6AF1829B8B6; Fri, 27 Oct 2023 18:32:13 -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 S232986AbjJ1Bbt (ORCPT + 99 others); Fri, 27 Oct 2023 21:31:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60548 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232973AbjJ1Bbq (ORCPT ); Fri, 27 Oct 2023 21:31:46 -0400 Received: from out-170.mta1.migadu.com (out-170.mta1.migadu.com [IPv6:2001:41d0:203:375::aa]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4E719183 for ; Fri, 27 Oct 2023 18:31:43 -0700 (PDT) Message-ID: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1698456698; 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=lvs+eTtJ66DLSNeg3WuDmtpcRjw+t6vm77/M+6Bl8Z4=; b=rRUEy/vzoQOeLfVrTuptdU2ev1h2MguLRiuU6o8ZnW0z2OzfBJY0I2fjNOSyuIlDeUcq4i aQD6HgjVcsjnghs0+hNZ4TLcJpz9irVHmY8U3Epvn6ZInIYttIdbVTSTV3vLCPpP4cGvS3 DojuUxSerOM50VJNytmOsglYvUV32G4= Date: Sat, 28 Oct 2023 09:30:54 +0800 MIME-Version: 1.0 Subject: Re: [RFC PATCH v3 1/7] slub: Keep track of whether slub is on the per-node partial list Content-Language: en-US To: Vlastimil Babka , cl@linux.com, penberg@kernel.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: <20231024093345.3676493-1-chengming.zhou@linux.dev> <20231024093345.3676493-2-chengming.zhou@linux.dev> <6d054dbe-c90d-591d-11ca-b9ad3787683d@suse.cz> X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Chengming Zhou In-Reply-To: <6d054dbe-c90d-591d-11ca-b9ad3787683d@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 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]); Fri, 27 Oct 2023 18:32:13 -0700 (PDT) On 2023/10/27 23:09, Vlastimil Babka wrote: > On 10/24/23 11:33, chengming.zhou@linux.dev wrote: >> From: Chengming Zhou >> >> Now we rely on the "frozen" bit to see if we should manipulate the >> slab->slab_list, which will be changed in the following patch. >> >> Instead we introduce another way to keep track of whether slub is on >> the per-node partial list, here we reuse the PG_workingset bit. >> >> We use __set_bit and __clear_bit directly instead of the atomic version >> for better performance and it's safe since it's protected by the slub >> node list_lock. >> >> Signed-off-by: Chengming Zhou >> --- >> mm/slab.h | 19 +++++++++++++++++++ >> mm/slub.c | 3 +++ >> 2 files changed, 22 insertions(+) >> >> diff --git a/mm/slab.h b/mm/slab.h >> index 8cd3294fedf5..50522b688cfb 100644 >> --- a/mm/slab.h >> +++ b/mm/slab.h > > I think these helper might just go to mm/slub.c as nothing else would use them. > Ok. >> @@ -193,6 +193,25 @@ static inline void __slab_clear_pfmemalloc(struct slab *slab) >> __folio_clear_active(slab_folio(slab)); >> } >> >> +/* >> + * Slub reuse PG_workingset bit to keep track of whether it's on > > "SLUB reuses" ... > > Looks fine otherwise! > Will fix it. Thanks!