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 E0F07C677F1 for ; Mon, 9 Jan 2023 15:02:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 375428E0002; Mon, 9 Jan 2023 10:02:54 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 326898E0001; Mon, 9 Jan 2023 10:02:54 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1EDBE8E0002; Mon, 9 Jan 2023 10:02:54 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 0C4788E0001 for ; Mon, 9 Jan 2023 10:02:54 -0500 (EST) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id CE1DA80AE9 for ; Mon, 9 Jan 2023 15:02:53 +0000 (UTC) X-FDA: 80335577826.09.92717EC Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf21.hostedemail.com (Postfix) with ESMTP id 306CC1C001F for ; Mon, 9 Jan 2023 15:02:50 +0000 (UTC) Authentication-Results: imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=kRYbhsmU; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1673276571; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=6o3r2EMyccew4PMHM+hL8pHG/IMPNNpv5+R12jgC6lA=; b=lzJtGscMTI6M8yunrhNFgYXHtlBB4XffyVPEzGO09a6ZWFEm159MF++CkeeUM300TnIYJd PNtxzSPlkt5xdhdGobb5Z7wHDu2dMqB7Fzj8iGhi+nHjMKDW7r0kbQT2zB+TsKDRHC1KV8 yebfV5Tod23+9Jpzq3d1+uYVoLp0uuk= ARC-Authentication-Results: i=1; imf21.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=kRYbhsmU; spf=none (imf21.hostedemail.com: domain of willy@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=willy@infradead.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1673276571; a=rsa-sha256; cv=none; b=tiK3Q6ktFgnkqv66/ZC3hpbh/t/ZyT7L6zzx/KoydAWjJsY6Fj2Yw0AzHF9eHrqjGaGQ68 tFnjY39edYqKRF8azU02s/HDj/7ZiG0G/+kEu3pHwWMUPZwd+uGNAcEb9p2i1jM1D29pNi 1fKn96ab2ldAvEjB494mb2cp2KoiZhM= 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=6o3r2EMyccew4PMHM+hL8pHG/IMPNNpv5+R12jgC6lA=; b=kRYbhsmUqtz7MJELa5DMvJ4VzI 6X90lrh3MAb0AIocQDosyWd6xWeVzvyuJrsUYMQztbBYwfsmPXDyS4olyKkeV4RTEuwcqO0Tv8eWe XjEPn1N0fJJo10rKVG6oL/LDCcXf/PL5DEaFhFtXgh6MueLKYg8q/zPjuZBcQVUSgel55zEIY4NYP lotZ+B7P0JsJ+9216Jzf6B/g0gzs+oYAoLkxUeHuwpjQDMzMlbnXhWXdt/9lvnOLcXluRjaZqa7uW PdLuvYrfIhjdjaLwTYqha4g23TN/WXSruYsiK5FgblOwfcP/Ugk6QM4mVBY1WHf5p2fbRCh5fDJJ+ seAPhoAA==; Received: from willy by casper.infradead.org with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1pEtft-002NKW-SN; Mon, 09 Jan 2023 15:02:57 +0000 Date: Mon, 9 Jan 2023 15:02:57 +0000 From: Matthew Wilcox To: Jeff Layton Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Christoph Hellwig Subject: Re: [PATCH 02/11] filemap: Remove filemap_check_and_keep_errors() Message-ID: References: <20230109051823.480289-1-willy@infradead.org> <20230109051823.480289-3-willy@infradead.org> <36311b962209353333be4c8ceaf0e0823ef9f228.camel@redhat.com> <05df91ed071cfefa272bb8d2fb415222867bae32.camel@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <05df91ed071cfefa272bb8d2fb415222867bae32.camel@redhat.com> X-Rspam-User: X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 306CC1C001F X-Stat-Signature: ak74hnxm5qznojr3kq3xmshzousefqxw X-HE-Tag: 1673276570-423232 X-HE-Meta: U2FsdGVkX1/egDmIsUECCAJCkI8JhlrhmdII/w3v5Z3SDqWqqOdAt0jmA8UwgEIlJiobWdB1xbDVR84bXqJqaAf6MWPb08irRr+Ff0AIYYq4sfjDEY/iXBJ1usaCstUlkOnZCA/jnx651zQC0h7R/UhUKwPnTjIycoiQjd+h/h0MuzspP6W9tSY8VeaZwDwzkh2uk9j+37+AicBQUEKZaUTwbpiYbiXcB9DQqGf6S3mi9GvSJoa8ApUS5teESV0WC7G1vW06FuHFqVTKaWAgBpPzJm/6biNn/0dxR0Mp3foM7dgSvvzVBq6hG8Id5h0VfRAkfnFLJYStaK3ieVbmYOVLXbV1fv4Wr9hq672Cc7nl/lA0vTm5R16LfQnQR5+r38ROaQH7n6/dAmA8PrAdqPIy0EBNuNHSsviLlsXEDXjLUmjOYP5sfiuW0XDI4ZKKHP4fUp6oIEfoqPvBiNWy+NZUYy/mrCWzDyp2zl7cqVfTjuOQ6s82B0d5dTGtzJo4sCxEq7v4U0LeLBoqkDD/eQDHa5w96NL0v/NFa0kVpGgQS4ov9WHCWqs/QWrCw9WKpVsRPJJD2HmRANdrVWhzpYo/h0WrlvxptCI6m8HwbnlwD/jAtwLmknoBlS7DEEl2xdao+mbsaXwqKqq6jdwbnRUTMJhZ9DDk1arVXvGYjVwpXKdV1w2+39xcvwW1pkGKDOlOIUzWleg3EGaJtWvKktTsACe9upLHmU5XZgOsFhc307LkgLliZxKXlmzu9BYMnG7DmpklBQDO2J99sdUWm1DFq5T7aueLDSqeqTNd1WuJkxe7I8kU+bDdy3x3uSB3t6ZrUA4RGrV3XIXWWEvVLdad0mDzjZDXzHLZPS6hJa14Ip4UfwCgBjYwhXH+VqEakWaTTDkpyvdi6PjDBysFTg== 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 Mon, Jan 09, 2023 at 09:31:00AM -0500, Jeff Layton wrote: > On Mon, 2023-01-09 at 14:02 +0000, Matthew Wilcox wrote: > > On Mon, Jan 09, 2023 at 08:48:49AM -0500, Jeff Layton wrote: > > > On Mon, 2023-01-09 at 05:18 +0000, Matthew Wilcox (Oracle) wrote: > > > > Convert both callers to use the "new" errseq infrastructure. > > > > > > I looked at making this sort of change across the board alongside the > > > original wb_err patches, but I backed off at the time. > > > > > > With the above patch, this function will no longer report a writeback > > > error that occurs before the sample. Given that writeback can happen at > > > any time, that seemed like it might be an undesirable change, and I > > > didn't follow through. > > > > > > It is true that the existing flag-based code may miss errors too, if > > > multiple tasks are test_and_clear'ing the bits, but I think the above is > > > even more likely to happen, esp. under memory pressure. > > > > > > To do this right, we probably need to look at these callers and have > > > them track a long-term errseq_t "since" value before they ever dirty the > > > pages, and then continually check-and-advance vs. that. > > > > > > For instance, the main caller of the above function is jbd2. Would it be > > > reasonable to add in a new errseq_t value to the jnode for tracking > > > errors? > > > > Doesn't b4678df184b3 address this problem? If nobody has seen the > > error, we return 0 instead of the current value of wb_err, ensuring > > that somebody always sees the error. > > > > I was originally thinking no, but now I think you're correct. > > We do initialize the "since" value to 0 if an error has never been seen, > so that (sort of) emulates the behavior of the existing AS_EIO/AS_ENOSPC > flags. > > It's still not quite as reliable as plumbing a "since" value through all > of the callers (particularly in the case where there are multiple > waiters), but maybe it's good enough here. I actually think we may have the opposite problem; that for some of these scenarios, we never mark the error as seen. ie we always end up calling errseq_check() and never errseq_check_and_advance(). So every time we write something, it'll remind us that we have an error.