[PATCH v19 1/8] mmap: make mlock_future_check() global

David Hildenbrand david at redhat.com
Fri May 14 01:27:51 PDT 2021


On 13.05.21 20:47, Mike Rapoport wrote:
> From: Mike Rapoport <rppt at linux.ibm.com>
> 
> It will be used by the upcoming secret memory implementation.
> 
> Signed-off-by: Mike Rapoport <rppt at linux.ibm.com>
> Cc: Alexander Viro <viro at zeniv.linux.org.uk>
> Cc: Andy Lutomirski <luto at kernel.org>
> Cc: Arnd Bergmann <arnd at arndb.de>
> Cc: Borislav Petkov <bp at alien8.de>
> Cc: Catalin Marinas <catalin.marinas at arm.com>
> Cc: Christopher Lameter <cl at linux.com>
> Cc: Dan Williams <dan.j.williams at intel.com>
> Cc: Dave Hansen <dave.hansen at linux.intel.com>
> Cc: David Hildenbrand <david at redhat.com>
> Cc: Elena Reshetova <elena.reshetova at intel.com>
> Cc: Hagen Paul Pfeifer <hagen at jauu.net>
> Cc: "H. Peter Anvin" <hpa at zytor.com>
> Cc: Ingo Molnar <mingo at redhat.com>
> Cc: James Bottomley <jejb at linux.ibm.com>
> Cc: "Kirill A. Shutemov" <kirill at shutemov.name>
> Cc: Mark Rutland <mark.rutland at arm.com>
> Cc: Matthew Wilcox <willy at infradead.org>
> Cc: Michael Kerrisk <mtk.manpages at gmail.com>
> Cc: Palmer Dabbelt <palmer at dabbelt.com>
> Cc: Palmer Dabbelt <palmerdabbelt at google.com>
> Cc: Paul Walmsley <paul.walmsley at sifive.com>
> Cc: Peter Zijlstra <peterz at infradead.org>
> Cc: Rick Edgecombe <rick.p.edgecombe at intel.com>
> Cc: Roman Gushchin <guro at fb.com>
> Cc: Shakeel Butt <shakeelb at google.com>
> Cc: Shuah Khan <shuah at kernel.org>
> Cc: Thomas Gleixner <tglx at linutronix.de>
> Cc: Tycho Andersen <tycho at tycho.ws>
> Cc: Will Deacon <will at kernel.org>
> ---
>   mm/internal.h | 3 +++
>   mm/mmap.c     | 5 ++---
>   2 files changed, 5 insertions(+), 3 deletions(-)
> 
> diff --git a/mm/internal.h b/mm/internal.h
> index 54bd0dc2c23c..46eb82eaa195 100644
> --- a/mm/internal.h
> +++ b/mm/internal.h
> @@ -373,6 +373,9 @@ static inline void munlock_vma_pages_all(struct vm_area_struct *vma)
>   extern void mlock_vma_page(struct page *page);
>   extern unsigned int munlock_vma_page(struct page *page);
>   
> +extern int mlock_future_check(struct mm_struct *mm, unsigned long flags,
> +			      unsigned long len);
> +
>   /*
>    * Clear the page's PageMlocked().  This can be useful in a situation where
>    * we want to unconditionally remove a page from the pagecache -- e.g.,
> diff --git a/mm/mmap.c b/mm/mmap.c
> index 0584e540246e..81f5595a8490 100644
> --- a/mm/mmap.c
> +++ b/mm/mmap.c
> @@ -1352,9 +1352,8 @@ static inline unsigned long round_hint_to_min(unsigned long hint)
>   	return hint;
>   }
>   
> -static inline int mlock_future_check(struct mm_struct *mm,
> -				     unsigned long flags,
> -				     unsigned long len)
> +int mlock_future_check(struct mm_struct *mm, unsigned long flags,
> +		       unsigned long len)
>   {
>   	unsigned long locked, lock_limit;
>   
> 

Reviewed-by: David Hildenbrand <david at redhat.com>

-- 
Thanks,

David / dhildenb




More information about the linux-riscv mailing list