linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mm, gup: fix typo in gup_p4d_range()
@ 2017-03-13  5:22 Kirill A. Shutemov
  2017-03-13  8:44 ` Michal Hocko
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Kirill A. Shutemov @ 2017-03-13  5:22 UTC (permalink / raw)
  To: Linus Torvalds, Andrew Morton
  Cc: Michal Hocko, linux-arch, linux-mm, linux-kernel, Kirill A. Shutemov

gup_p4d_range() should call gup_pud_range(), not itself.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
Reported-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
Fixes: c2febafc6773 ("mm: convert generic code to 5-level paging")
---
 mm/gup.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/gup.c b/mm/gup.c
index c74bad1bf6e8..04aa405350dc 100644
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -1455,7 +1455,7 @@ static int gup_p4d_range(pgd_t pgd, unsigned long addr, unsigned long end,
 			if (!gup_huge_pd(__hugepd(p4d_val(p4d)), addr,
 					 P4D_SHIFT, next, write, pages, nr))
 				return 0;
-		} else if (!gup_p4d_range(p4d, addr, next, write, pages, nr))
+		} else if (!gup_pud_range(p4d, addr, next, write, pages, nr))
 			return 0;
 	} while (p4dp++, addr = next, addr != end);
 
-- 
2.11.0

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

* Re: [PATCH] mm, gup: fix typo in gup_p4d_range()
  2017-03-13  5:22 [PATCH] mm, gup: fix typo in gup_p4d_range() Kirill A. Shutemov
@ 2017-03-13  8:44 ` Michal Hocko
  2017-03-13 14:16 ` Mark Rutland
                   ` (2 subsequent siblings)
  3 siblings, 0 replies; 5+ messages in thread
From: Michal Hocko @ 2017-03-13  8:44 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Linus Torvalds, Andrew Morton, linux-arch, linux-mm, linux-kernel

On Mon 13-03-17 08:22:13, Kirill A. Shutemov wrote:
> gup_p4d_range() should call gup_pud_range(), not itself.
> 
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Reported-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> Fixes: c2febafc6773 ("mm: convert generic code to 5-level paging")

Upps, missed this one during the review. Thanks for catching that up

Acked-by: Michal Hocko <mhocko@suse.com>

> ---
>  mm/gup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/gup.c b/mm/gup.c
> index c74bad1bf6e8..04aa405350dc 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -1455,7 +1455,7 @@ static int gup_p4d_range(pgd_t pgd, unsigned long addr, unsigned long end,
>  			if (!gup_huge_pd(__hugepd(p4d_val(p4d)), addr,
>  					 P4D_SHIFT, next, write, pages, nr))
>  				return 0;
> -		} else if (!gup_p4d_range(p4d, addr, next, write, pages, nr))
> +		} else if (!gup_pud_range(p4d, addr, next, write, pages, nr))
>  			return 0;
>  	} while (p4dp++, addr = next, addr != end);
>  
> -- 
> 2.11.0
> 

-- 
Michal Hocko
SUSE Labs

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

* Re: [PATCH] mm, gup: fix typo in gup_p4d_range()
  2017-03-13  5:22 [PATCH] mm, gup: fix typo in gup_p4d_range() Kirill A. Shutemov
  2017-03-13  8:44 ` Michal Hocko
@ 2017-03-13 14:16 ` Mark Rutland
  2017-03-13 20:55 ` Chris Packham
  2017-03-14 18:36 ` Geert Uytterhoeven
  3 siblings, 0 replies; 5+ messages in thread
From: Mark Rutland @ 2017-03-13 14:16 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Linus Torvalds, Andrew Morton, Michal Hocko, linux-arch,
	linux-mm, linux-kernel

On Mon, Mar 13, 2017 at 08:22:13AM +0300, Kirill A. Shutemov wrote:
> gup_p4d_range() should call gup_pud_range(), not itself.
> 
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Reported-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> Fixes: c2febafc6773 ("mm: convert generic code to 5-level paging")
> ---
>  mm/gup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/mm/gup.c b/mm/gup.c
> index c74bad1bf6e8..04aa405350dc 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -1455,7 +1455,7 @@ static int gup_p4d_range(pgd_t pgd, unsigned long addr, unsigned long end,
>  			if (!gup_huge_pd(__hugepd(p4d_val(p4d)), addr,
>  					 P4D_SHIFT, next, write, pages, nr))
>  				return 0;
> -		} else if (!gup_p4d_range(p4d, addr, next, write, pages, nr))
> +		} else if (!gup_pud_range(p4d, addr, next, write, pages, nr))
>  			return 0;
>  	} while (p4dp++, addr = next, addr != end);

I just hit this on arm64, where the compiler was nice enough to warn me
that something was amiss:

mm/gup.c:1412:12: warning: 'gup_pud_range' defined but not used [-Wunused-function]
 static int gup_pud_range(p4d_t p4d, unsigned long addr, unsigned long end,
            ^

FWIW:

Acked-by: Mark Rutland <mark.rutland@arm.com>

Mark.

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

* Re: [PATCH] mm, gup: fix typo in gup_p4d_range()
  2017-03-13  5:22 [PATCH] mm, gup: fix typo in gup_p4d_range() Kirill A. Shutemov
  2017-03-13  8:44 ` Michal Hocko
  2017-03-13 14:16 ` Mark Rutland
@ 2017-03-13 20:55 ` Chris Packham
  2017-03-14 18:36 ` Geert Uytterhoeven
  3 siblings, 0 replies; 5+ messages in thread
From: Chris Packham @ 2017-03-13 20:55 UTC (permalink / raw)
  To: Kirill A. Shutemov, Linus Torvalds, Andrew Morton
  Cc: Michal Hocko, linux-arch, linux-mm, linux-kernel

On 13/03/17 18:22, Kirill A. Shutemov wrote:
> gup_p4d_range() should call gup_pud_range(), not itself.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Reported-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> Fixes: c2febafc6773 ("mm: convert generic code to 5-level paging")
> ---
>  mm/gup.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/gup.c b/mm/gup.c
> index c74bad1bf6e8..04aa405350dc 100644
> --- a/mm/gup.c
> +++ b/mm/gup.c
> @@ -1455,7 +1455,7 @@ static int gup_p4d_range(pgd_t pgd, unsigned long addr, unsigned long end,
>  			if (!gup_huge_pd(__hugepd(p4d_val(p4d)), addr,
>  					 P4D_SHIFT, next, write, pages, nr))
>  				return 0;
> -		} else if (!gup_p4d_range(p4d, addr, next, write, pages, nr))
> +		} else if (!gup_pud_range(p4d, addr, next, write, pages, nr))
>  			return 0;
>  	} while (p4dp++, addr = next, addr != end);

Fixes the build issue for me. Thanks.

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

* Re: [PATCH] mm, gup: fix typo in gup_p4d_range()
  2017-03-13  5:22 [PATCH] mm, gup: fix typo in gup_p4d_range() Kirill A. Shutemov
                   ` (2 preceding siblings ...)
  2017-03-13 20:55 ` Chris Packham
@ 2017-03-14 18:36 ` Geert Uytterhoeven
  3 siblings, 0 replies; 5+ messages in thread
From: Geert Uytterhoeven @ 2017-03-14 18:36 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Linus Torvalds, Andrew Morton, Michal Hocko, Linux-Arch,
	Linux MM, linux-kernel, Linux-Renesas, Simon Horman

Hi Kirill,

On Mon, Mar 13, 2017 at 6:22 AM, Kirill A. Shutemov
<kirill.shutemov@linux.intel.com> wrote:
> gup_p4d_range() should call gup_pud_range(), not itself.
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
> Reported-by: Chris Packham <chris.packham@alliedtelesis.co.nz>
> Fixes: c2febafc6773 ("mm: convert generic code to 5-level paging")

FTR, this (now commit ce70df089143c493) fixes the strange crashes I saw
with plain v4.11-rc2 and renesas-devel-20170313-v4.11-rc2 during shutdown on
Renesas R-Car Gen2 (arm) and R-Car Gen3 (arm64) (but not on older
SH/R-Mobile), and that I bisected to commit c2febafc6773.

Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert

--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

end of thread, other threads:[~2017-03-14 18:37 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-03-13  5:22 [PATCH] mm, gup: fix typo in gup_p4d_range() Kirill A. Shutemov
2017-03-13  8:44 ` Michal Hocko
2017-03-13 14:16 ` Mark Rutland
2017-03-13 20:55 ` Chris Packham
2017-03-14 18:36 ` Geert Uytterhoeven

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).