[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200212174523.GF7778@bombadil.infradead.org>
Date: Wed, 12 Feb 2020 09:45:23 -0800
From: Matthew Wilcox <willy@...radead.org>
To: Christoph Hellwig <hch@...radead.org>
Cc: linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2 16/25] iomap: Support large pages in read paths
On Wed, Feb 12, 2020 at 12:13:40AM -0800, Christoph Hellwig wrote:
> > +/*
> > + * Estimate the number of vectors we need based on the current page size;
> > + * if we're wrong we'll end up doing an overly large allocation or needing
> > + * to do a second allocation, neither of which is a big deal.
> > + */
> > +static unsigned int iomap_nr_vecs(struct page *page, loff_t length)
> > +{
> > + return (length + thp_size(page) - 1) >> page_shift(page);
> > +}
>
> With the multipage bvecs a huge page (or any physically contigous piece
> of memory) will always use one or less (if merged into the previous)
> bio_vec. So this can be simplified and optimized.
Oh, hm, right. So what you really want here is for me to pass in the
number of thp pages allocated by the readahead operation. rac->nr_pages
is the number of PAGE_SIZE pages, but we could have an rac->nr_segs
element as well.
Powered by blists - more mailing lists