linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Andreas Gruenbacher <agruenba@redhat.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	Dave Chinner <david@fromorbit.com>,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [RFC v2 2/2] gfs2: Rework read and page fault locking
Date: Fri, 3 Jul 2020 12:44:37 +0100	[thread overview]
Message-ID: <20200703114437.GF25523@casper.infradead.org> (raw)
In-Reply-To: <20200703113801.GD25523@casper.infradead.org>

On Fri, Jul 03, 2020 at 12:38:01PM +0100, Matthew Wilcox wrote:
> > @@ -598,16 +562,9 @@ static void gfs2_readahead(struct readahead_control *rac)
> >  {
> >  	struct inode *inode = rac->mapping->host;
> >  	struct gfs2_inode *ip = GFS2_I(inode);
> > -	struct gfs2_holder gh;
> >  
> > -	gfs2_holder_init(ip->i_gl, LM_ST_SHARED, 0, &gh);
> > -	if (gfs2_glock_nq(&gh))
> > -		goto out_uninit;
> >  	if (!gfs2_is_stuffed(ip))
> >  		mpage_readahead(rac, gfs2_block_map);
> 
> I think you probably want to make this:
> 
> 	if (i_blocksize(page->mapping->host) == PAGE_SIZE &&
> 	    !page_has_buffers(page))
> 		error = iomap_readahead(rac, &gfs2_iomap_ops);
> 	else if (!gfs2_is_stuffed(ip))
> 		error = mpage_readahead(rac, gfs2_block_map);
> 
> ... but I understand not wanting to make that change at this point
> in the release cycle.

That was stupid.  I meant to write out:

	if (i_blocksize(rac->mapping->host) == PAGE_SIZE)
		error = iomap_readahead(rac, &gfs2_iomap_ops);
	else if (!gfs2_is_stuffed(ip))
		error = mpage_readahead(rac, gfs2_block_map);

Since the pages are freshly allocated, they can't have buffers, and
the mapping comes out of the readahead_control, not from the page.

  reply	other threads:[~2020-07-03 11:44 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-03  9:53 [RFC v2 0/2] Fix gfs2 readahead deadlocks Andreas Gruenbacher
2020-07-03  9:53 ` [RFC v2 1/2] fs: Add IOCB_NOIO flag for generic_file_read_iter Andreas Gruenbacher
2020-07-03 11:41   ` Matthew Wilcox
2020-07-05 15:08     ` Andreas Gruenbacher
2020-07-03  9:53 ` [RFC v2 2/2] gfs2: Rework read and page fault locking Andreas Gruenbacher
2020-07-03 11:38   ` Matthew Wilcox
2020-07-03 11:44     ` Matthew Wilcox [this message]
2020-07-03 19:24 ` [RFC v2 0/2] Fix gfs2 readahead deadlocks Linus Torvalds
2020-07-03 19:26   ` Linus Torvalds

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=20200703114437.GF25523@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=agruenba@redhat.com \
    --cc=david@fromorbit.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=torvalds@linux-foundation.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).