Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1447589rdb; Wed, 6 Dec 2023 21:43:21 -0800 (PST) X-Google-Smtp-Source: AGHT+IHuon/DcrJK0SIW8BU4dt6xxotWYNLpHU95gYxzIQFBkR0pcgxUjxYTk1ca2aO9jqLXUku1 X-Received: by 2002:a05:6e02:219a:b0:35a:fad3:2b2a with SMTP id j26-20020a056e02219a00b0035afad32b2amr2626333ila.12.1701927800970; Wed, 06 Dec 2023 21:43:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701927800; cv=none; d=google.com; s=arc-20160816; b=w37Vn53cPIPOaG1IQezR/tcpkuQ2rMzH2AOKqf1v734Kv5zPtBaL2MyyMPzqWqh2CJ b3y9sm24NZ8eCj3p7jZqwOdZerK26qMgTDMLTFXxp6ZZy+Vv6uQTeNOZiSS88yur9+2S j06K2QSKnNl2Czq16Z60IUmE42vMzGwm6Vo9I0ocgBYR58Pgm6Bwdy9iKrC+k0jQL1jq A8XHIz3NZiQHlGyCrX08cMAZc2rO0aPVgmUbzvOckvL6xv3C94iDLcl647awWIsx3n+1 70ciJQnEfb469RUISkwM55izC7+fUzw4CY0u+jdoyfSVDvDoQDbS4VHO4+bQq4eq6fTT GOmg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:dkim-signature:date; bh=RdkE7cfoCE6RprmuDTJo4aDA/cMCyuQzoGY8unYOC/U=; fh=/VkT6s/l8SqZLJtFwsx2T5QuzuiUFHhIdTN1d2Z0dDY=; b=lvdbZMbV0Eg0S7HXFg0Aq4v20UNSGt6HycXMYdu0D2kbNsH/B+0YunlNG+lsgks98/ l1cB3BrDAaoZid998qMmITNnvSk4uGGWEAGUT4uW123bXzE+4r6U4dGW8gi3FimfbUY1 8fFCYVwxl9zwfkS7ie9tZBurhMxeBL/5a56BREzPwSI7VXKNz/EpWlxBGIxiggTK9lE8 PqD1i7lyF4ErQEo1gld4xPvWUVseQK2AP0a9u5TL6uusJ32fEho5cdmhWC5Gaqgz546g qBihnAcpccYXtaHmMY5diIkAAan4WgnKsqf4YfHy1IpTJYD6i3eW0TFuEemmp0uVKVgY KQyw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=IdnVs7Vi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (groat.vger.email. [2620:137:e000::3:5]) by mx.google.com with ESMTPS id x1-20020a631701000000b005c660ba30a7si551304pgl.512.2023.12.06.21.43.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 21:43:20 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 as permitted sender) client-ip=2620:137:e000::3:5; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=IdnVs7Vi; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:5 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 groat.vger.email (Postfix) with ESMTP id F045680DB708; Wed, 6 Dec 2023 21:43:17 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at groat.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230464AbjLGFnD (ORCPT + 99 others); Thu, 7 Dec 2023 00:43:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36394 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229484AbjLGFnC (ORCPT ); Thu, 7 Dec 2023 00:43:02 -0500 Received: from out-176.mta1.migadu.com (out-176.mta1.migadu.com [95.215.58.176]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1A7E31AD for ; Wed, 6 Dec 2023 21:43:05 -0800 (PST) Date: Thu, 7 Dec 2023 00:42:59 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1701927784; 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: in-reply-to:in-reply-to:references:references; bh=RdkE7cfoCE6RprmuDTJo4aDA/cMCyuQzoGY8unYOC/U=; b=IdnVs7Vi7unvKOyS8HY/3pkuIEPD03zqV1vALHaO/bpzmbBWF5D6mi0ATroyP4lR7G40fU FVxOcbeNRl1GysGG11L+g0K48yHqyOypx/5PqkvLC5O7lxVC8hWpq8kMciPrzUceu2SXMQ 0dNkbCsaPpS4FC9MgaaiTA+IjAkT1hk= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Dave Chinner , Waiman Long Cc: linux-fsdevel@vger.kernel.org, linux-block@vger.kernel.org, linux-cachefs@redhat.com, dhowells@redhat.com, gfs2@lists.linux.dev, dm-devel@lists.linux.dev, linux-security-module@vger.kernel.org, selinux@vger.kernel.org, linux-kernel@vger.kernel.org, Jan Kara Subject: Re: [PATCH 04/11] lib/dlock-list: Make sibling CPUs share the same linked list Message-ID: <20231207054259.gpx3cydlb6b7raax@moria.home.lan> References: <20231206060629.2827226-1-david@fromorbit.com> <20231206060629.2827226-5-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231206060629.2827226-5-david@fromorbit.com> X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on groat.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 (groat.vger.email [0.0.0.0]); Wed, 06 Dec 2023 21:43:18 -0800 (PST) On Wed, Dec 06, 2023 at 05:05:33PM +1100, Dave Chinner wrote: > From: Waiman Long > > The dlock list needs one list for each of the CPUs available. However, > for sibling CPUs, they are sharing the L2 and probably L1 caches > too. As a result, there is not much to gain in term of avoiding > cacheline contention while increasing the cacheline footprint of the > L1/L2 caches as separate lists may need to be in the cache. > > This patch makes all the sibling CPUs share the same list, thus > reducing the number of lists that need to be maintained in each > dlock list without having any noticeable impact on performance. It > also improves dlock list iteration performance as fewer lists need > to be iterated. Seems Waiman was missed on the CC it looks like there's some duplication of this with list_lru functionality - similar list-sharded-by-node idea. list_lru does the sharding by page_to_nid() of the item, which saves a pointer and allows just using a list_head in the item. OTOH, it's less granular than what dlock-list is doing? I think some attempt ought to be made to factor out the common ideas hear; perhaps reworking list_lru to use this thing, and I hope someone has looked at the page_nid idea vs. dlock_list using the current core. But it's nice and small, and I'd like to use it elsewhere. Reviewed-by: Kent Overstreet