lkml.org 
[lkml]   [2023]   [Apr]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 4/7] mm/gup: introduce the FOLL_SAME_FILE GUP flag
On Sat, Apr 15, 2023 at 12:27:40AM +0100, Lorenzo Stoakes wrote:
> This flag causes GUP to assert that all VMAs within the input range possess
> the same vma->vm_file. If not, the operation fails.
>
> This is part of a patch series which eliminates the vmas parameter from the
> GUP API, implementing the one remaining assertion within the entire kernel
> that requires access to the VMAs associated with a GUP range.
>
> Signed-off-by: Lorenzo Stoakes <lstoakes@gmail.com>
> ---
> include/linux/mm_types.h | 2 ++
> mm/gup.c | 16 ++++++++++++----
> 2 files changed, 14 insertions(+), 4 deletions(-)
>
> diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
> index 3fc9e680f174..84d1aec9dbab 100644
> --- a/include/linux/mm_types.h
> +++ b/include/linux/mm_types.h
> @@ -1185,6 +1185,8 @@ enum {
> FOLL_PCI_P2PDMA = 1 << 10,
> /* allow interrupts from generic signals */
> FOLL_INTERRUPTIBLE = 1 << 11,
> + /* assert that the range spans VMAs with the same vma->vm_file */
> + FOLL_SAME_FILE = 1 << 12,

I hope we don't add this flag, but it needs to be rejected in
internal_get_user_pages_fast()

Jason

\
 
 \ /
  Last update: 2023-04-17 15:17    [W:0.139 / U:0.748 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site