Received: by 2002:a05:6a10:6d10:0:0:0:0 with SMTP id gq16csp3214754pxb; Mon, 18 Apr 2022 19:26:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyQV5dWX5LHt3/rCe1q4dM7yrcdz6LFRnuIk9pdaynUtBqZ5a97ulsLkMOKtP3NViiJnNrR X-Received: by 2002:aa7:d318:0:b0:41d:8733:1c4d with SMTP id p24-20020aa7d318000000b0041d87331c4dmr14619313edq.46.1650335180063; Mon, 18 Apr 2022 19:26:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1650335180; cv=none; d=google.com; s=arc-20160816; b=uOtJ5YgbDFKL0ZlaPH0TZlJzlRUrydlj5kBkGgt9NM+ykn/YC45zRmjjbfRLYRWuPV hFMa0et2KTOLXHlqIcCEx5uZIXRADzYq1bKDvwmiGDovWiWRY9hDSAcnWDHXPs3UtF1z YCG3aYW2y+v2JhIlbWmluk1VeHUt2C6oFcNlFONU8AVKVMzU//zCRs82oioc6iGLdf2s yL9QNBOC8ritj9p8scxcb1t7L76Aj0tvueJIF+1F9SuknnXT3hqSLWk6LMxBbP/IRtin 9VQ16unGItTUch/oaogExmSraZ7kiqphF+7Uz6ZdSGdxrYlcZiTqaAsqMqpWkCyP/z/w cmdg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=QyazptfXP7Rs93K/hiFyb/6AZ61n5qOjKOHynMwC+bQ=; b=yFQv0rZTNRVIhVkYQjfnn5odFmVgudzhUWANBsJK5mLwVhKgY8DA3Ei/eQoNKO5yhq SxvwsmwfHGevLhzlwbymV0TL1Nb/xV1BtsK+fZejZ07yZeFzn/6CVmy18Q96fBu0XStb xzBQopAQK7Zto5sdA06LWI2jEfwrFHD6WejD7tpCbSryii/OLZGAVcIYmwAMVtSx6NNj ErMqN0dcwVmnVy2XhSpLH8CBZ+xzWSXHwGnHmJcZS4Z1G/OiDXnoAwNaHWls0hGX6CPR zrc/If7MdESQ7mBGpc9Q9bXw/kWsy4H29a3dVLLbfxh0bpZ44Pai+920vybGBiNNgrAD RCQQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=MPOgAg96; 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 c11-20020aa7c74b000000b0041e4c76fecfsi7050127eds.555.2022.04.18.19.25.56; Mon, 18 Apr 2022 19:26:20 -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=@kernel-dk.20210112.gappssmtp.com header.s=20210112 header.b=MPOgAg96; 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 S233914AbiDSAdB (ORCPT + 99 others); Mon, 18 Apr 2022 20:33:01 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S237339AbiDSAdA (ORCPT ); Mon, 18 Apr 2022 20:33:00 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 95FD625584 for ; Mon, 18 Apr 2022 17:30:18 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id k29so21830851pgm.12 for ; Mon, 18 Apr 2022 17:30:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20210112.gappssmtp.com; s=20210112; h=message-id:date:mime-version:user-agent:subject:content-language:to :cc:references:from:in-reply-to:content-transfer-encoding; bh=QyazptfXP7Rs93K/hiFyb/6AZ61n5qOjKOHynMwC+bQ=; b=MPOgAg96vGHs3bRXKO17sSSDcM506EcaNoM9FZhvKTml594Xd/4b2Zb4U11WJzDMiK V3XOeg4wkoFb7zNI8pVGxsIyXDoqH8a9iU+jf7KMc7h+aLTyBlWS22HxeR3lKKnTbHw3 Fe0no9m71NRV7VljRyvBGlLb4msg2dBNESrdb/TOF2GY3yzb41IyvfHsyJZxKquQtnao JyRbexn8Aj199OHB1fXz6P6V9B2TKKHrSOJTdeUW420hi4r3Wm3s17pqou5b3peWiA1Y HnYDIVXzsFzioJmKS+15sT7w1jA1X/GC+uUC2YIHdynGr2eh27oxxiXokpdqOyOILxMA 0q3g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=QyazptfXP7Rs93K/hiFyb/6AZ61n5qOjKOHynMwC+bQ=; b=M4zbe5diQR0fWqzxQ9w0q2Y8BJzAiJxUS142vDZzCRLCjyW8MkqlsD8DhrV4axJ78o YVbe1xj0FSoQFiKuJKIiWe/nMKT2mSik+qwK4bKe52TG4hfVdvRCaSj8XfLaV+4PolgL f9TjoVkFMdXpZvATqW6TiIVUGV+da4It5O8iGVoKu00Whd2fOq+TcRPIu0+ITUXUxc6W T3ibxa9JfE0qXPgIzetH5xoMt/mgZDOg4cizbfPuuwI4ELs0Ew4pYkr5rtfxzI4vbk6M NQpOpEd7hi94JY0TMU0oeGpOOv0/hGLQoLem2SL4m0EzjeFjgsV3Y/H1EvULBozDufIh VuSg== X-Gm-Message-State: AOAM530bEL2sZtuV3xMqWJ9Cv3TOhx7pKpbuclHg8cWTQTFXkp4SGASW CgEqoNAMOcpXwdavzOSLw/Cq2Q== X-Received: by 2002:a63:ff1c:0:b0:39c:c83a:7da with SMTP id k28-20020a63ff1c000000b0039cc83a07damr12375416pgi.479.1650328218020; Mon, 18 Apr 2022 17:30:18 -0700 (PDT) Received: from [192.168.1.100] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id g200-20020a6252d1000000b0050833d7602csm14011317pfb.103.2022.04.18.17.30.16 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 18 Apr 2022 17:30:17 -0700 (PDT) Message-ID: <69f80fe3-5bec-f02e-474b-e49651f5818f@kernel.dk> Date: Mon, 18 Apr 2022 18:30:16 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:91.0) Gecko/20100101 Thunderbird/91.8.0 Subject: =?UTF-8?Q?Re=3a_=5bPATCH_v2=5d_fs-writeback=3a_writeback=5fsb=5fino?= =?UTF-8?Q?des=ef=bc=9aRecalculate_=27wrote=27_according_skipped_pages?= Content-Language: en-US To: Linus Torvalds Cc: Zhihao Cheng , Ingo Molnar , Peter Zijlstra , Al Viro , Christoph Hellwig , linux-fsdevel , Linux Kernel Mailing List , yukuai3@huawei.com References: <20220418092824.3018714-1-chengzhihao1@huawei.com> <587c1849-f81b-13d6-fb1a-f22588d8cc2d@kernel.dk> From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,NICE_REPLY_A,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, 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 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... It may be the best option in terms of making this issue go away without having callers working around it. I don't have a good answer to this right now, I'll think about it. -- Jens Axboe