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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 6D920C7EE23 for ; Thu, 4 May 2023 23:07:43 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 6DAA56B0075; Thu, 4 May 2023 19:07:42 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 68AAC6B0078; Thu, 4 May 2023 19:07:42 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 579166B007B; Thu, 4 May 2023 19:07:42 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by kanga.kvack.org (Postfix) with ESMTP id 30EF76B0075 for ; Thu, 4 May 2023 19:07:42 -0400 (EDT) Received: by mail-pf1-f182.google.com with SMTP id d2e1a72fcca58-6439f186366so55799b3a.2 for ; Thu, 04 May 2023 16:07:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=fromorbit-com.20221208.gappssmtp.com; s=20221208; t=1683241661; x=1685833661; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=OHavU7b++EdxxQ22ZGGLwIbxD+Nbs7Rp71uaaeR4ax8=; b=IB4/C9RqnwVRnxZSBi6qJQIjFROerjiQJYMIzD6f5y9fkAA3sacIngrgECO6D9+F7z pOfrdBCW9N7BbTuklYOvXjCiv/19tNWVdaa3Zp1UEQUfcEt8JCBmViFg1d3kD3f7BeWK uwQ/O9Zz/MNpsrnWajqx8rfmXjan32ObBK7OV1IIPTyUNcU/akYeRY+I/kPXez/ijArr Jwv76icAio1qTl4rzj81Aaklm3//Q1dolo+sBBvmSnCvwVQnUc5VQGF3g2+/fDFOP0sg AoC+Xh5JtZG4znoF1ijmxwDlWOUmOFnkRMSH29qSan15fjrHlkdMu/tLpKicxUfQtevK KzTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1683241661; x=1685833661; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=OHavU7b++EdxxQ22ZGGLwIbxD+Nbs7Rp71uaaeR4ax8=; b=J36JUhdqeNWRW/PlZB655WKvDugz4nGdEbLXbWuJvU+J3oVqdnP/ERz6Uym+peHKcX fy4eqou8SC/eiMQQxLOBDpjF6k2wJwp7upMtXn+Xf+7a/9tuhD5l8AVNANKhWpAH0M+N prOdZJhVARpZsAcevkPSbFxw1+kc/IM8v7SzFJ/N6LZI+JzpKffWUx7He8BklpYPkQv3 JD/mztAfxUABHyBRfTYVYgaVDdnDyu0qUarJ2rcPBf3m9TVmOhg3bu7QRG5HMK9Aasc3 dTb81VhW7iCRl2PSX9NbiufmYjW+confFtvmHfWlTbZ/P2DdQlm5l6cSkhhvFJHCHsY3 fTOQ== X-Gm-Message-State: AC+VfDy+/hn2pM7LACzL4n1AuhLda9OniWEi0tYFiIvpo92FdbR4KesC zAp+inf8jwPJpn4nupNKQkWQbQ== X-Google-Smtp-Source: ACHHUZ5MoaJgTrSOj5stgXzaVIgXk8YiDWf+wdpl7iab5LUNSH4lgZjNdO61pSnHZtJLTSUHxfuqiQ== X-Received: by 2002:a05:6a00:1a8b:b0:643:8610:1023 with SMTP id e11-20020a056a001a8b00b0064386101023mr3903338pfv.17.1683241661497; Thu, 04 May 2023 16:07:41 -0700 (PDT) Received: from dread.disaster.area (pa49-181-88-204.pa.nsw.optusnet.com.au. [49.181.88.204]) by smtp.gmail.com with ESMTPSA id d25-20020aa78159000000b0063d2bb0d107sm191083pfn.64.2023.05.04.16.07.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 04 May 2023 16:07:40 -0700 (PDT) Received: from dave by dread.disaster.area with local (Exim 4.92.3) (envelope-from ) id 1pui2y-00BQJv-PM; Fri, 05 May 2023 09:07:36 +1000 Date: Fri, 5 May 2023 09:07:36 +1000 From: Dave Chinner To: Matthew Wilcox Cc: Jan Kara , Christoph Hellwig , Ilya Dryomov , 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: <20230504230736.GA2651828@dread.disaster.area> References: <20230504105624.9789-1-idryomov@gmail.com> <20230504135515.GA17048@lst.de> <20230504155556.t6byee6shgb27pw5@quack3> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Thu, May 04, 2023 at 05:16:48PM +0100, Matthew Wilcox wrote: > On Thu, May 04, 2023 at 05:55:56PM +0200, Jan Kara wrote: > > For bdev address_space that's easy but what Ilya also mentioned is a > > problem when 'stable_write' flag gets toggled on the device and in that > > case having to propagate the flag update to all the address_space > > structures is a nightmare... > > We have a number of flags which don't take effect when modified on a > block device with a mounted filesystem on it. For example, modifying > the readahead settings do not change existing files, only new ones. > Since this flag is only modifiable for debugging purposes, I think I'm > OK with it not affecting already-mounted filesystems. It feels like a > decision that reasonable people could disagree on, though. I think an address space flag makes sense, because then we don't even have to care about the special bdev sb/inode thing - folio->mapping will already point at the bdev mapping and so do the right thing. That is, if the bdev changes stable_write state, it can toggle the AS_STABLE_WRITE flag on it's inode->i_mapping straight away and all the folios and files pointing to the bdev mapping will change behaviour immediately. Everything else retains the same behaviour we have now - the stable_write state is persistent on the superblock until the filesystem mount is cycled. Cheers, Dave. -- Dave Chinner david@fromorbit.com