Received: by 2002:a05:7412:8d10:b0:f3:1519:9f41 with SMTP id bj16csp1433838rdb; Wed, 6 Dec 2023 20:59:03 -0800 (PST) X-Google-Smtp-Source: AGHT+IFN2crOW4hfEyvqtlq541l6APn/14b18wfAor9CEcQDLmv3BNYPjLhsan57r2Nzagwu7aeR X-Received: by 2002:a9d:7b48:0:b0:6b9:ed64:1423 with SMTP id f8-20020a9d7b48000000b006b9ed641423mr2306835oto.2.1701925143740; Wed, 06 Dec 2023 20:59:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701925143; cv=none; d=google.com; s=arc-20160816; b=hxMXlRBXilH9LfXjlP+JvgFo+0f9HMg0OIMiY63Za5FKGnNtAOqaT7/7Tiw8FDLidU LS2fo3Ost2IqOrMzTGPJvaZ2z8aN5k/G8EzyYc5qD7PBfO8wW8lWziviQL0DuwsivedW U4fAPeulxwmMtXd2Y0IkXyBReQ2lkipKNORgqrw9tBjKaFRY+eIQve6c5bIdtk1RD3fR yEapoUVlXHoXiigOEdeljSrcwc05XnJ70Cggr8rU8hzDdA4KnBr7rxotMY2VByp7VAV9 pXs3Uxu2cilBGkDfEWavwZQfj+ktlq2bf4JJToCfz2b+8aDlga3WFLzOnQvEohF4QdMv amtA== 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=ER/rFK8I9p5Nyi4EPWTSpp7ceXu8C84i7TakscXSgrg=; fh=OvCUO7VSi2qhFSf1pAk0DSxAfqIFciTB3JbkL+4/94M=; b=m2bCDrPfwsh179qoVZFSPiYr8lCOPSFBn3IV3Xx7rRm9COz8n9IAHkgBS74/c0xUpl //J8Zo1fgLe5CYwRCiEAI2zy0sPpxvVjI06ox+//x3FoqSWO3kSRgwalZ4xPeIHHAFIA mbwp/DRz7hSgOJNTl4sNDGDLv/wEp8L6yMkO909aPH5qslrHX/iui+q9aOLdFObzGBDy tE03aJYNpGYxH0BCHKsFsT92IufgHtwFK0E6GRQIU250EtCXMDX6PmCTtj8cdyzrQY2V PqSWR/ubRfZl2QvembGMDD6JrVu40sqnaRX1EHzDu2hnYQRh0F9sjj4g2Xp9SmpczvFX HV6A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=dtxRa5HC; 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 p4-20020a634204000000b005c68d9545b9si498206pga.619.2023.12.06.20.59.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Dec 2023 20:59:03 -0800 (PST) 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=dtxRa5HC; 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 5BED980CE7C5; Wed, 6 Dec 2023 20:59:01 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230010AbjLGE6p (ORCPT + 99 others); Wed, 6 Dec 2023 23:58:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32870 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229840AbjLGE6o (ORCPT ); Wed, 6 Dec 2023 23:58:44 -0500 Received: from out-180.mta0.migadu.com (out-180.mta0.migadu.com [91.218.175.180]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10963D44 for ; Wed, 6 Dec 2023 20:58:49 -0800 (PST) Date: Wed, 6 Dec 2023 23:58:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1701925128; 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=ER/rFK8I9p5Nyi4EPWTSpp7ceXu8C84i7TakscXSgrg=; b=dtxRa5HC5BjEY1vwLAImPX6PE01YgnBPYYyJqYC7IFH37NPuxd2HfUGXBpzqwqos1FqlkY 0bouvtRlgrvXR+xFdH2T3pfxm1sf7fUdOcZe9i0B5L3CkNFLbgRTOc6XBY8RLYr6mGXWWX 182ilBeK2tqvjOkOYtDQU/rBzYLw0uE= 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 08/11] vfs: inode cache conversion to hash-bl Message-ID: <20231207045844.u26r5vn26gtmqwe5@moria.home.lan> References: <20231206060629.2827226-1-david@fromorbit.com> <20231206060629.2827226-9-david@fromorbit.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20231206060629.2827226-9-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 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]); Wed, 06 Dec 2023 20:59:01 -0800 (PST) On Wed, Dec 06, 2023 at 05:05:37PM +1100, Dave Chinner wrote: > From: Dave Chinner > > Scalability of the global inode_hash_lock really sucks for > filesystems that use the vfs inode cache (i.e. everything but XFS). Ages ago, we talked about (and I attempted, but ended up swearing at inode lifetime rules) - conversion to rhashtable instead, which I still believe would be preferable since that code is fully lockless (and resizeable, of course). But it turned out to be a much bigger project... But IIRC the bulk of the work was going to be "clean up inode refcounting/lifetime rules into something sane/modern" - maybe we could leave some breadcrumbs/comments in fs/inode.c for what that would take, if/when someone else is sufficiently motivated? > threads vanilla patched vanilla patched > 2 7.923 7.358 8.003 7.276 > 4 8.152 7.530 9.097 8.506 > 8 13.090 7.871 11.752 10.015 > 16 24.602 9.540 24.614 13.989 > 32 49.536 19.314 49.179 25.982 nice > The big wins here are at >= 8 threads, with both filesytsems now > being limited by internal filesystem algorithms, not the VFS inode > cache scalability. > > Ext4 contention moves to the buffer cache on directory block > lookups: > > - 66.45% 0.44% [kernel] [k] __ext4_read_dirblock > - 66.01% __ext4_read_dirblock > - 66.01% ext4_bread > - ext4_getblk > - 64.77% bdev_getblk > - 64.69% __find_get_block > - 63.01% _raw_spin_lock > - 62.96% do_raw_spin_lock > 59.21% __pv_queued_spin_lock_slowpath > > bcachefs contention moves to internal btree traversal locks. > > - 95.37% __lookup_slow > - 93.95% bch2_lookup > - 82.57% bch2_vfs_inode_get > - 65.44% bch2_inode_find_by_inum_trans > - 65.41% bch2_inode_peek_nowarn > - 64.60% bch2_btree_iter_peek_slot > - 64.55% bch2_btree_path_traverse_one > - bch2_btree_path_traverse_cached > - 63.02% bch2_btree_path_traverse_cached_slowpath > - 56.60% mutex_lock dlist-lock ought to be perfect for solving this one Reviewed-by: Kent Overstreet