Received: by 2002:a05:7412:f690:b0:e2:908c:2ebd with SMTP id ej16csp453766rdb; Thu, 19 Oct 2023 09:00:41 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGosQXoEggDPBxv3plMUgktlrlHqvMrRJGHUxvE+IPNRj46CPL4FemCi7cclVF8esNVLtBA X-Received: by 2002:a17:902:ea08:b0:1ca:4ad7:6878 with SMTP id s8-20020a170902ea0800b001ca4ad76878mr3473741plg.8.1697731240786; Thu, 19 Oct 2023 09:00:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697731240; cv=none; d=google.com; s=arc-20160816; b=W+8ya8/3lp/UYjBGenM4sxV9mTW7TeMRHZ9I/dsTUuxLXdhG3eicEQ2jvmoSRJd1wl KapXj2gDxPfJKRzQBj8l54GtL70rL0QfqYEyhdBbHKQ4GSeT4GEA0uY1Wwk5oePywPIe rxsuZ4Tn+2W8ftmFRpjrtIw2y2OE75nJ2Dftg5suP0HrFC/pyhSqFdOVgIbIAmc/g4nb h2egx88An0qihEUMgtQ4sEiORTCnDo1g7dDMUSG9ZuLNxtbUzUNCs+5+Aq/SAyED6bKC H4lC+ebJDzA4wVRlVO6w14C7iqRPPlkW4aAR07KjmiRBt1D0tcyNkb2NM6p1+J1mPPDG ZS7w== 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:date:dkim-signature; bh=fSDDMkWKOscG8d7aFe9xNzMWpe2tWGppER9q+Picffw=; fh=DzKPI+MAcS6RoCGtAgWT9HJtDHdyl/BfE1mbYD/KZgM=; b=aOf1Gp97OaIP/odu2xHKRPFERtIMcClVeFJ39ksxzru3Q4twHJbwx2pYpWjAz2e0LI Ocuag5rBDOMO3k9DeHumIoNIuwQtc+bj1To+l5YDlpZK4n6BuTV6SRjJv1Ron2IlUz2I +EanhRhepL9ZiADzTwNCJD8tB1tZtjIjR2TDB8IlQ4SAebV38sgnhMNjsCaazvyHWkXR sLvVVKn+LozpR+bu6Ts9RxkfQB5MldhHIl55VW3wYgZqqlg2aPLR6EXqzmZjzSPRXDhu JOsE891jNMcLpnMAiyYYKIudGMogcG1y8iTGk4vRrRaTIH1yPSn4XP9OtfFJL/zdgGRl pyrQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hV84FMsE; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from howler.vger.email (howler.vger.email. [2620:137:e000::3:4]) by mx.google.com with ESMTPS id j6-20020a170903024600b001ca4ad86363si2581701plh.390.2023.10.19.09.00.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 09:00:40 -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; dkim=pass header.i=@gmail.com header.s=20230601 header.b=hV84FMsE; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id 8919F80A1453; Thu, 19 Oct 2023 09:00:31 -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 S1346462AbjJSQAR (ORCPT + 99 others); Thu, 19 Oct 2023 12:00:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56282 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345737AbjJSQAQ (ORCPT ); Thu, 19 Oct 2023 12:00:16 -0400 Received: from mail-lj1-x229.google.com (mail-lj1-x229.google.com [IPv6:2a00:1450:4864:20::229]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0575B6; Thu, 19 Oct 2023 09:00:13 -0700 (PDT) Received: by mail-lj1-x229.google.com with SMTP id 38308e7fff4ca-2c50cd16f3bso91075641fa.2; Thu, 19 Oct 2023 09:00:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1697731212; x=1698336012; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=fSDDMkWKOscG8d7aFe9xNzMWpe2tWGppER9q+Picffw=; b=hV84FMsEQDUDbv3DeZ4WLdHhDp46aXY8d6E7vntBVsTWmx/tB96wrkNmsqdmvqXKM5 dAQKz4k1qsqUD6eEt/Mbkan7OMT7SePQ5IE2jyY5EnkZxQXY6GkWK5oVGIWawPeG3uGg znzeJJRjtxv7vO/XDyjCTnvKQxnByYL4Wx63P5How7UUeGXT9nPu6zkbybA0H8+cgOSG 1hWtbGaZMXRsZYs/1LhyC8Zjcn3DQDonKYMTd8eCNQc0XY4K6jmDLRiwJwedoST9ymMX wsPy70KHyoN7LeQ3+snu4s+oGitQHKdDYX2NdLiQo1tuXdkKJ8rXGz78WmJ6tBQEeOji alLA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1697731212; x=1698336012; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=fSDDMkWKOscG8d7aFe9xNzMWpe2tWGppER9q+Picffw=; b=fmIv/UrNc0iD6Cln3bjO5F4NLuLoUmb5RxCvEjJ6OJ6+Ne2M3/r+ZNn4t51DKmAxlD 10x3vyQobs7kNS3MLCh/20wV/XGo9mQff3m+8S9asQpAmMH5Z+OvVh0NK+5kP1fF5oQa wBcSgcb+U5B6tL5/y1c2CdvFBHbY+1yH79tGxvOnliUGJcnY06qEfXUmEcH5GeM68Ut3 HM3ayVkx3M/n6mUaRtUrQTCJzj5uV6uZt5Un+WXxuYCwJua76Z/iV052X0JygQIjLILC DWLXOv8p+Q9/C0mxhMSLPBzT4S/8Xu5WW75D9iqdOIsDVwGkbluNEym0YK9eVvzNkPlC b6Rg== X-Gm-Message-State: AOJu0YzSeerCvboRHnt9i9gTIQL/LvjUeSIA++iMyUabYBPN23nlMfiE xrr3Y2+k+9fKCb17/JGMozU= X-Received: by 2002:a2e:97ca:0:b0:2bc:d5f1:b9cf with SMTP id m10-20020a2e97ca000000b002bcd5f1b9cfmr1737842ljj.27.1697731211784; Thu, 19 Oct 2023 09:00:11 -0700 (PDT) Received: from f (cst-prg-84-171.cust.vodafone.cz. [46.135.84.171]) by smtp.gmail.com with ESMTPSA id i18-20020a05600c481200b00407b93d8085sm4675459wmo.27.2023.10.19.09.00.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 19 Oct 2023 09:00:11 -0700 (PDT) Date: Thu, 19 Oct 2023 17:59:58 +0200 From: Mateusz Guzik To: Christian Brauner Cc: Dave Chinner , linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-bcachefs@vger.kernel.org, Kent Overstreet , Alexander Viro Subject: Re: (subset) [PATCH 22/32] vfs: inode cache conversion to hash-bl Message-ID: <20231019155958.7ek7oyljs6y44ah7@f> References: <20230509165657.1735798-1-kent.overstreet@linux.dev> <20230509165657.1735798-23-kent.overstreet@linux.dev> <20230523-zujubeln-heizsysteme-f756eefe663e@brauner> <20231019153040.lj3anuescvdprcq7@f> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20231019153040.lj3anuescvdprcq7@f> X-Spam-Status: No, score=-0.6 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, 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]); Thu, 19 Oct 2023 09:00:31 -0700 (PDT) On Thu, Oct 19, 2023 at 05:30:40PM +0200, Mateusz Guzik wrote: > On Tue, May 23, 2023 at 11:28:38AM +0200, Christian Brauner wrote: > > On Tue, 09 May 2023 12:56:47 -0400, Kent Overstreet wrote: > > > Because scalability of the global inode_hash_lock really, really > > > sucks. > > > > > > 32-way concurrent create on a couple of different filesystems > > > before: > > > > > > - 52.13% 0.04% [kernel] [k] ext4_create > > > - 52.09% ext4_create > > > - 41.03% __ext4_new_inode > > > - 29.92% insert_inode_locked > > > - 25.35% _raw_spin_lock > > > - do_raw_spin_lock > > > - 24.97% __pv_queued_spin_lock_slowpath > > > > > > [...] > > > > This is interesting completely independent of bcachefs so we should give > > it some testing. > > > > I updated a few places that had outdated comments. > > > > --- > > > > Applied to the vfs.unstable.inode-hash branch of the vfs/vfs.git tree. > > Patches in the vfs.unstable.inode-hash branch should appear in linux-next soon. > > > > Please report any outstanding bugs that were missed during review in a > > new review to the original patch series allowing us to drop it. > > > > It's encouraged to provide Acked-bys and Reviewed-bys even though the > > patch has now been applied. If possible patch trailers will be updated. > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git > > branch: vfs.unstable.inode-hash > > > > [22/32] vfs: inode cache conversion to hash-bl > > https://git.kernel.org/vfs/vfs/c/e3e92d47e6b1 > > What, if anything, is blocking this? It is over 5 months now, I don't > see it in master nor -next. > > To be clear there is no urgency as far as I'm concerned, but I did run > into something which is primarily bottlenecked by inode hash lock and > looks like the above should sort it out. > > Looks like the patch was simply forgotten. > > tl;dr can this land in -next please In case you can't be arsed, here is something funny which may convince you to expedite. ;) I did some benching by running 20 processes in parallel, each doing stat on a tree of 1 million files (one tree per proc, 1000 dirs x 1000 files, so 20 mln inodes in total). Box had 24 cores and 24G RAM. Best times: Linux: 7.60s user 1306.90s system 1863% cpu 1:10.55 total FreeBSD: 3.49s user 345.12s system 1983% cpu 17.573 total OpenBSD: 5.01s user 6463.66s system 2000% cpu 5:23.42 total DragonflyBSD: 11.73s user 1316.76s system 1023% cpu 2:09.78 total OmniosCE: 9.17s user 516.53s system 1550% cpu 33.905 total NetBSD failed to complete the run, OOM-killing workers: http://mail-index.netbsd.org/tech-kern/2023/10/19/msg029242.html OpenBSD is shafted by a big kernel lock, so no surprise it takes a long time. So what I find funny is that Linux needed more time than OmniosCE (an Illumos variant, fork of Solaris). It also needed more time than FreeBSD, which is not necessarily funny but not that great either. All systems were mostly busy contending on locks and in particular Linux was almost exclusively busy waiting on inode hash lock.