Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3859010pxb; Tue, 19 Apr 2022 11:13:37 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwHGSImr6mgD0cmMJGQRJDAgOwHzIAQuJRk6qQhHRZSK9FREbEpNcwUR9wwHQS2lZCYyymQ X-Received: by 2002:a17:906:9611:b0:6e8:9b4e:5aaa with SMTP id s17-20020a170906961100b006e89b4e5aaamr14949066ejx.455.1650392017551; Tue, 19 Apr 2022 11:13:37 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650392017; cv=none; d=google.com; s=arc-20160816; b=kUL+4y5PylTtShr6b0qBgWjZA/E/HeL/aH4hDMLThkddCeMow0+v2sHVTctoYF3VjA XnOREIodOgHLF2zirpEWIkqcP9Emj7YMSYKBnd6eTvmh7veKSoCxrH1DJMao7Xza7nV2 DsRC8VCJlDkgEKdMs0LccWoIbEKBne5P53CsbFRCQksRFi0NWDkoxE69ZktLZ7d3prgf 5hBXjiy96CgM+s99Q26RxQPt4V/KzWXbZ1dqSquES7dyHBvaer+WY1bIG9lHIKissaMo DEhZ/nwAV+a7G89laMr46p5UFh9nt4VY8pbX0bNb8B+BuW0JA3rkv47h9KdN0P7sx7Wi 933g== 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=nxk6ARS1KhpZKavk3fbvq/OGlMyKz6/I9rTuwfuzZ9w=; b=q19ytnNUDduA5pNKkcqMjifvlwGRPUFMC8IdcYxm3V28uvzIoXLg3uWGjKY+j1y73V +lYJHb46oKETqcjEE8zA0WdNkEMG5X54yRGHCUOsAyD5dlCUqhMiHoQblGNsc7iy711d Bey56EtjyWDofj9BjGrIlfmVjZIZDArTnwU5oXEsNnVrH56PV0sXL2dEyMZWt71Ih/Hm qnlvashOwer5MESSTJ9J0mIuXl3vLOMXuTbzMZB9RICqA3NWGRlVAJmS5sE/fObrDKyI cXE5V/qgg+H2emGqOif+FEpTKVxu52WphSvNIIL9qAANlCe+ySfi6xKIrjfhZltikFHA FHog== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=BQoHDCeK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id yy20-20020a170906dc1400b006df799f10e4si8587548ejb.678.2022.04.19.11.13.13; Tue, 19 Apr 2022 11:13:37 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=BQoHDCeK; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349842AbiDSITt (ORCPT + 99 others); Tue, 19 Apr 2022 04:19:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41866 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349904AbiDSITb (ORCPT ); Tue, 19 Apr 2022 04:19:31 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 79820344C2; Tue, 19 Apr 2022 01:16:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; 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=nxk6ARS1KhpZKavk3fbvq/OGlMyKz6/I9rTuwfuzZ9w=; b=BQoHDCeKF0vIXfC8DfzcWomYI5 LmiebAdA+mNAXukoCW0SNDlIfg6PTxKc998E2MCFIf31qPBDw2d+0fTnwICrgsky48UNQMfauxydp Hhw2+Y0sFUDRQ6GbpSMnHtvRp30W0L61g88PnCHp6fcXgH2LaC0XmKMvjepM+t9uMrPS6LQyXWSBa yXf4/mGZ7+u4DT3gCPpISQJH7Y0dJd0AsCqNRmm10WaGNi17SH6r2CyvKkJMHvpGnT5S0rVXB27RX CpHL+gaWpeqvNouBrcx01/s1Q0v7uAev7F0V0FrppKogq5gSY83QHZTwVYWbp7Fp0+dgfTeHvqshQ tIVyye+Q==; Received: from j217100.upc-j.chello.nl ([24.132.217.100] helo=worktop.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngj29-002uqH-8O; Tue, 19 Apr 2022 08:16:25 +0000 Received: by worktop.programming.kicks-ass.net (Postfix, from userid 1000) id D369798618A; Tue, 19 Apr 2022 10:16:24 +0200 (CEST) Date: Tue, 19 Apr 2022 10:16:24 +0200 From: Peter Zijlstra To: Jens Axboe Cc: Linus Torvalds , Zhihao Cheng , Ingo Molnar , 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: <20220419081624.GM2731@worktop.programming.kicks-ass.net> References: <20220418092824.3018714-1-chengzhihao1@huawei.com> <587c1849-f81b-13d6-fb1a-f22588d8cc2d@kernel.dk> <69f80fe3-5bec-f02e-474b-e49651f5818f@kernel.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <69f80fe3-5bec-f02e-474b-e49651f5818f@kernel.dk> X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Apr 18, 2022 at 06:30:16PM -0600, Jens Axboe wrote: > On 4/18/22 6:19 PM, Linus Torvalds wrote: > > On Mon, Apr 18, 2022 at 3:12 PM Jens Axboe wrote: > >> > >> Hmm yes. But doesn't preemption imply a full barrier? As long as we > >> assign the plug at the end, we should be fine. And just now looking that > >> up, there's even already a comment to that effect in blk_start_plug(). > >> So barring any weirdness with that, maybe that's the solution. > > > > My worry is more about the code that adds new cb_list entries to the > > plug, racing with then some random preemption event that flushes the > > plug. > > > > preemption itself is perfectly fine wrt any per-thread data updates > > etc, but if preemption then also *changes* the data that is updated, > > that's not great. > > > > So that worries me. > > Yes, and the same is true for eg merge traversal. We'd then need to > disable preempt for that as well... One is only supposed to disable preemption for short and bounded things, otherwise we'll get people complaining their latencies are going bad.