All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] thp: define HPAGE_PMD_* constans as BUILD_BUG() if !THP
@ 2013-06-17 22:05 ` Kirill A. Shutemov
  0 siblings, 0 replies; 8+ messages in thread
From: Kirill A. Shutemov @ 2013-06-17 22:05 UTC (permalink / raw)
  To: Andrew Morton, Aneesh Kumar K.V
  Cc: Andrea Arcangeli, linux-kernel, linux-mm, Kirill A. Shutemov

From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>

Currently, HPAGE_PMD_* constans rely on PMD_SHIFT regardless of
CONFIG_TRANSPARENT_HUGEPAGE. PMD_SHIFT is not defined everywhere (e.g.
arm nommu case).

It means we can't use anything like this in generic code:

        if (PageTransHuge(page))
                zero_huge_user(page, 0, HPAGE_PMD_SIZE);
        else
                clear_highpage(page);

For !THP case, PageTransHuge() is 0 and compiler can eliminate
zero_huge_user() call. But it still need to be valid C expression, means
HPAGE_PMD_SIZE has to expand to something compiler can understand.

Previously, HPAGE_PMD_* were defined to BUILD_BUG() for !THP. Let's come
back to it.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
 include/linux/huge_mm.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index cc276d2..e2dbefb 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -58,11 +58,12 @@ extern pmd_t *page_check_address_pmd(struct page *page,
 
 #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
 #define HPAGE_PMD_NR (1<<HPAGE_PMD_ORDER)
+
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 #define HPAGE_PMD_SHIFT PMD_SHIFT
 #define HPAGE_PMD_SIZE	((1UL) << HPAGE_PMD_SHIFT)
 #define HPAGE_PMD_MASK	(~(HPAGE_PMD_SIZE - 1))
 
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 extern bool is_vma_temporary_stack(struct vm_area_struct *vma);
 
 #define transparent_hugepage_enabled(__vma)				\
@@ -180,6 +181,9 @@ extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vm
 				unsigned long addr, pmd_t pmd, pmd_t *pmdp);
 
 #else /* CONFIG_TRANSPARENT_HUGEPAGE */
+#define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
+#define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; })
+#define HPAGE_PMD_SIZE ({ BUILD_BUG(); 0; })
 
 #define hpage_nr_pages(x) 1
 
-- 
1.8.3.1


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

* [PATCH] thp: define HPAGE_PMD_* constans as BUILD_BUG() if !THP
@ 2013-06-17 22:05 ` Kirill A. Shutemov
  0 siblings, 0 replies; 8+ messages in thread
From: Kirill A. Shutemov @ 2013-06-17 22:05 UTC (permalink / raw)
  To: Andrew Morton, Aneesh Kumar K.V
  Cc: Andrea Arcangeli, linux-kernel, linux-mm, Kirill A. Shutemov

From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>

Currently, HPAGE_PMD_* constans rely on PMD_SHIFT regardless of
CONFIG_TRANSPARENT_HUGEPAGE. PMD_SHIFT is not defined everywhere (e.g.
arm nommu case).

It means we can't use anything like this in generic code:

        if (PageTransHuge(page))
                zero_huge_user(page, 0, HPAGE_PMD_SIZE);
        else
                clear_highpage(page);

For !THP case, PageTransHuge() is 0 and compiler can eliminate
zero_huge_user() call. But it still need to be valid C expression, means
HPAGE_PMD_SIZE has to expand to something compiler can understand.

Previously, HPAGE_PMD_* were defined to BUILD_BUG() for !THP. Let's come
back to it.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@linux.intel.com>
---
 include/linux/huge_mm.h | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/include/linux/huge_mm.h b/include/linux/huge_mm.h
index cc276d2..e2dbefb 100644
--- a/include/linux/huge_mm.h
+++ b/include/linux/huge_mm.h
@@ -58,11 +58,12 @@ extern pmd_t *page_check_address_pmd(struct page *page,
 
 #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
 #define HPAGE_PMD_NR (1<<HPAGE_PMD_ORDER)
+
+#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 #define HPAGE_PMD_SHIFT PMD_SHIFT
 #define HPAGE_PMD_SIZE	((1UL) << HPAGE_PMD_SHIFT)
 #define HPAGE_PMD_MASK	(~(HPAGE_PMD_SIZE - 1))
 
-#ifdef CONFIG_TRANSPARENT_HUGEPAGE
 extern bool is_vma_temporary_stack(struct vm_area_struct *vma);
 
 #define transparent_hugepage_enabled(__vma)				\
@@ -180,6 +181,9 @@ extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vm
 				unsigned long addr, pmd_t pmd, pmd_t *pmdp);
 
 #else /* CONFIG_TRANSPARENT_HUGEPAGE */
+#define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
+#define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; })
+#define HPAGE_PMD_SIZE ({ BUILD_BUG(); 0; })
 
 #define hpage_nr_pages(x) 1
 
-- 
1.8.3.1

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] thp: define HPAGE_PMD_* constans as BUILD_BUG() if !THP
  2013-06-17 22:05 ` Kirill A. Shutemov
@ 2013-06-17 22:14   ` Andrew Morton
  -1 siblings, 0 replies; 8+ messages in thread
From: Andrew Morton @ 2013-06-17 22:14 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Aneesh Kumar K.V, Andrea Arcangeli, linux-kernel, linux-mm

On Tue, 18 Jun 2013 01:05:40 +0300 "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote:

> From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> 
> Currently, HPAGE_PMD_* constans rely on PMD_SHIFT regardless of
> CONFIG_TRANSPARENT_HUGEPAGE. PMD_SHIFT is not defined everywhere (e.g.
> arm nommu case).
> 
> It means we can't use anything like this in generic code:
> 
>         if (PageTransHuge(page))
>                 zero_huge_user(page, 0, HPAGE_PMD_SIZE);
>         else
>                 clear_highpage(page);
> 
> For !THP case, PageTransHuge() is 0 and compiler can eliminate
> zero_huge_user() call. But it still need to be valid C expression, means
> HPAGE_PMD_SIZE has to expand to something compiler can understand.
> 
> Previously, HPAGE_PMD_* were defined to BUILD_BUG() for !THP. Let's come
> back to it.
> 
> ...
>
> --- a/include/linux/huge_mm.h
> +++ b/include/linux/huge_mm.h
> @@ -58,11 +58,12 @@ extern pmd_t *page_check_address_pmd(struct page *page,
>  
>  #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
>  #define HPAGE_PMD_NR (1<<HPAGE_PMD_ORDER)
> +
> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>  #define HPAGE_PMD_SHIFT PMD_SHIFT
>  #define HPAGE_PMD_SIZE	((1UL) << HPAGE_PMD_SHIFT)
>  #define HPAGE_PMD_MASK	(~(HPAGE_PMD_SIZE - 1))
>  
> -#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>  extern bool is_vma_temporary_stack(struct vm_area_struct *vma);
>  
>  #define transparent_hugepage_enabled(__vma)				\
> @@ -180,6 +181,9 @@ extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vm
>  				unsigned long addr, pmd_t pmd, pmd_t *pmdp);
>  
>  #else /* CONFIG_TRANSPARENT_HUGEPAGE */
> +#define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
> +#define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; })
> +#define HPAGE_PMD_SIZE ({ BUILD_BUG(); 0; })
>  

We've done this sort of thing before and it blew up.  We do want to be
able to use things like HPAGE_PMD_foo in global-var initialisers and
definitions, but the problem is that BUILD_BUG() can't be used outside
functions.  For example,

--- a/fs/open.c
+++ b/fs/open.c
@@ -34,6 +34,11 @@
 
 #include "internal.h"
 
+#define FOOB ({ BUILD_BUG(); 0; })
+
+int x = FOOB;
+int y[FOOB];
+
 int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
 	struct file *filp)
 {

fs/open.c:39: error: braced-group within expression allowed only inside a function
fs/open.c:40: error: braced-group within expression allowed only inside a function


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

* Re: [PATCH] thp: define HPAGE_PMD_* constans as BUILD_BUG() if !THP
@ 2013-06-17 22:14   ` Andrew Morton
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Morton @ 2013-06-17 22:14 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Aneesh Kumar K.V, Andrea Arcangeli, linux-kernel, linux-mm

On Tue, 18 Jun 2013 01:05:40 +0300 "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote:

> From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> 
> Currently, HPAGE_PMD_* constans rely on PMD_SHIFT regardless of
> CONFIG_TRANSPARENT_HUGEPAGE. PMD_SHIFT is not defined everywhere (e.g.
> arm nommu case).
> 
> It means we can't use anything like this in generic code:
> 
>         if (PageTransHuge(page))
>                 zero_huge_user(page, 0, HPAGE_PMD_SIZE);
>         else
>                 clear_highpage(page);
> 
> For !THP case, PageTransHuge() is 0 and compiler can eliminate
> zero_huge_user() call. But it still need to be valid C expression, means
> HPAGE_PMD_SIZE has to expand to something compiler can understand.
> 
> Previously, HPAGE_PMD_* were defined to BUILD_BUG() for !THP. Let's come
> back to it.
> 
> ...
>
> --- a/include/linux/huge_mm.h
> +++ b/include/linux/huge_mm.h
> @@ -58,11 +58,12 @@ extern pmd_t *page_check_address_pmd(struct page *page,
>  
>  #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
>  #define HPAGE_PMD_NR (1<<HPAGE_PMD_ORDER)
> +
> +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>  #define HPAGE_PMD_SHIFT PMD_SHIFT
>  #define HPAGE_PMD_SIZE	((1UL) << HPAGE_PMD_SHIFT)
>  #define HPAGE_PMD_MASK	(~(HPAGE_PMD_SIZE - 1))
>  
> -#ifdef CONFIG_TRANSPARENT_HUGEPAGE
>  extern bool is_vma_temporary_stack(struct vm_area_struct *vma);
>  
>  #define transparent_hugepage_enabled(__vma)				\
> @@ -180,6 +181,9 @@ extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vm
>  				unsigned long addr, pmd_t pmd, pmd_t *pmdp);
>  
>  #else /* CONFIG_TRANSPARENT_HUGEPAGE */
> +#define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
> +#define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; })
> +#define HPAGE_PMD_SIZE ({ BUILD_BUG(); 0; })
>  

We've done this sort of thing before and it blew up.  We do want to be
able to use things like HPAGE_PMD_foo in global-var initialisers and
definitions, but the problem is that BUILD_BUG() can't be used outside
functions.  For example,

--- a/fs/open.c
+++ b/fs/open.c
@@ -34,6 +34,11 @@
 
 #include "internal.h"
 
+#define FOOB ({ BUILD_BUG(); 0; })
+
+int x = FOOB;
+int y[FOOB];
+
 int do_truncate(struct dentry *dentry, loff_t length, unsigned int time_attrs,
 	struct file *filp)
 {

fs/open.c:39: error: braced-group within expression allowed only inside a function
fs/open.c:40: error: braced-group within expression allowed only inside a function

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] thp: define HPAGE_PMD_* constans as BUILD_BUG() if !THP
  2013-06-17 22:14   ` Andrew Morton
@ 2013-06-17 22:27     ` Kirill A. Shutemov
  -1 siblings, 0 replies; 8+ messages in thread
From: Kirill A. Shutemov @ 2013-06-17 22:27 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Kirill A. Shutemov, Aneesh Kumar K.V, Andrea Arcangeli,
	linux-kernel, linux-mm

Andrew Morton wrote:
> On Tue, 18 Jun 2013 01:05:40 +0300 "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote:
> 
> > From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> > 
> > Currently, HPAGE_PMD_* constans rely on PMD_SHIFT regardless of
> > CONFIG_TRANSPARENT_HUGEPAGE. PMD_SHIFT is not defined everywhere (e.g.
> > arm nommu case).
> > 
> > It means we can't use anything like this in generic code:
> > 
> >         if (PageTransHuge(page))
> >                 zero_huge_user(page, 0, HPAGE_PMD_SIZE);
> >         else
> >                 clear_highpage(page);
> > 
> > For !THP case, PageTransHuge() is 0 and compiler can eliminate
> > zero_huge_user() call. But it still need to be valid C expression, means
> > HPAGE_PMD_SIZE has to expand to something compiler can understand.
> > 
> > Previously, HPAGE_PMD_* were defined to BUILD_BUG() for !THP. Let's come
> > back to it.
> > 
> > ...
> >
> > --- a/include/linux/huge_mm.h
> > +++ b/include/linux/huge_mm.h
> > @@ -58,11 +58,12 @@ extern pmd_t *page_check_address_pmd(struct page *page,
> >  
> >  #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
> >  #define HPAGE_PMD_NR (1<<HPAGE_PMD_ORDER)
> > +
> > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
> >  #define HPAGE_PMD_SHIFT PMD_SHIFT
> >  #define HPAGE_PMD_SIZE	((1UL) << HPAGE_PMD_SHIFT)
> >  #define HPAGE_PMD_MASK	(~(HPAGE_PMD_SIZE - 1))
> >  
> > -#ifdef CONFIG_TRANSPARENT_HUGEPAGE
> >  extern bool is_vma_temporary_stack(struct vm_area_struct *vma);
> >  
> >  #define transparent_hugepage_enabled(__vma)				\
> > @@ -180,6 +181,9 @@ extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vm
> >  				unsigned long addr, pmd_t pmd, pmd_t *pmdp);
> >  
> >  #else /* CONFIG_TRANSPARENT_HUGEPAGE */
> > +#define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
> > +#define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; })
> > +#define HPAGE_PMD_SIZE ({ BUILD_BUG(); 0; })
> >  
> 
> We've done this sort of thing before and it blew up.  We do want to be
> able to use things like HPAGE_PMD_foo in global-var initialisers and
> definitions, but the problem is that BUILD_BUG() can't be used outside
> functions.

I don't see how it's a blocker. For global variables, we will have to use
#ifdefs, but the approach is still useful for in-function code.

-- 
 Kirill A. Shutemov

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

* Re: [PATCH] thp: define HPAGE_PMD_* constans as BUILD_BUG() if !THP
@ 2013-06-17 22:27     ` Kirill A. Shutemov
  0 siblings, 0 replies; 8+ messages in thread
From: Kirill A. Shutemov @ 2013-06-17 22:27 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Kirill A. Shutemov, Aneesh Kumar K.V, Andrea Arcangeli,
	linux-kernel, linux-mm

Andrew Morton wrote:
> On Tue, 18 Jun 2013 01:05:40 +0300 "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote:
> 
> > From: "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com>
> > 
> > Currently, HPAGE_PMD_* constans rely on PMD_SHIFT regardless of
> > CONFIG_TRANSPARENT_HUGEPAGE. PMD_SHIFT is not defined everywhere (e.g.
> > arm nommu case).
> > 
> > It means we can't use anything like this in generic code:
> > 
> >         if (PageTransHuge(page))
> >                 zero_huge_user(page, 0, HPAGE_PMD_SIZE);
> >         else
> >                 clear_highpage(page);
> > 
> > For !THP case, PageTransHuge() is 0 and compiler can eliminate
> > zero_huge_user() call. But it still need to be valid C expression, means
> > HPAGE_PMD_SIZE has to expand to something compiler can understand.
> > 
> > Previously, HPAGE_PMD_* were defined to BUILD_BUG() for !THP. Let's come
> > back to it.
> > 
> > ...
> >
> > --- a/include/linux/huge_mm.h
> > +++ b/include/linux/huge_mm.h
> > @@ -58,11 +58,12 @@ extern pmd_t *page_check_address_pmd(struct page *page,
> >  
> >  #define HPAGE_PMD_ORDER (HPAGE_PMD_SHIFT-PAGE_SHIFT)
> >  #define HPAGE_PMD_NR (1<<HPAGE_PMD_ORDER)
> > +
> > +#ifdef CONFIG_TRANSPARENT_HUGEPAGE
> >  #define HPAGE_PMD_SHIFT PMD_SHIFT
> >  #define HPAGE_PMD_SIZE	((1UL) << HPAGE_PMD_SHIFT)
> >  #define HPAGE_PMD_MASK	(~(HPAGE_PMD_SIZE - 1))
> >  
> > -#ifdef CONFIG_TRANSPARENT_HUGEPAGE
> >  extern bool is_vma_temporary_stack(struct vm_area_struct *vma);
> >  
> >  #define transparent_hugepage_enabled(__vma)				\
> > @@ -180,6 +181,9 @@ extern int do_huge_pmd_numa_page(struct mm_struct *mm, struct vm_area_struct *vm
> >  				unsigned long addr, pmd_t pmd, pmd_t *pmdp);
> >  
> >  #else /* CONFIG_TRANSPARENT_HUGEPAGE */
> > +#define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
> > +#define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; })
> > +#define HPAGE_PMD_SIZE ({ BUILD_BUG(); 0; })
> >  
> 
> We've done this sort of thing before and it blew up.  We do want to be
> able to use things like HPAGE_PMD_foo in global-var initialisers and
> definitions, but the problem is that BUILD_BUG() can't be used outside
> functions.

I don't see how it's a blocker. For global variables, we will have to use
#ifdefs, but the approach is still useful for in-function code.

-- 
 Kirill A. Shutemov

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

* Re: [PATCH] thp: define HPAGE_PMD_* constans as BUILD_BUG() if !THP
  2013-06-17 22:27     ` Kirill A. Shutemov
@ 2013-06-17 22:33       ` Andrew Morton
  -1 siblings, 0 replies; 8+ messages in thread
From: Andrew Morton @ 2013-06-17 22:33 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Aneesh Kumar K.V, Andrea Arcangeli, linux-kernel, linux-mm

On Tue, 18 Jun 2013 01:27:03 +0300 (EEST) "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote:

> > >  #else /* CONFIG_TRANSPARENT_HUGEPAGE */
> > > +#define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
> > > +#define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; })
> > > +#define HPAGE_PMD_SIZE ({ BUILD_BUG(); 0; })
> > >  
> > 
> > We've done this sort of thing before and it blew up.  We do want to be
> > able to use things like HPAGE_PMD_foo in global-var initialisers and
> > definitions, but the problem is that BUILD_BUG() can't be used outside
> > functions.
> 
> I don't see how it's a blocker. For global variables, we will have to use
> #ifdefs, but the approach is still useful for in-function code.

OK.  Current mainline uses BUILD_BUG() here, so I guess the change
won't break anything.  Yet.


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

* Re: [PATCH] thp: define HPAGE_PMD_* constans as BUILD_BUG() if !THP
@ 2013-06-17 22:33       ` Andrew Morton
  0 siblings, 0 replies; 8+ messages in thread
From: Andrew Morton @ 2013-06-17 22:33 UTC (permalink / raw)
  To: Kirill A. Shutemov
  Cc: Aneesh Kumar K.V, Andrea Arcangeli, linux-kernel, linux-mm

On Tue, 18 Jun 2013 01:27:03 +0300 (EEST) "Kirill A. Shutemov" <kirill.shutemov@linux.intel.com> wrote:

> > >  #else /* CONFIG_TRANSPARENT_HUGEPAGE */
> > > +#define HPAGE_PMD_SHIFT ({ BUILD_BUG(); 0; })
> > > +#define HPAGE_PMD_MASK ({ BUILD_BUG(); 0; })
> > > +#define HPAGE_PMD_SIZE ({ BUILD_BUG(); 0; })
> > >  
> > 
> > We've done this sort of thing before and it blew up.  We do want to be
> > able to use things like HPAGE_PMD_foo in global-var initialisers and
> > definitions, but the problem is that BUILD_BUG() can't be used outside
> > functions.
> 
> I don't see how it's a blocker. For global variables, we will have to use
> #ifdefs, but the approach is still useful for in-function code.

OK.  Current mainline uses BUILD_BUG() here, so I guess the change
won't break anything.  Yet.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

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

end of thread, other threads:[~2013-06-17 22:33 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-06-17 22:05 [PATCH] thp: define HPAGE_PMD_* constans as BUILD_BUG() if !THP Kirill A. Shutemov
2013-06-17 22:05 ` Kirill A. Shutemov
2013-06-17 22:14 ` Andrew Morton
2013-06-17 22:14   ` Andrew Morton
2013-06-17 22:27   ` Kirill A. Shutemov
2013-06-17 22:27     ` Kirill A. Shutemov
2013-06-17 22:33     ` Andrew Morton
2013-06-17 22:33       ` Andrew Morton

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.