linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm/damon/vaddr: Include 'highmem.h' to fix a build failure
@ 2021-10-14 11:08 SeongJae Park
  2021-10-14 21:34 ` Randy Dunlap
  2021-10-15  8:25 ` Stephen Rothwell
  0 siblings, 2 replies; 3+ messages in thread
From: SeongJae Park @ 2021-10-14 11:08 UTC (permalink / raw)
  To: akpm
  Cc: rdunlap, broonie, linux-next, mhocko, sfr, linux-mm,
	linux-fsdevel, linux-kernel, SeongJae Park

Commit 0ff28922686c ("mm/damon/vaddr: separate commonly usable
functions") in -mm tree[1] moves include of 'highmem.h' from 'vaddr.c'
to 'prmtv-common.c', though the code for the header is still in
'vaddr.c'.  As a result, build with 'CONFIG_HIGHPTE' fails as below:

    In file included from ../include/linux/mm.h:33:0,
                      from ../include/linux/kallsyms.h:13,
                      from ../include/linux/bpf.h:20,
                      from ../include/linux/bpf-cgroup.h:5,
                      from ../include/linux/cgroup-defs.h:22,
                      from ../include/linux/cgroup.h:28,
                      from ../include/linux/hugetlb.h:9,
                      from ../mm/damon/vaddr.c:11:
    ../mm/damon/vaddr.c: In function ‘damon_mkold_pmd_entry’:
    ../include/linux/pgtable.h:97:12: error: implicit declaration of function ‘kmap_atomic’; did you mean ‘mcopy_atomic’? [-Werror=implicit-function-declaration]
       ((pte_t *)kmap_atomic(pmd_page(*(dir))) +  \
                 ^
    ../include/linux/mm.h:2376:17: note: in expansion of macro ‘pte_offset_map’
       pte_t *__pte = pte_offset_map(pmd, address); \
                      ^~~~~~~~~~~~~~
    ../mm/damon/vaddr.c:387:8: note: in expansion of macro ‘pte_offset_map_lock’
       pte = pte_offset_map_lock(walk->mm, pmd, addr, &ptl);
             ^~~~~~~~~~~~~~~~~~~
    ../include/linux/pgtable.h:99:24: error: implicit declaration of function ‘kunmap_atomic’; did you mean ‘in_atomic’? [-Werror=implicit-function-declaration]
      #define pte_unmap(pte) kunmap_atomic((pte))
                             ^
    ../include/linux/mm.h:2384:2: note: in expansion of macro ‘pte_unmap’
       pte_unmap(pte);     \
       ^~~~~~~~~
    ../mm/damon/vaddr.c:392:2: note: in expansion of macro ‘pte_unmap_unlock’
       pte_unmap_unlock(pte, ptl);
       ^~~~~~~~~~~~~~~~

This commit fixes the issue by moving the include back to 'vaddr.c'.

[1] https://github.com/hnaz/linux-mm/commit/0ff28922686c

Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: SeongJae Park <sj@kernel.org>
---
 mm/damon/prmtv-common.c | 1 -
 mm/damon/vaddr.c        | 1 +
 2 files changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/damon/prmtv-common.c b/mm/damon/prmtv-common.c
index 1768cbe1b9ff..7e62ee54fb54 100644
--- a/mm/damon/prmtv-common.c
+++ b/mm/damon/prmtv-common.c
@@ -5,7 +5,6 @@
  * Author: SeongJae Park <sj@kernel.org>
  */
 
-#include <linux/highmem.h>
 #include <linux/mmu_notifier.h>
 #include <linux/page_idle.h>
 #include <linux/pagemap.h>
diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
index ce7e36ca1bff..758501b8d97d 100644
--- a/mm/damon/vaddr.c
+++ b/mm/damon/vaddr.c
@@ -8,6 +8,7 @@
 #define pr_fmt(fmt) "damon-va: " fmt
 
 #include <asm-generic/mman-common.h>
+#include <linux/highmem.h>
 #include <linux/hugetlb.h>
 #include <linux/mmu_notifier.h>
 #include <linux/page_idle.h>
-- 
2.17.1



^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm/damon/vaddr: Include 'highmem.h' to fix a build failure
  2021-10-14 11:08 [PATCH] mm/damon/vaddr: Include 'highmem.h' to fix a build failure SeongJae Park
@ 2021-10-14 21:34 ` Randy Dunlap
  2021-10-15  8:25 ` Stephen Rothwell
  1 sibling, 0 replies; 3+ messages in thread
From: Randy Dunlap @ 2021-10-14 21:34 UTC (permalink / raw)
  To: SeongJae Park, akpm
  Cc: broonie, linux-next, mhocko, sfr, linux-mm, linux-fsdevel, linux-kernel

On 10/14/21 4:08 AM, SeongJae Park wrote:
> Commit 0ff28922686c ("mm/damon/vaddr: separate commonly usable
> functions") in -mm tree[1] moves include of 'highmem.h' from 'vaddr.c'
> to 'prmtv-common.c', though the code for the header is still in
> 'vaddr.c'.  As a result, build with 'CONFIG_HIGHPTE' fails as below:
> 
>      In file included from ../include/linux/mm.h:33:0,
>                        from ../include/linux/kallsyms.h:13,
>                        from ../include/linux/bpf.h:20,
>                        from ../include/linux/bpf-cgroup.h:5,
>                        from ../include/linux/cgroup-defs.h:22,
>                        from ../include/linux/cgroup.h:28,
>                        from ../include/linux/hugetlb.h:9,
>                        from ../mm/damon/vaddr.c:11:
>      ../mm/damon/vaddr.c: In function ‘damon_mkold_pmd_entry’:
>      ../include/linux/pgtable.h:97:12: error: implicit declaration of function ‘kmap_atomic’; did you mean ‘mcopy_atomic’? [-Werror=implicit-function-declaration]
>         ((pte_t *)kmap_atomic(pmd_page(*(dir))) +  \
>                   ^
>      ../include/linux/mm.h:2376:17: note: in expansion of macro ‘pte_offset_map’
>         pte_t *__pte = pte_offset_map(pmd, address); \
>                        ^~~~~~~~~~~~~~
>      ../mm/damon/vaddr.c:387:8: note: in expansion of macro ‘pte_offset_map_lock’
>         pte = pte_offset_map_lock(walk->mm, pmd, addr, &ptl);
>               ^~~~~~~~~~~~~~~~~~~
>      ../include/linux/pgtable.h:99:24: error: implicit declaration of function ‘kunmap_atomic’; did you mean ‘in_atomic’? [-Werror=implicit-function-declaration]
>        #define pte_unmap(pte) kunmap_atomic((pte))
>                               ^
>      ../include/linux/mm.h:2384:2: note: in expansion of macro ‘pte_unmap’
>         pte_unmap(pte);     \
>         ^~~~~~~~~
>      ../mm/damon/vaddr.c:392:2: note: in expansion of macro ‘pte_unmap_unlock’
>         pte_unmap_unlock(pte, ptl);
>         ^~~~~~~~~~~~~~~~
> 
> This commit fixes the issue by moving the include back to 'vaddr.c'.
> 
> [1] https://github.com/hnaz/linux-mm/commit/0ff28922686c
> 
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: SeongJae Park <sj@kernel.org>

Acked-by: Randy Dunlap <rdunlap@infradead.org> # build-tested

Thanks.

> ---
>   mm/damon/prmtv-common.c | 1 -
>   mm/damon/vaddr.c        | 1 +
>   2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/damon/prmtv-common.c b/mm/damon/prmtv-common.c
> index 1768cbe1b9ff..7e62ee54fb54 100644
> --- a/mm/damon/prmtv-common.c
> +++ b/mm/damon/prmtv-common.c
> @@ -5,7 +5,6 @@
>    * Author: SeongJae Park <sj@kernel.org>
>    */
>   
> -#include <linux/highmem.h>
>   #include <linux/mmu_notifier.h>
>   #include <linux/page_idle.h>
>   #include <linux/pagemap.h>
> diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
> index ce7e36ca1bff..758501b8d97d 100644
> --- a/mm/damon/vaddr.c
> +++ b/mm/damon/vaddr.c
> @@ -8,6 +8,7 @@
>   #define pr_fmt(fmt) "damon-va: " fmt
>   
>   #include <asm-generic/mman-common.h>
> +#include <linux/highmem.h>
>   #include <linux/hugetlb.h>
>   #include <linux/mmu_notifier.h>
>   #include <linux/page_idle.h>
> 


-- 
~Randy


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] mm/damon/vaddr: Include 'highmem.h' to fix a build failure
  2021-10-14 11:08 [PATCH] mm/damon/vaddr: Include 'highmem.h' to fix a build failure SeongJae Park
  2021-10-14 21:34 ` Randy Dunlap
@ 2021-10-15  8:25 ` Stephen Rothwell
  1 sibling, 0 replies; 3+ messages in thread
From: Stephen Rothwell @ 2021-10-15  8:25 UTC (permalink / raw)
  To: SeongJae Park
  Cc: akpm, rdunlap, broonie, linux-next, mhocko, linux-mm,
	linux-fsdevel, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 3310 bytes --]

Hi all,

On Thu, 14 Oct 2021 11:08:48 +0000 SeongJae Park <sj@kernel.org> wrote:
>
> Commit 0ff28922686c ("mm/damon/vaddr: separate commonly usable
> functions") in -mm tree[1] moves include of 'highmem.h' from 'vaddr.c'
> to 'prmtv-common.c', though the code for the header is still in
> 'vaddr.c'.  As a result, build with 'CONFIG_HIGHPTE' fails as below:
> 
>     In file included from ../include/linux/mm.h:33:0,
>                       from ../include/linux/kallsyms.h:13,
>                       from ../include/linux/bpf.h:20,
>                       from ../include/linux/bpf-cgroup.h:5,
>                       from ../include/linux/cgroup-defs.h:22,
>                       from ../include/linux/cgroup.h:28,
>                       from ../include/linux/hugetlb.h:9,
>                       from ../mm/damon/vaddr.c:11:
>     ../mm/damon/vaddr.c: In function ‘damon_mkold_pmd_entry’:
>     ../include/linux/pgtable.h:97:12: error: implicit declaration of function ‘kmap_atomic’; did you mean ‘mcopy_atomic’? [-Werror=implicit-function-declaration]
>        ((pte_t *)kmap_atomic(pmd_page(*(dir))) +  \
>                  ^
>     ../include/linux/mm.h:2376:17: note: in expansion of macro ‘pte_offset_map’
>        pte_t *__pte = pte_offset_map(pmd, address); \
>                       ^~~~~~~~~~~~~~
>     ../mm/damon/vaddr.c:387:8: note: in expansion of macro ‘pte_offset_map_lock’
>        pte = pte_offset_map_lock(walk->mm, pmd, addr, &ptl);
>              ^~~~~~~~~~~~~~~~~~~
>     ../include/linux/pgtable.h:99:24: error: implicit declaration of function ‘kunmap_atomic’; did you mean ‘in_atomic’? [-Werror=implicit-function-declaration]
>       #define pte_unmap(pte) kunmap_atomic((pte))
>                              ^
>     ../include/linux/mm.h:2384:2: note: in expansion of macro ‘pte_unmap’
>        pte_unmap(pte);     \
>        ^~~~~~~~~
>     ../mm/damon/vaddr.c:392:2: note: in expansion of macro ‘pte_unmap_unlock’
>        pte_unmap_unlock(pte, ptl);
>        ^~~~~~~~~~~~~~~~
> 
> This commit fixes the issue by moving the include back to 'vaddr.c'.
> 
> [1] https://github.com/hnaz/linux-mm/commit/0ff28922686c
> 
> Reported-by: Randy Dunlap <rdunlap@infradead.org>
> Signed-off-by: SeongJae Park <sj@kernel.org>
> ---
>  mm/damon/prmtv-common.c | 1 -
>  mm/damon/vaddr.c        | 1 +
>  2 files changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/damon/prmtv-common.c b/mm/damon/prmtv-common.c
> index 1768cbe1b9ff..7e62ee54fb54 100644
> --- a/mm/damon/prmtv-common.c
> +++ b/mm/damon/prmtv-common.c
> @@ -5,7 +5,6 @@
>   * Author: SeongJae Park <sj@kernel.org>
>   */
>  
> -#include <linux/highmem.h>
>  #include <linux/mmu_notifier.h>
>  #include <linux/page_idle.h>
>  #include <linux/pagemap.h>
> diff --git a/mm/damon/vaddr.c b/mm/damon/vaddr.c
> index ce7e36ca1bff..758501b8d97d 100644
> --- a/mm/damon/vaddr.c
> +++ b/mm/damon/vaddr.c
> @@ -8,6 +8,7 @@
>  #define pr_fmt(fmt) "damon-va: " fmt
>  
>  #include <asm-generic/mman-common.h>
> +#include <linux/highmem.h>
>  #include <linux/hugetlb.h>
>  #include <linux/mmu_notifier.h>
>  #include <linux/page_idle.h>
> -- 
> 2.17.1
> 

Applied to linux-next today.

-- 
Cheers,
Stephen Rothwell

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2021-10-15  8:25 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-14 11:08 [PATCH] mm/damon/vaddr: Include 'highmem.h' to fix a build failure SeongJae Park
2021-10-14 21:34 ` Randy Dunlap
2021-10-15  8:25 ` Stephen Rothwell

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).