All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jeff Layton <jlayton@redhat.com>
To: Matthew Wilcox <willy@infradead.org>
Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org, Christoph Hellwig <hch@lst.de>
Subject: Re: [PATCH 02/11] filemap: Remove filemap_check_and_keep_errors()
Date: Mon, 09 Jan 2023 09:31:00 -0500	[thread overview]
Message-ID: <05df91ed071cfefa272bb8d2fb415222867bae32.camel@redhat.com> (raw)
In-Reply-To: <Y7weinAVLt0uPRa8@casper.infradead.org>

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'll look over the rest of the set.

Thanks,
--
Jeff Layton <jlayton@redhat.com>


  reply	other threads:[~2023-01-09 14:32 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-09  5:18 [PATCH 00/11] Remove AS_EIO and AS_ENOSPC Matthew Wilcox (Oracle)
2023-01-09  5:18 ` Matthew Wilcox (Oracle)
2023-01-09  5:18 ` [PATCH 01/11] memory-failure: Remove comment referencing AS_EIO Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-12  8:31   ` Christoph Hellwig
2023-01-09  5:18 ` [PATCH 02/11] filemap: Remove filemap_check_and_keep_errors() Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09 13:48   ` Jeff Layton
2023-01-09 14:02     ` Matthew Wilcox
2023-01-09 14:31       ` Jeff Layton [this message]
2023-01-09 15:02         ` Matthew Wilcox
2023-01-09  5:18 ` [PATCH 03/11] f2fs: Convert f2fs_wait_on_node_pages_writeback() to errseq Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09  5:18 ` [PATCH 04/11] fuse: Convert fuse_flush() to use file_check_and_advance_wb_err() Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09 15:25   ` Jeff Layton
2023-01-09  5:18 ` [PATCH 05/11] page-writeback: Convert folio_write_one() to use an errseq Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09  5:18 ` [PATCH 06/11] filemap: Convert filemap_write_and_wait_range() to use errseq Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-17  2:55   ` kernel test robot
2023-01-09  5:18 ` [PATCH 07/11] filemap: Convert filemap_fdatawait_range() to errseq Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09  5:18 ` [PATCH 08/11] cifs: Remove call to filemap_check_wb_err() Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09 14:42   ` Jeff Layton
2023-01-09 15:07     ` Matthew Wilcox
2023-01-09 15:14     ` Jeff Layton
2023-01-09 15:30       ` Matthew Wilcox
2023-01-09 15:43         ` Jeff Layton
2023-01-09  5:18 ` [PATCH 09/11] mm: Remove AS_EIO and AS_ENOSPC Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09  5:18 ` [PATCH 10/11] mm: Remove filemap_fdatawait_range_keep_errors() Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09  5:18 ` [PATCH 11/11] mm: Remove filemap_fdatawait_keep_errors() Matthew Wilcox (Oracle)
2023-01-09  5:18   ` Matthew Wilcox (Oracle)
2023-01-09 15:31 ` [PATCH 00/11] Remove AS_EIO and AS_ENOSPC Jeff Layton
2023-01-12  8:30 ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=05df91ed071cfefa272bb8d2fb415222867bae32.camel@redhat.com \
    --to=jlayton@redhat.com \
    --cc=hch@lst.de \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=willy@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.