Re: linux-next: build failure after merge of the mm tree

From: Andrew Morton
Date: Sun Mar 05 2023 - 22:13:41 EST


On Mon, 6 Mar 2023 13:54:47 +1100 Stephen Rothwell <sfr@xxxxxxxxxxxxxxxx> wrote:

> Hi all,
>
> After merging the mm tree, today's linux-next build (various) failed
> like this:
>
> mm/khugepaged.c:1702:9: error: implicit declaration of function ‘vma_try_start_write’; did you mean ‘vma_start_write’? [-Werror=implicit-function-declaration]
>
> Caused by commit
>
> 92e3612279f9 ("mm/khugepaged: fix vm_lock/i_mmap_rwsem inversion in retract_page_tables")
>
> The definition of vma_try_start_write() is protected by
> CONFIG_PER_VMA_LOCK, but its use is not.

Thanks. Suren has a fix, but I haven't pushed it out yet :(


From: Suren Baghdasaryan <surenb@xxxxxxxxxx>
Subject: txt-mm-khugepaged-write-lock-vma-while-collapsing-a-huge-page-fix-fix
Date: Sat, 4 Mar 2023 15:24:15 -0800

I missed vma_try_start_write() definition for CONFIG_PER_VMA_LOCK=n
configuration.

Link: https://lkml.kernel.org/r/CAJuCfpFjWhtzRE1X=J+_JjgJzNKhq-=JT8yTBSTHthwp0pqWZw@xxxxxxxxxxxxxx
Signed-off-by: Suren Baghdasaryan <surenb@xxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---


--- a/include/linux/mm.h~mm-khugepaged-write-lock-vma-while-collapsing-a-huge-page-fix-fix
+++ a/include/linux/mm.h
@@ -717,6 +717,8 @@ static inline bool vma_start_read(struct
{ return false; }
static inline void vma_end_read(struct vm_area_struct *vma) {}
static inline void vma_start_write(struct vm_area_struct *vma) {}
+static inline bool vma_try_start_write(struct vm_area_struct *vma)
+ { return true; }
static inline void vma_assert_write_locked(struct vm_area_struct *vma) {}

#endif /* CONFIG_PER_VMA_LOCK */
_