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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 88906C433EF for ; Tue, 19 Apr 2022 08:18:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349856AbiDSIUw (ORCPT ); Tue, 19 Apr 2022 04:20:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49888 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347046AbiDSIUu (ORCPT ); Tue, 19 Apr 2022 04:20:50 -0400 Received: from desiato.infradead.org (desiato.infradead.org [IPv6:2001:8b0:10b:1:d65d:64ff:fe57:4e05]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EB82B5FCF; Tue, 19 Apr 2022 01:18:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=desiato.20200630; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=rRxmedwUzsUPi3oM81wvEiIXlzZjV8rSZCFbGT4aQEw=; b=KG4yrVW6YDkJYUvbVknV9ibkO9 8IsGMxingUi69r/wkNBP/v8NPQrdmmbtsKg4+dfmG8X1ofDkC3SOPn7N6LUZVbG05T/7vo23+vSV1 dq8xOolvvEe5DILX7bM8CajlS9jgctC16ydTR6r8CyO98x6Xlt7JCiRkTmke+tFDfB9d7l9zMHU6g eFAp6ygTES8KkkKUMrwfF7H+iKZPeeUkZt4G/7poq08HIV8NkjXembkGrBbzATFy2nrvt0V0y6/QN AvZmIq2Z2duZ6Cba1mMTp73XYeSPe72lDmDc7WeQCTRENCDcVXoaKRgqmqXMwE9FHEQwsp0Hetca9 7Rm5dlog==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by desiato.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngj3d-006lEh-DR; Tue, 19 Apr 2022 08:17:57 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id B47D398618A; Tue, 19 Apr 2022 10:17:55 +0200 (CEST) Date: Tue, 19 Apr 2022 10:17:55 +0200 From: Peter Zijlstra To: Linus Torvalds Cc: Zhihao Cheng , Ingo Molnar , Jens Axboe , Al Viro , Christoph Hellwig , linux-fsdevel , Linux Kernel Mailing List , yukuai3@huawei.com Subject: Re: [PATCH v2] fs-writeback: =?utf-8?Q?wri?= =?utf-8?Q?teback=5Fsb=5Finodes=EF=BC=9ARecalculat?= =?utf-8?Q?e?= 'wrote' according skipped pages Message-ID: <20220419081755.GN2731@worktop.programming.kicks-ass.net> References: <20220418092824.3018714-1-chengzhihao1@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 18, 2022 at 12:43:43PM -0700, Linus Torvalds wrote: > Which all brings us back to how we have that hacky thing in > writeback_sb_inodes() that does > > if (need_resched()) { > /* > * We're trying to balance between building up a nice > * long list of IOs to improve our merge rate, and > * getting those IOs out quickly for anyone throttling > * in balance_dirty_pages(). cond_resched() doesn't > * unplug, so get our IOs out the door before we > * give up the CPU. > */ > blk_flush_plug(current->plug, false); > cond_resched(); > } Yeah, that's horribly broken for PREEMPT=y.