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=-13.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham 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 49D7AC4338F for ; Thu, 5 Aug 2021 05:42:05 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 2C55260F94 for ; Thu, 5 Aug 2021 05:42:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229892AbhHEFmR (ORCPT ); Thu, 5 Aug 2021 01:42:17 -0400 Received: from mail108.syd.optusnet.com.au ([211.29.132.59]:56094 "EHLO mail108.syd.optusnet.com.au" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229674AbhHEFmR (ORCPT ); Thu, 5 Aug 2021 01:42:17 -0400 Received: from dread.disaster.area (pa49-195-182-146.pa.nsw.optusnet.com.au [49.195.182.146]) by mail108.syd.optusnet.com.au (Postfix) with ESMTPS id 7D9141B354A; Thu, 5 Aug 2021 15:42:02 +1000 (AEST) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1mBW8n-00EghP-W4; Thu, 05 Aug 2021 15:42:02 +1000 Date: Thu, 5 Aug 2021 15:42:01 +1000 From: Dave Chinner To: "Darrick J. Wong" Cc: linux-xfs@vger.kernel.org, hch@infradead.org Subject: Re: [PATCH 12/14] xfs: use background worker pool when transactions can't get free space Message-ID: <20210805054201.GC2757197@dread.disaster.area> References: <162812918259.2589546.16599271324044986858.stgit@magnolia> <162812924890.2589546.999461658082207492.stgit@magnolia> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <162812924890.2589546.999461658082207492.stgit@magnolia> X-Optus-CM-Score: 0 X-Optus-CM-Analysis: v=2.3 cv=YKPhNiOx c=1 sm=1 tr=0 a=QpfB3wCSrn/dqEBSktpwZQ==:117 a=QpfB3wCSrn/dqEBSktpwZQ==:17 a=kj9zAlcOel0A:10 a=MhDmnRu9jo8A:10 a=VwQbUJbxAAAA:8 a=20KFwNOVAAAA:8 a=7-415B0cAAAA:8 a=tEyw3uU3nvo7RWpYSTYA:9 a=7Zwj6sZBwVKJAoWSPKxL6X1jA+E=:19 a=CjuIK1q_8ugA:10 a=AjGcO6oz07-iQ99wixmX:22 a=biEYGPWJfzWAr4FL6Ov7:22 Precedence: bulk List-ID: X-Mailing-List: linux-xfs@vger.kernel.org On Wed, Aug 04, 2021 at 07:07:28PM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong > > In xfs_trans_alloc, if the block reservation call returns ENOSPC, we > call xfs_blockgc_free_space with a NULL icwalk structure to try to free > space. Each frontend thread that encounters this situation starts its > own walk of the inode cache to see if it can find anything, which is > wasteful since we don't have any additional selection criteria. For > this one common case, create a function that reschedules all pending > background work immediately and flushes the workqueue so that the scan > can run in parallel. > > Signed-off-by: Darrick J. Wong > --- > fs/xfs/xfs_icache.c | 28 ++++++++++++++++++++++++++++ > fs/xfs/xfs_icache.h | 1 + > fs/xfs/xfs_trace.h | 1 + > fs/xfs/xfs_trans.c | 5 +---- > 4 files changed, 31 insertions(+), 4 deletions(-) Yup, looks a bit more efficient to do it this way. Reviewed-by: Dave Chinner -- Dave Chinner david@fromorbit.com