Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp723484rwr; Thu, 4 May 2023 08:48:09 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4j3GzQf6okxutZXOay+O3gBpKqoD/jIplUwGfIQeiBFM6p8Cybr1jJqCA96D/+wwydAhmf X-Received: by 2002:a17:90b:1082:b0:24e:2f20:1ce1 with SMTP id gj2-20020a17090b108200b0024e2f201ce1mr2447503pjb.34.1683215289616; Thu, 04 May 2023 08:48:09 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1683215289; cv=none; d=google.com; s=arc-20160816; b=DFaAQfpZv/Zudj/TRu45bJKKcae8hUZ/azg/Ufw19OqqU2WX3VtLaBdTmbcxxGPeiE YNhDstZjOI3E0+lojxNSMvu8sWwhf0xVFNdJAk6JxfsI7bppzSIxlrDeHrR093Vml3ke 6E4nWkMe+UH30Dw9SVA6+6oJVQh39btnCVX/ecZOibY0AB2Zk9Olmg4520cigSUz+guu 3aJgZU5Dzyo/WscjLW3KB6kr0IhY0aiZlumB4bLLsZ2wkNkoyBzLaYwLcBFx7ndj4ily dkFQD8/2CKEeaEBrATA0b77WbdZDRN/dJkXAVB5ZUsY8kDm8t4M6hH4ch6NBLVl3HgpO hhKw== 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-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=Z5IJ8FitUNE2QS2yiRa5LLKouEb3BUu8Rhl1OJu2hKU=; b=f+ZUhMqZV0fhv3CDess7N2P0s/nYUcbfC+L67YGpUwhklgVVy8R0KYM1OvPXLNv08Y 9RSYlsaw3kV2hUwYfo6moBIXqwJV7SIR5QNgNXhlmj2AKich9tT7X/qolvfbAEQfs5vk 5tjJWQ3Rb1rcNnCpjd2okl2me2WxAXw7bHL/UN4ewMah/C0CKMazp4UpW0ESO2hfY1TF jALELtVXN5/H8nbitWytjLWmOcx22tPj6gJRrAB4FwD0tbSjryhBaSkz+C/H26Vd093Y wVb76rPgCbI5v0uxIy6rmA7ir3rIyVf6qLPjvSiRqA7IhfE6B0gQjcsUclc6ptND9ToD s9gg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=MSdkdD0q; 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 nn17-20020a17090b38d100b002478bba4da2si16986676pjb.127.2023.05.04.08.47.55; Thu, 04 May 2023 08:48:09 -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=MSdkdD0q; 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 S231284AbjEDPhO (ORCPT + 99 others); Thu, 4 May 2023 11:37:14 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51096 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230204AbjEDPhM (ORCPT ); Thu, 4 May 2023 11:37:12 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D28D6271C; Thu, 4 May 2023 08:37:10 -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-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description; bh=Z5IJ8FitUNE2QS2yiRa5LLKouEb3BUu8Rhl1OJu2hKU=; b=MSdkdD0qO3wkiTc43I6g/CK525 NThglTciRNY0CbdtLzYc0+HZeFwB0/O4H8/cgVgu2Vwlw51PqdXUmwek3jo/t1skKYvZc1IPp/ktH sjSW9KL09POnrtGCs5kLSvHAGLjpjfB4OBwQnXLorcP2+XQnOf4Be34bkTpXMqP/qm2jdteh11d7i IilJHox0DblPQ0oLOTL2RYqwQHrF/FII5beIIuWK5o85k6zGXYG635uSSE5sNYBOwVu7gIPKdlM4q /mDAAZVNLCVEZfcpGppVu56tKUqP1ikHDF12r7bKFcZQElUiF0nRVpHdBBR0Xd18shtd+bwWqrzhE AfCUFQ3g==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pub10-00Aiya-8C; Thu, 04 May 2023 15:37:06 +0000 Date: Thu, 4 May 2023 16:37:06 +0100 From: Matthew Wilcox To: Ilya Dryomov Cc: Christoph Hellwig , Jan Kara , Johannes Thumshirn , Jens Axboe , linux-block@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm: always respect QUEUE_FLAG_STABLE_WRITES on the block device Message-ID: References: <20230504105624.9789-1-idryomov@gmail.com> <20230504135515.GA17048@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: 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,URIBL_BLOCKED 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 Thu, May 04, 2023 at 05:07:10PM +0200, Ilya Dryomov wrote: > On Thu, May 4, 2023 at 4:16 PM Matthew Wilcox wrote: > > I hate both of these patches ;-) What we should do is add > > AS_STABLE_WRITES, have the appropriate places call > > mapping_set_stable_writes() and then folio_wait_stable() becomes > > > > if (mapping_test_stable_writes(folio->mapping)) > > folio_wait_writeback(folio); > > > > and we remove all the dereferences (mapping->host->i_sb->s_iflags, plus > > whatever else is going on there) > > Hi Matthew, > > We would still need something resembling Christoph's suggestion for > 5.10 and 5.15 (at least). Since this fixes a regression, would you > support merging the "ugly" version to facilitate backports or would > you rather see the AS/mapping-based refactor first? That's a terrible way of developing for Linux. First, do it the right way for mainline. Then, see how easy the patch is to backport to relevant kernel versions; if it's too ugly to cherry-pick, do something equivalent. But never start out with the premise "This must be backported, so do it as simply as possible first".