[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d86e6340-534c-c34c-ab1d-6ebacb213bb9@kernel.dk>
Date: Sun, 8 Jan 2023 20:54:12 -0700
From: Jens Axboe <axboe@...nel.dk>
To: David Howells <dhowells@...hat.com>,
Al Viro <viro@...iv.linux.org.uk>
Cc: Christoph Hellwig <hch@....de>,
Matthew Wilcox <willy@...radead.org>,
Logan Gunthorpe <logang@...tatee.com>,
Christoph Hellwig <hch@...radead.org>,
Jeff Layton <jlayton@...nel.org>,
linux-fsdevel@...r.kernel.org, linux-block@...r.kernel.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v4 7/7] iov_iter, block: Make bio structs pin pages rather
than ref'ing if appropriate
On 1/6/23 5:34 PM, David Howells wrote:
> Convert the block layer's bio code to use iov_iter_extract_pages() instead
> of iov_iter_get_pages(). This will pin pages or leave them unaltered
> rather than getting a ref on them as appropriate to the source iterator.
>
> A field, bi_cleanup_mode, is added to the bio struct that gets set by
> iov_iter_extract_pages() with FOLL_* flags indicating what cleanup is
> necessary. FOLL_GET -> put_page(), FOLL_PIN -> unpin_user_page(). Other
> flags could also be used in future.
>
> Newly allocated bio structs have bi_cleanup_mode set to FOLL_GET to
> indicate that attached pages are ref'd by default. Cloning sets it to 0.
> __bio_iov_iter_get_pages() overrides it to what iov_iter_extract_pages()
> indicates.
What's the motivation for this change? It's growing struct bio, which we
can have a lot of in the system. I read the cover letter too and I can
tell what the change does, but there's no justification really for the
change.
So unless there's a good reason to do this, then that's a NAK in terms
of just the addition to struct bio alone.
--
Jens Axboe
Powered by blists - more mailing lists