[prev in list] [next in list] [prev in thread] [next in thread] 

List:       linux-aio
Subject:    Re: [PATCH 24/27] block: implement bio helper to add iter kvec pages to bio
From:       Jens Axboe <axboe () kernel ! dk>
Date:       2018-11-30 22:06:01
Message-ID: fa952128-f96a-4188-d7e5-2f4783974b1a () kernel ! dk
[Download RAW message or body]

On 11/30/18 2:34 PM, Jens Axboe wrote:
> On 11/30/18 2:25 PM, Al Viro wrote:
>> On Fri, Nov 30, 2018 at 02:16:38PM -0700, Jens Axboe wrote:
>>>>> Would this make you happy:
>>>>>
>>>>> if (!is_vmalloc_addr(kv->iov_base))
>>>>>         page = virt_to_page(kv->iov_base);
>>>>> else
>>>>>         page = vmalloc_to_page(kv->iov_base);
>>>>
>>>> Free advice: don't ever let Linus see anything along those lines.  Results
>>>> tend to be colourful...
>>>
>>> We already have those lines in the kernel, XFS for instance. Al, could you
>>> please try to be helpful instead of being deliberately obtuse?
>>
>> Again, the last time something like that had been suggested, Linus had replied
>> with a very impressive rant.  I *did* propose pretty much that, and reaction
>> was basically "hell no, not in general-purpose primitives".  Precisely about
>> iov_iter stuff.  A part of that was due to touching page refcounts, but quite
>> a bit wasn't.
> 
> Nobody is touching the page count here, and for the aio user mapped IO,
> nobody is touching them at the end either.
> 
> As far as I can tell, the above is fine. It's either a vmalloc'ed
> address and should be treated specially, or we can do virt_to_page() on
> it.
> 
> Do you have a link to said rant?

I found the rant. I think the solution here is to switch it to using
ITER_BVEC instead. With ITER_KVEC, we don't necessarily know if we can
map it, for bvec we already have the pages. And from the aio point of
view, we know the pages are sane.

-- 
Jens Axboe

--
To unsubscribe, send a message with 'unsubscribe linux-aio' in
the body to majordomo@kvack.org.  For more info on Linux AIO,
see: http://www.kvack.org/aio/
Don't email: <a href=mailto:"aart@kvack.org">aart@kvack.org</a>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic