Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp308574pxj; Fri, 28 May 2021 04:37:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxIeVLG+zf7F4s3HIDg2eaWK3izVlCKKTNrY7RZ7D6UXvAWa1gHXmJ8RF14sV9z+jjSiZHW X-Received: by 2002:a17:906:2ed0:: with SMTP id s16mr8511314eji.543.1622201870137; Fri, 28 May 2021 04:37:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1622201870; cv=none; d=google.com; s=arc-20160816; b=uACfP0ufrGJvhAXB3wT6PkVOlGuqB7Ix6jaWR0R274qksTv7o6FlWzxt841Z1Q6R48 cLNaijRqsLByEPkuzsnUMD13Ap+3NVswG6DvvPpiQX6gOKU53eZDBWJzXvWyeetv37VX BnSE+/ddIN2Vk4m+BEavvuiOwG4K5Bq1AS8YvkM/sUWMJ6Y/IVViuW6CQaPjhHqLCv1R MXil/4dGFqposC0P5si4f8qmCrmtKyqvCHYLSFsWIWNIlZnoeZlG/TL2moByblkwvb4m qbNeFPn6JgkkHRIpKHWN1poJB3eL4ToKJMQw0JpAyf0o5X4c87QN13kHHuDGf7ASCTYo Uz1w== 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=SsFVVPhj5q5aAMvtRGT1C+QnywyHF2m+DNAp455Usbo=; b=zGr47FNrqlFKNjI3FO7S3xqPYmgrpIW2ZwkVyH4Oiz/mer6I2Olg6bFvcBoki4L6Ep nywuhji1wfKbh57Oa462eYO3Nsu86jn33+dWkz4/tYASBUHFPtaLydKRTQBDmF0RF0s/ Y2YNwYxJJ5dtKo6p7V8wem3QM7EbThOiCl7y3l37rY2+7j34q53BtP9OnzPbmTny6vpt +aPS4w9c1R4gsoDi2Pl6wp2bwSaLGruY+qXYHD2XPZDUa6Gy0YAue9R025jVaPkO1ttJ 4cWAwVY6904XVQG7LmZmdEFU3IjiNcgLHwZqpMAYogLNHin1iv1R6pcaRWACih0fQBYq o+UQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lDCCRU5H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id g16si4185173edr.585.2021.05.28.04.37.26; Fri, 28 May 2021 04:37:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=lDCCRU5H; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235849AbhE1I5j (ORCPT + 99 others); Fri, 28 May 2021 04:57:39 -0400 Received: from mail.kernel.org ([198.145.29.99]:55634 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235788AbhE1I5i (ORCPT ); Fri, 28 May 2021 04:57:38 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 16644610A5; Fri, 28 May 2021 08:56:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1622192164; bh=m+ComzkrlyF52OQE+pnXGUScIGVYh7O2OuH8zdu9W74=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lDCCRU5HFWiz+I3jUPSeKwM8DfVdll0IHMSxpxtu9/3CHWKUx/w1NKrkpwpYDCOZL XlKFtAI2v/esjIyh4yIwqP3Kf8aBb5GOzyX1n0InYFGg7ZToYVIs92djaRa4E83dVb JbSEi0+Leh9G1OWnbUSImA2WKLA15p6FSzpDlIho= Date: Fri, 28 May 2021 10:56:01 +0200 From: Greg Kroah-Hartman To: Ian Kent , Fox Chen Cc: Tejun Heo , Eric Sandeen , Brice Goglin , Al Viro , Rick Lindsley , David Howells , Miklos Szeredi , Marcelo Tosatti , linux-fsdevel , Kernel Mailing List Subject: Re: [REPOST PATCH v4 0/5] kernfs: proposed locking and concurrency improvement Message-ID: References: <162218354775.34379.5629941272050849549.stgit@web.messagingengine.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <162218354775.34379.5629941272050849549.stgit@web.messagingengine.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, May 28, 2021 at 02:33:42PM +0800, Ian Kent wrote: > There have been a few instances of contention on the kernfs_mutex during > path walks, a case on very large IBM systems seen by myself, a report by > Brice Goglin and followed up by Fox Chen, and I've since seen a couple > of other reports by CoreOS users. > > The common thread is a large number of kernfs path walks leading to > slowness of path walks due to kernfs_mutex contention. > > The problem being that changes to the VFS over some time have increased > it's concurrency capabilities to an extent that kernfs's use of a mutex > is no longer appropriate. There's also an issue of walks for non-existent > paths causing contention if there are quite a few of them which is a less > common problem. > > This patch series is relatively straight forward. > > All it does is add the ability to take advantage of VFS negative dentry > caching to avoid needless dentry alloc/free cycles for lookups of paths > that don't exit and change the kernfs_mutex to a read/write semaphore. > > The patch that tried to stay in VFS rcu-walk mode during path walks has > been dropped for two reasons. First, it doesn't actually give very much > improvement and, second, if there's a place where mistakes could go > unnoticed it would be in that path. This makes the patch series simpler > to review and reduces the likelihood of problems going unnoticed and > popping up later. > > The patch to use a revision to identify if a directory has changed has > also been dropped. If the directory has changed the dentry revision > needs to be updated to avoid subsequent rb tree searches and after > changing to use a read/write semaphore the update also requires a lock. > But the d_lock is the only lock available at this point which might > itself be contended. Fox, can you take some time and test these to verify it all still works properly with your benchmarks? thanks, greg k-h