public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] ppc64 need HPAGE_SHIFT when huge pages disabled
@ 2005-11-17 17:00 Andy Whitcroft
  2005-11-17 21:11 ` Andrew Morton
  0 siblings, 1 reply; 2+ messages in thread
From: Andy Whitcroft @ 2005-11-17 17:00 UTC (permalink / raw)
  To: Paul Mackerras, Anton Blanchard
  Cc: linuxppc64-dev, linux-kernel, Andy Whitcroft

With the new powerpc architecture we don't seem to be able to disable
huge pages anymore.

    mm/built-in.o(.toc1+0xae0): undefined reference to `HPAGE_SHIFT'
    make: *** [.tmp_vmlinux1] Error 1

We seem to need to define HPAGE_SHIFT to something when HUGETLB_PAGE isn't
defined.  This patch defines it to 0 when we have no support.

How does this look?  Against 2.6.15-rc1-mm1.

Signed-off-by: Andy Whitcroft <apw@shadowen.org>
---
diff -upN reference/include/asm-powerpc/page_64.h current/include/asm-powerpc/page_64.h
--- reference/include/asm-powerpc/page_64.h
+++ current/include/asm-powerpc/page_64.h
@@ -86,7 +86,11 @@ static inline void copy_page(void *to, v
 extern u64 ppc64_pft_size;
 
 /* Large pages size */
+#ifdef CONFIG_HUGETLB_PAGE
 extern unsigned int HPAGE_SHIFT;
+#else
+#define HPAGE_SHIFT 0
+#endif
 #define HPAGE_SIZE		((1UL) << HPAGE_SHIFT)
 #define HPAGE_MASK		(~(HPAGE_SIZE - 1))
 #define HUGETLB_PAGE_ORDER	(HPAGE_SHIFT - PAGE_SHIFT)

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

* Re: [PATCH] ppc64 need HPAGE_SHIFT when huge pages disabled
  2005-11-17 17:00 [PATCH] ppc64 need HPAGE_SHIFT when huge pages disabled Andy Whitcroft
@ 2005-11-17 21:11 ` Andrew Morton
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Morton @ 2005-11-17 21:11 UTC (permalink / raw)
  To: Andy Whitcroft; +Cc: paulus, anton, linuxppc64-dev, linux-kernel, apw

Andy Whitcroft <apw@shadowen.org> wrote:
>
> With the new powerpc architecture we don't seem to be able to disable
> huge pages anymore.
> 
>     mm/built-in.o(.toc1+0xae0): undefined reference to `HPAGE_SHIFT'
>     make: *** [.tmp_vmlinux1] Error 1
> 
> We seem to need to define HPAGE_SHIFT to something when HUGETLB_PAGE isn't
> defined.  This patch defines it to 0 when we have no support.
> 

Yes, i386 defines HPAGE_SHIFT always.

> 
> Signed-off-by: Andy Whitcroft <apw@shadowen.org>
> ---
> diff -upN reference/include/asm-powerpc/page_64.h current/include/asm-powerpc/page_64.h
> --- reference/include/asm-powerpc/page_64.h
> +++ current/include/asm-powerpc/page_64.h
> @@ -86,7 +86,11 @@ static inline void copy_page(void *to, v
>  extern u64 ppc64_pft_size;
>  
>  /* Large pages size */
> +#ifdef CONFIG_HUGETLB_PAGE
>  extern unsigned int HPAGE_SHIFT;
> +#else
> +#define HPAGE_SHIFT 0
> +#endif
>  #define HPAGE_SIZE		((1UL) << HPAGE_SHIFT)
>  #define HPAGE_MASK		(~(HPAGE_SIZE - 1))
>  #define HUGETLB_PAGE_ORDER	(HPAGE_SHIFT - PAGE_SHIFT)

I think this change will cause a compile warning in mm/memory.c:

			if (unlikely(is_vm_hugetlb_page(vma))) {
				unmap_hugepage_range(vma, start, end);
				zap_work -= (end - start) /
						(HPAGE_SIZE / PAGE_SIZE);

This code will be removed by the compiler.  But before that happens, we're
doing a divide by zero and the compiler will whine.

So I'd suggest that you set the !CONFIG_HUGETLB_PAGE value of HPAGE_SHIFT
to PAGE_SHIFT, not to zero.  I'll make that change locally..

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

end of thread, other threads:[~2005-11-17 21:11 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-11-17 17:00 [PATCH] ppc64 need HPAGE_SHIFT when huge pages disabled Andy Whitcroft
2005-11-17 21:11 ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox