Linux-Fsdevel Archive on lore.kernel.org
help / color / mirror / Atom feed
From: John Hubbard <jhubbard@nvidia.com>
To: Christoph Hellwig <hch@infradead.org>
Cc: Andrew Morton <akpm@linux-foundation.org>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Ilya Dryomov <idryomov@gmail.com>, Jens Axboe <axboe@kernel.dk>,
Jeff Layton <jlayton@kernel.org>, <linux-xfs@vger.kernel.org>,
<linux-fsdevel@vger.kernel.org>, <linux-block@vger.kernel.org>,
<ceph-devel@vger.kernel.org>, <linux-mm@kvack.org>,
LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 4/5] bio: introduce BIO_FOLL_PIN flag
Date: Mon, 24 Aug 2020 00:36:49 -0700 [thread overview]
Message-ID: <f1a9b9b8-3e88-04d1-d08e-bed77330dbd8@nvidia.com> (raw)
In-Reply-To: <efa2519d-53b7-7b08-bf85-a5c2d725282c@nvidia.com>
On 8/22/20 11:57 PM, John Hubbard wrote:
> On 8/22/20 11:25 PM, Christoph Hellwig wrote:
>> On Fri, Aug 21, 2020 at 09:20:58PM -0700, John Hubbard wrote:
>>> Add a new BIO_FOLL_PIN flag to struct bio, whose "short int" flags field
>>> was full, thuse triggering an expansion of the field from 16, to 32
>>> bits. This allows for a nice assertion in bio_release_pages(), that the
>>> bio page release mechanism matches the page acquisition mechanism.
>>>
>>> Set BIO_FOLL_PIN whenever pin_user_pages_fast() is used, and check for
>>> BIO_FOLL_PIN before using unpin_user_page().
>>
>> When would the flag not be set when BIO_NO_PAGE_REF is not set?
>
> Well, I don't *think* you can get there. However, I've only been studying
> bio/block for a fairly short time, and the scattering of get_page() and
> put_page() calls in some of the paths made me wonder if, for example,
> someone was using get_page() to acquire ITER_BVEC or ITER_KVEC via
> get_page(), and release them via bio_release_pages(). It's hard to tell.
>
> It seems like that shouldn't be part of the design. I'm asserting that
> it isn't, with this new flag. But if you're sure that this assertion is
> unnecessary, then let's just drop this patch, of course.
>
Also, I should have done a few more subsystem conversions, before
concluding that BIO_FOLL_PIN was a good idea. Now, as I'm working through mopping
up those other subsystems, I see that nfs/direct.c for example does not have access
to a bio instance, and so the whole thing is not really a great move, at least not
for adding to the iov_iter_pin_user_pages*() APIs.
Let's just drop this patch, after all.
thanks,
--
John Hubbard
NVIDIA
next prev parent reply other threads:[~2020-08-24 7:36 UTC|newest]
Thread overview: 24+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-08-22 4:20 [PATCH 0/5] bio: Direct IO: convert to pin_user_pages_fast() John Hubbard
2020-08-22 4:20 ` [PATCH 1/5] iov_iter: introduce iov_iter_pin_user_pages*() routines John Hubbard
2020-08-22 4:20 ` [PATCH 2/5] mm/gup: introduce pin_user_page() John Hubbard
2020-08-22 4:20 ` [PATCH 3/5] bio: convert get_user_pages_fast() --> pin_user_pages_fast() John Hubbard
2020-08-22 4:20 ` [PATCH 4/5] bio: introduce BIO_FOLL_PIN flag John Hubbard
2020-08-23 6:25 ` Christoph Hellwig
2020-08-23 6:57 ` John Hubbard
2020-08-24 7:36 ` John Hubbard [this message]
2020-08-24 9:20 ` Jens Axboe
2020-08-24 14:42 ` Christoph Hellwig
2020-08-22 4:20 ` [PATCH 5/5] fs/ceph: use pipe_get_pages_alloc() for pipe John Hubbard
2020-08-24 10:53 ` Jeff Layton
2020-08-24 17:54 ` John Hubbard
2020-08-24 18:47 ` Jeff Layton
2020-08-24 18:54 ` Matthew Wilcox
2020-08-24 19:02 ` John Hubbard
2020-08-25 1:20 ` [PATCH v2] " John Hubbard
2020-08-25 16:22 ` Jeff Layton
2020-08-25 1:54 ` [PATCH 0/5] bio: Direct IO: convert to pin_user_pages_fast() Al Viro
2020-08-25 2:07 ` Al Viro
2020-08-25 2:13 ` John Hubbard
2020-08-25 2:07 ` John Hubbard
2020-08-25 2:22 ` Al Viro
2020-08-25 2:27 ` John Hubbard
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=f1a9b9b8-3e88-04d1-d08e-bed77330dbd8@nvidia.com \
--to=jhubbard@nvidia.com \
--cc=akpm@linux-foundation.org \
--cc=axboe@kernel.dk \
--cc=ceph-devel@vger.kernel.org \
--cc=hch@infradead.org \
--cc=idryomov@gmail.com \
--cc=jlayton@kernel.org \
--cc=linux-block@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-xfs@vger.kernel.org \
--cc=viro@zeniv.linux.org.uk \
--subject='Re: [PATCH 4/5] bio: introduce BIO_FOLL_PIN flag' \
/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
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).