Re: [PATCH 1/5] dax: prepare pmem for use by zero-initializing contents and clearing poisons

Christoph Hellwig
2021-09-21T08:35:50Z

On Fri, Sep 17, 2021 at 06:30:50PM -0700, Darrick J. Wong wrote:
> + case IOMAP_MAPPED:
> + while (nr_pages > 0) {
> + /* XXX function only supports one page at a time?! */
> + ret = dax_zero_page_range(iomap->dax_dev, start_page,
> + 1);

Yes. Given that it will have to kmap every page that kinda makes sense.
Unlike a nr_pages argument which needs to be 1, which is just silly.
That being said it would make sense to move the trivial loop over the
pages into the methods to reduce the indirect function call overhead