From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-3.7 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 09DF1C33CB7 for ; Wed, 29 Jan 2020 22:15:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D4D6320702 for ; Wed, 29 Jan 2020 22:15:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726401AbgA2WPq (ORCPT ); Wed, 29 Jan 2020 17:15:46 -0500 Received: from outgoing-auth-1.mit.edu ([18.9.28.11]:55331 "EHLO outgoing.mit.edu" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726222AbgA2WPq (ORCPT ); Wed, 29 Jan 2020 17:15:46 -0500 Received: from callcc.thunk.org (guestnat-104-133-9-100.corp.google.com [104.133.9.100] (may be forged)) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 00TMFcLC027980 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 29 Jan 2020 17:15:39 -0500 Received: by callcc.thunk.org (Postfix, from userid 15806) id 084F9420324; Wed, 29 Jan 2020 17:15:46 -0500 (EST) Date: Wed, 29 Jan 2020 17:15:46 -0500 From: "Theodore Y. Ts'o" To: Konstantin Khlebnikov Cc: linux-kernel@vger.kernel.org, David Howells , Alexander Viro , linux-fsdevel@vger.kernel.org, linux-ext4@vger.kernel.org, Dmitry Monakhov Subject: Re: [PATCH RFC] ext4: skip concurrent inode updates in lazytime optimization Message-ID: <20200129221546.GB303030@mit.edu> References: <158031264567.6836.126132376018905207.stgit@buzz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <158031264567.6836.126132376018905207.stgit@buzz> Sender: linux-ext4-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-ext4@vger.kernel.org On Wed, Jan 29, 2020 at 06:44:05PM +0300, Konstantin Khlebnikov wrote: > Function ext4_update_other_inodes_time() implements optimization which > opportunistically updates times for inodes within same inode table block. > > For now concurrent inode lookup by number does not scale well because > inode hash table is protected with single spinlock. It could become very > hot at concurrent writes to fast nvme when inode cache has enough inodes. > > Probably someday inode hash will become searchable under RCU. > (see linked patchset by David Howells) > > Let's skip concurrent updates instead of wasting cpu time at spinlock. > > Signed-off-by: Konstantin Khlebnikov > Link: https://lore.kernel.org/lkml/155620449631.4720.8762546550728087460.stgit@warthog.procyon.org.uk/ Hmm.... I wonder what Al thinks of adding a varaint of find_inode_nowait() which uses tries to grab the inode_hash_lock() using a trylock, and returns ERR_PTR(-EAGAIN) if the attempt to grab the lock fails. This might be better since it will prevent other conflicts between ext4_update_other_inodes_time() and other attempts to lookup inodes which can't be skipped if things are busy. - Ted