lkml.org 
[lkml]   [2023]   [Mar]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH v6 4/4] mm: vmalloc: convert vread() to vread_iter()
From
On 22.03.23 15:55, Lorenzo Stoakes wrote:
> Having previously laid the foundation for converting vread() to an iterator
> function, pull the trigger and do so.
>
> This patch attempts to provide minimal refactoring and to reflect the
> existing logic as best we can, for example we continue to zero portions of
> memory not read, as before.
>
> Overall, there should be no functional difference other than a performance
> improvement in /proc/kcore access to vmalloc regions.
>
> Now we have eliminated the need for a bounce buffer in read_kcore_iter(),
> we dispense with it, and try to write to user memory optimistically but
> with faults disabled via copy_page_to_iter_nofault(). We already have
> preemption disabled by holding a spin lock.
>
> If this fails, we fault in and retry a single time. This is a conservative
> approach intended to avoid spinning on vread_iter() if we repeatedly
> encouter issues reading from it.

I have to ask again: Can you comment why that is ok? You might end up
signaling -EFAULT to user space simply because swapping/page
migration/whatever triggered at the wrong time.

That could break existing user space or which important part am I missing?

--
Thanks,

David / dhildenb

\
 
 \ /
  Last update: 2023-03-27 01:12    [W:0.043 / U:0.012 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site