linux-fsdevel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Guixin Liu <kanie@linux.alibaba.com>,
	linux-fsdevel@vger.kernel.org, linux-mm@kvack.org,
	Kent Overstreet <kent.overstreet@gmail.com>
Subject: Re: [RFC PATCH] mm/filemap.c: fix the timing of asignment of prev_pos
Date: Wed, 17 Aug 2022 16:30:58 +0100	[thread overview]
Message-ID: <Yv0Jsjp3qCnKn13V@casper.infradead.org> (raw)
In-Reply-To: <20220817081657.5e8332cec593621fccfacf93@linux-foundation.org>

On Wed, Aug 17, 2022 at 08:16:57AM -0700, Andrew Morton wrote:
> On Wed, 17 Aug 2022 21:51:57 +0800 Guixin Liu <kanie@linux.alibaba.com> wrote:
> 
> > The prev_pos should be assigned before the iocb->ki_pos is incremented,
> > so that the prev_pos is the exact location of the last visit.
> > 
> > Fixes: 06c0444290cec ("mm/filemap.c: generic_file_buffered_read() now
> > uses find_get_pages_contig")
> > Signed-off-by: Guixin Liu <kanie@linux.alibaba.com>
> > 
> > ---
> > Hi guys,
> >     When I`m running repetitive 4k read io which has same offset,
> > I find that access to folio_mark_accessed is inevitable in the
> > read process, the reason is that the prev_pos is assigned after the
> > iocb->ki_pos is incremented, so that the prev_pos is always not equal
> > to the position currently visited.
> >     Is this a bug that needs fixing?
> 
> It looks wrong to me and it does appear that 06c0444290cecf0 did this
> unintentionally.

That commit was the start of a problem, but I think I restored the
original behaviour in 5ccc944dce3d.  You were part of that discussion
back in June:
https://lore.kernel.org/linux-mm/20220602082129.2805890-1-yukuai3@huawei.com/


  reply	other threads:[~2022-08-17 15:31 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-17 13:51 [RFC PATCH] mm/filemap.c: fix the timing of asignment of prev_pos Guixin Liu
2022-08-17 15:16 ` Andrew Morton
2022-08-17 15:30   ` Matthew Wilcox [this message]
2022-08-17 15:25 ` Matthew Wilcox
2022-08-18  3:13   ` Guixin Liu

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=Yv0Jsjp3qCnKn13V@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=akpm@linux-foundation.org \
    --cc=kanie@linux.alibaba.com \
    --cc=kent.overstreet@gmail.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.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).