Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1425364rdb; Wed, 6 Dec 2023 20:32:12 -0800 (PST) X-Google-Smtp-Source: AGHT+IHAxFX5MjYEABGZ/G/KN9NyQrS/MntIBLlPui1Vhko56cYszYvH9/bOtAieaFYx63WdwoJW X-Received: by 2002:a25:c54a:0:b0:db9:4931:4b47 with SMTP id v71-20020a25c54a000000b00db949314b47mr1700656ybe.50.1701923532693; Wed, 06 Dec 2023 20:32:12 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701923532; cv=none; d=google.com; s=arc-20160816; b=Fjj7YtjerRaDPyBXjI0sT9GqVwv7xdN/yjqTbzwOKTvjBK1bATR28VU/px22loJYTS 1w1VGDYZ8UwTNAWtM0OgJuPlXK1vaJezxBGXdh9j0cLWj0sCBiRxOdgWclw2wEJP+/Xu Y1u30yHFwuzcBSbZeMtPvtJuLWCnn1qt82YsZrjc0O9U4fcb/9qAH5LwI4DjqXU1t7SO es2YKIwoFwKbHvl0DI81gEA+lxjvk5Hy7zwhk5HrU5IxzvilUxSmGvhcVjsO4ePCz+mG 8I8jTbuU3v6Tesfg0Mkp8ahSGewNf6iTYGQbvD8QtaJmpmuJ2NMK+lW/BU99RMEC1l93 /EBQ== 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=W1UdbO3j7o3P3hR6C+3bDAPYg7BZKWXWFTBRUWw0djo=; fh=OvCUO7VSi2qhFSf1pAk0DSxAfqIFciTB3JbkL+4/94M=; b=swfkdN9pKECMkKdR+iIARZeLFRYFTc6ZGbCfdaFUsHwryt4SUvdTV0WRvtMPNemQk7 +fhtWVzPAMOby0smyPn+7rg6wqZDCCXRKU0cK0XgeyxBULXhaIcW1xJNBachtNacRR+O XCO50LcyarZxnhz7JhRAjewoLqdDRv/l1iXPIZ8Q50xZy28hqvFKfDHQ9WXZ1r4IZTMD A510aXnn6HkG2I7tsRtIh7uTfkYQb4nvZw+NxjFg5FCDHuO5SH046hw3oENWcFz9Y1pp 8R5FD2k5f9+ruViPf0C9S8/DFglGSGJ8LBt8rrwu2QF3ofEpJQQS18dSrt3eUyg24f3U jUfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=oDUUFt1f; 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 37-20020a631665000000b005c68da9ca8asi455321pgw.787.2023.12.06.20.32.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 20:32:12 -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=oDUUFt1f; 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 0A487807C67D; Wed, 6 Dec 2023 20:31:59 -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 S229771AbjLGEbf (ORCPT + 99 others); Wed, 6 Dec 2023 23:31:35 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45748 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229449AbjLGEba (ORCPT ); Wed, 6 Dec 2023 23:31:30 -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 B2FF9D7F for ; Wed, 6 Dec 2023 20:31:34 -0800 (PST) Date: Wed, 6 Dec 2023 23:31:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1701923492; 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=W1UdbO3j7o3P3hR6C+3bDAPYg7BZKWXWFTBRUWw0djo=; b=oDUUFt1fAlzbKquS6eMWSPo1pFqGGWNjYGBqHJ30g6OZ5vx8ay510Q9E7YknP2rUCn8HzO twlXhVnHDsTKLOUplgl3K04R6WtR8zd2L5TPZK2AVMhchuRZ54OpVNIlsoaTM+l4SA/lrh U8yb+LqO/d6wHtLKSHfVfqtMy7GvCcg= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: Kent Overstreet To: Dave Chinner 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 Subject: Re: [PATCH 04/11] lib/dlock-list: Make sibling CPUs share the same linked list Message-ID: <20231207043129.cswpxpwow43b35lj@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 20:31:59 -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. > > Signed-off-by: Waiman Long > Reviewed-by: Jan Kara We badly need this done in a more generic way. Besides shared caches, I've done a bunch of percpu algorithms where "amount of x stranded on percpu lists" is a major consideration and this would be preferable over percpu lists (including in fs/aio.c).