linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Matthew Wilcox <willy@infradead.org>
To: Hsin-Yi Wang <hsinyi@chromium.org>
Cc: Phillip Lougher <phillip@squashfs.org.uk>,
	Xiongwei Song <Xiongwei.Song@windriver.com>,
	Zheng Liang <zhengliang6@huawei.com>,
	Zhang Yi <yi.zhang@huawei.com>, Hou Tao <houtao1@huawei.com>,
	Miao Xie <miaoxie@huawei.com>,
	Andrew Morton <akpm@linux-foundation.org>,
	"linux-mm @ kvack . org" <linux-mm@kvack.org>,
	"squashfs-devel @ lists . sourceforge . net" 
	<squashfs-devel@lists.sourceforge.net>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2/2] squashfs: implement readahead
Date: Mon, 16 May 2022 13:36:10 +0100	[thread overview]
Message-ID: <YoJFOpbMYSEOGfXy@casper.infradead.org> (raw)
In-Reply-To: <CAJMQK-jjNRuZFOJrd2knQHwPERaJ64pyys+14cCVyfdsP1GZSQ@mail.gmail.com>

On Mon, May 16, 2022 at 07:04:08PM +0800, Hsin-Yi Wang wrote:
> > +       loff_t req_end = readahead_pos(ractl) + readahead_length(ractl);
> > +       loff_t start = readahead_pos(ractl) &~ mask;
> > +       size_t len = readahead_length(ractl) + readahead_pos(ractl) - start;
> > +       struct squashfs_page_actor *actor;
> > +       unsigned int nr_pages = 0;
> > +       struct page **pages;
> > +       u64 block = 0;
> > +       int bsize, res, i, index;
> > +       int file_end = i_size_read(inode) >> msblk->block_log;
> > +       unsigned int max_pages = 1UL << shift;
> > +
> > +       readahead_expand(ractl, start, (len | mask) + 1);
> > +
> > +       if (readahead_pos(ractl) + readahead_length(ractl) < req_end ||
> > +           file_end == 0)
> > +               return;

What's the first half of this condition supposed to be checking for?
It seems to be checking whether readahead_expand() shrunk the range
covered by the ractl, but readahead_expand() never does that, so I'm
confused why you're checking for it.

  reply	other threads:[~2022-05-16 12:36 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-05-16 10:50 [PATCH 0/2] Implement readahead for squashfs Hsin-Yi Wang
2022-05-16 10:51 ` [PATCH 1/2] Revert "squashfs: provide backing_dev_info in order to disable read-ahead" Hsin-Yi Wang
2022-05-16 10:51 ` [PATCH 2/2] squashfs: implement readahead Hsin-Yi Wang
2022-05-16 11:04   ` Hsin-Yi Wang
2022-05-16 12:36     ` Matthew Wilcox [this message]
2022-05-16 12:47       ` Hsin-Yi Wang
2022-05-16 12:55         ` Matthew Wilcox
2022-05-16 12:57           ` Hsin-Yi Wang
2022-05-16 14:21   ` kernel test robot
2022-05-17  3:40     ` Phillip Lougher
2022-05-16 16:01   ` kernel test robot
2022-05-17  3:41     ` Phillip Lougher
2022-05-17  3:35 ` [PATCH 3/2] squashfs: always build "file direct" version of page actor Phillip Lougher
2022-05-17  7:51   ` Hsin-Yi Wang

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=YoJFOpbMYSEOGfXy@casper.infradead.org \
    --to=willy@infradead.org \
    --cc=Xiongwei.Song@windriver.com \
    --cc=akpm@linux-foundation.org \
    --cc=houtao1@huawei.com \
    --cc=hsinyi@chromium.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=miaoxie@huawei.com \
    --cc=phillip@squashfs.org.uk \
    --cc=squashfs-devel@lists.sourceforge.net \
    --cc=yi.zhang@huawei.com \
    --cc=zhengliang6@huawei.com \
    /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).