Re: [PATCH] Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM

2007-11-21 Thread Christoph Lameter
On Mon, 19 Nov 2007, Dave Hansen wrote:

> Which comes from:
> 
> config OUT_OF_LINE_PFN_TO_PAGE
> def_bool X86_64
> depends on DISCONTIGMEM
> 
> and only on x86_64.  Perhaps it can go away with the
> discontig->sparsemem-vmemmap conversion.

The discontig/flatmem removal patch for x86_64 in mm already removes this.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM

2007-11-21 Thread Christoph Lameter
On Mon, 19 Nov 2007, Dave Hansen wrote:

 Which comes from:
 
 config OUT_OF_LINE_PFN_TO_PAGE
 def_bool X86_64
 depends on DISCONTIGMEM
 
 and only on x86_64.  Perhaps it can go away with the
 discontig-sparsemem-vmemmap conversion.

The discontig/flatmem removal patch for x86_64 in mm already removes this.

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM

2007-11-20 Thread Mathieu Desnoyers
* Andrew Morton ([EMAIL PROTECTED]) wrote:
> On Mon, 19 Nov 2007 15:20:23 -0500
> Mathieu Desnoyers <[EMAIL PROTECTED]> wrote:
> 
> > * Dave Hansen ([EMAIL PROTECTED]) wrote:
> > > The only thing I might suggest doing differently is actually using the
> > > page_to_pfn() definition itself:
> > > 
> > > memory_model.h:#define page_to_pfn __page_to_pfn
> > > 
> > > The full inline function version should do this already, and we
> > > shouldn't have any real direct __page_to_pfn() users anyway.
> > > 
> > 
> > Like this then..
> > 
> > Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM
> > 
> > Make sure the type returned by page_to_pfn is always unsigned long. If we
> > don't cast it explicitly, it can be int on i386, but long on x86_64.
> 
> formally ptrdiff_t, I believe.
> 
> > This is
> > especially inelegant for printks.
> > 
> > Signed-off-by: Mathieu Desnoyers <[EMAIL PROTECTED]>
> > CC: Dave Hansen <[EMAIL PROTECTED]>
> > CC: [EMAIL PROTECTED]
> > CC: linux-kernel@vger.kernel.org
> > ---
> >  include/asm-generic/memory_model.h |2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > Index: linux-2.6-lttng/include/asm-generic/memory_model.h
> > ===
> > --- linux-2.6-lttng.orig/include/asm-generic/memory_model.h 2007-11-19 
> > 15:06:40.0 -0500
> > +++ linux-2.6-lttng/include/asm-generic/memory_model.h  2007-11-19 
> > 15:18:57.0 -0500
> > @@ -76,7 +76,7 @@ struct page;
> >  extern struct page *pfn_to_page(unsigned long pfn);
> >  extern unsigned long page_to_pfn(struct page *page);
> >  #else
> > -#define page_to_pfn __page_to_pfn
> > +#define page_to_pfn ((unsigned long)__page_to_pfn)
> >  #define pfn_to_page __pfn_to_page
> >  #endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */
> 
> I'd have thought that __pfn_to_page() was the place to fix this: the
> lower-level point.  Because someone might later start using __pfn_to_page()
> for something.
> 
> Heaven knows why though - why does __pfn_to_page() even exist?

Since it all does away with Christoph's patchset anyway, please drop
this patch. (I think there is also an issue with this patch version,
which is that the define should take the arguments...).

Mathieu

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM

2007-11-20 Thread Mathieu Desnoyers
* Andrew Morton ([EMAIL PROTECTED]) wrote:
 On Mon, 19 Nov 2007 15:20:23 -0500
 Mathieu Desnoyers [EMAIL PROTECTED] wrote:
 
  * Dave Hansen ([EMAIL PROTECTED]) wrote:
   The only thing I might suggest doing differently is actually using the
   page_to_pfn() definition itself:
   
   memory_model.h:#define page_to_pfn __page_to_pfn
   
   The full inline function version should do this already, and we
   shouldn't have any real direct __page_to_pfn() users anyway.
   
  
  Like this then..
  
  Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM
  
  Make sure the type returned by page_to_pfn is always unsigned long. If we
  don't cast it explicitly, it can be int on i386, but long on x86_64.
 
 formally ptrdiff_t, I believe.
 
  This is
  especially inelegant for printks.
  
  Signed-off-by: Mathieu Desnoyers [EMAIL PROTECTED]
  CC: Dave Hansen [EMAIL PROTECTED]
  CC: [EMAIL PROTECTED]
  CC: linux-kernel@vger.kernel.org
  ---
   include/asm-generic/memory_model.h |2 +-
   1 file changed, 1 insertion(+), 1 deletion(-)
  
  Index: linux-2.6-lttng/include/asm-generic/memory_model.h
  ===
  --- linux-2.6-lttng.orig/include/asm-generic/memory_model.h 2007-11-19 
  15:06:40.0 -0500
  +++ linux-2.6-lttng/include/asm-generic/memory_model.h  2007-11-19 
  15:18:57.0 -0500
  @@ -76,7 +76,7 @@ struct page;
   extern struct page *pfn_to_page(unsigned long pfn);
   extern unsigned long page_to_pfn(struct page *page);
   #else
  -#define page_to_pfn __page_to_pfn
  +#define page_to_pfn ((unsigned long)__page_to_pfn)
   #define pfn_to_page __pfn_to_page
   #endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */
 
 I'd have thought that __pfn_to_page() was the place to fix this: the
 lower-level point.  Because someone might later start using __pfn_to_page()
 for something.
 
 Heaven knows why though - why does __pfn_to_page() even exist?

Since it all does away with Christoph's patchset anyway, please drop
this patch. (I think there is also an issue with this patch version,
which is that the define should take the arguments...).

Mathieu

-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM

2007-11-19 Thread Dave Hansen
On Mon, 2007-11-19 at 13:19 -0800, Dave Hansen wrote:
> On Mon, 2007-11-19 at 13:08 -0800, Andrew Morton wrote:
> > Heaven knows why though - why does __pfn_to_page() even exist?
> Perhaps it can go away with the
> discontig->sparsemem-vmemmap conversion.

In fact, Christoph Lameter's

   Subject: 
x86_64: Make sparsemem/vmemmap the
default memory model V2
  Date: 
Thu, 15 Nov 2007 19:55:11
-0800 (PST)

does remove it.  

-- Dave

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM

2007-11-19 Thread Dave Hansen
On Mon, 2007-11-19 at 13:08 -0800, Andrew Morton wrote:
> 
> >  #else
> > -#define page_to_pfn __page_to_pfn
> > +#define page_to_pfn ((unsigned long)__page_to_pfn)
> >  #define pfn_to_page __pfn_to_page
> >  #endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */
> 
> I'd have thought that __pfn_to_page() was the place to fix this: the
> lower-level point.  Because someone might later start using
> __pfn_to_page()
> for something.
> 
> Heaven knows why though - why does __pfn_to_page() even exist?

I think it's this stuff:

#ifdef CONFIG_OUT_OF_LINE_PFN_TO_PAGE
struct page *pfn_to_page(unsigned long pfn)
{
return __pfn_to_page(pfn);
}
unsigned long page_to_pfn(struct page *page)
{
return __page_to_pfn(page);
}
EXPORT_SYMBOL(pfn_to_page);
EXPORT_SYMBOL(page_to_pfn);
#endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */

Which comes from:

config OUT_OF_LINE_PFN_TO_PAGE
def_bool X86_64
depends on DISCONTIGMEM

and only on x86_64.  Perhaps it can go away with the
discontig->sparsemem-vmemmap conversion.

-- Dave


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM

2007-11-19 Thread Andrew Morton
On Mon, 19 Nov 2007 15:20:23 -0500
Mathieu Desnoyers <[EMAIL PROTECTED]> wrote:

> * Dave Hansen ([EMAIL PROTECTED]) wrote:
> > The only thing I might suggest doing differently is actually using the
> > page_to_pfn() definition itself:
> > 
> > memory_model.h:#define page_to_pfn __page_to_pfn
> > 
> > The full inline function version should do this already, and we
> > shouldn't have any real direct __page_to_pfn() users anyway.
> > 
> 
> Like this then..
> 
> Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM
> 
> Make sure the type returned by page_to_pfn is always unsigned long. If we
> don't cast it explicitly, it can be int on i386, but long on x86_64.

formally ptrdiff_t, I believe.

> This is
> especially inelegant for printks.
> 
> Signed-off-by: Mathieu Desnoyers <[EMAIL PROTECTED]>
> CC: Dave Hansen <[EMAIL PROTECTED]>
> CC: [EMAIL PROTECTED]
> CC: linux-kernel@vger.kernel.org
> ---
>  include/asm-generic/memory_model.h |2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> Index: linux-2.6-lttng/include/asm-generic/memory_model.h
> ===
> --- linux-2.6-lttng.orig/include/asm-generic/memory_model.h   2007-11-19 
> 15:06:40.0 -0500
> +++ linux-2.6-lttng/include/asm-generic/memory_model.h2007-11-19 
> 15:18:57.0 -0500
> @@ -76,7 +76,7 @@ struct page;
>  extern struct page *pfn_to_page(unsigned long pfn);
>  extern unsigned long page_to_pfn(struct page *page);
>  #else
> -#define page_to_pfn __page_to_pfn
> +#define page_to_pfn ((unsigned long)__page_to_pfn)
>  #define pfn_to_page __pfn_to_page
>  #endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */

I'd have thought that __pfn_to_page() was the place to fix this: the
lower-level point.  Because someone might later start using __pfn_to_page()
for something.

Heaven knows why though - why does __pfn_to_page() even exist?
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM

2007-11-19 Thread Mathieu Desnoyers
* Dave Hansen ([EMAIL PROTECTED]) wrote:
> The only thing I might suggest doing differently is actually using the
> page_to_pfn() definition itself:
> 
> memory_model.h:#define page_to_pfn __page_to_pfn
> 
> The full inline function version should do this already, and we
> shouldn't have any real direct __page_to_pfn() users anyway.
> 

Like this then..

Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM

Make sure the type returned by page_to_pfn is always unsigned long. If we
don't cast it explicitly, it can be int on i386, but long on x86_64. This is
especially inelegant for printks.

Signed-off-by: Mathieu Desnoyers <[EMAIL PROTECTED]>
CC: Dave Hansen <[EMAIL PROTECTED]>
CC: [EMAIL PROTECTED]
CC: linux-kernel@vger.kernel.org
---
 include/asm-generic/memory_model.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6-lttng/include/asm-generic/memory_model.h
===
--- linux-2.6-lttng.orig/include/asm-generic/memory_model.h 2007-11-19 
15:06:40.0 -0500
+++ linux-2.6-lttng/include/asm-generic/memory_model.h  2007-11-19 
15:18:57.0 -0500
@@ -76,7 +76,7 @@ struct page;
 extern struct page *pfn_to_page(unsigned long pfn);
 extern unsigned long page_to_pfn(struct page *page);
 #else
-#define page_to_pfn __page_to_pfn
+#define page_to_pfn ((unsigned long)__page_to_pfn)
 #define pfn_to_page __pfn_to_page
 #endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */
 



-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM

2007-11-19 Thread Mathieu Desnoyers
* Dave Hansen ([EMAIL PROTECTED]) wrote:
 The only thing I might suggest doing differently is actually using the
 page_to_pfn() definition itself:
 
 memory_model.h:#define page_to_pfn __page_to_pfn
 
 The full inline function version should do this already, and we
 shouldn't have any real direct __page_to_pfn() users anyway.
 

Like this then..

Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM

Make sure the type returned by page_to_pfn is always unsigned long. If we
don't cast it explicitly, it can be int on i386, but long on x86_64. This is
especially inelegant for printks.

Signed-off-by: Mathieu Desnoyers [EMAIL PROTECTED]
CC: Dave Hansen [EMAIL PROTECTED]
CC: [EMAIL PROTECTED]
CC: linux-kernel@vger.kernel.org
---
 include/asm-generic/memory_model.h |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Index: linux-2.6-lttng/include/asm-generic/memory_model.h
===
--- linux-2.6-lttng.orig/include/asm-generic/memory_model.h 2007-11-19 
15:06:40.0 -0500
+++ linux-2.6-lttng/include/asm-generic/memory_model.h  2007-11-19 
15:18:57.0 -0500
@@ -76,7 +76,7 @@ struct page;
 extern struct page *pfn_to_page(unsigned long pfn);
 extern unsigned long page_to_pfn(struct page *page);
 #else
-#define page_to_pfn __page_to_pfn
+#define page_to_pfn ((unsigned long)__page_to_pfn)
 #define pfn_to_page __pfn_to_page
 #endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */
 



-- 
Mathieu Desnoyers
Computer Engineering Ph.D. Student, Ecole Polytechnique de Montreal
OpenPGP key fingerprint: 8CD5 52C3 8E3C 4140 715F  BA06 3F25 A8FE 3BAE 9A68
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM

2007-11-19 Thread Andrew Morton
On Mon, 19 Nov 2007 15:20:23 -0500
Mathieu Desnoyers [EMAIL PROTECTED] wrote:

 * Dave Hansen ([EMAIL PROTECTED]) wrote:
  The only thing I might suggest doing differently is actually using the
  page_to_pfn() definition itself:
  
  memory_model.h:#define page_to_pfn __page_to_pfn
  
  The full inline function version should do this already, and we
  shouldn't have any real direct __page_to_pfn() users anyway.
  
 
 Like this then..
 
 Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM
 
 Make sure the type returned by page_to_pfn is always unsigned long. If we
 don't cast it explicitly, it can be int on i386, but long on x86_64.

formally ptrdiff_t, I believe.

 This is
 especially inelegant for printks.
 
 Signed-off-by: Mathieu Desnoyers [EMAIL PROTECTED]
 CC: Dave Hansen [EMAIL PROTECTED]
 CC: [EMAIL PROTECTED]
 CC: linux-kernel@vger.kernel.org
 ---
  include/asm-generic/memory_model.h |2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
 
 Index: linux-2.6-lttng/include/asm-generic/memory_model.h
 ===
 --- linux-2.6-lttng.orig/include/asm-generic/memory_model.h   2007-11-19 
 15:06:40.0 -0500
 +++ linux-2.6-lttng/include/asm-generic/memory_model.h2007-11-19 
 15:18:57.0 -0500
 @@ -76,7 +76,7 @@ struct page;
  extern struct page *pfn_to_page(unsigned long pfn);
  extern unsigned long page_to_pfn(struct page *page);
  #else
 -#define page_to_pfn __page_to_pfn
 +#define page_to_pfn ((unsigned long)__page_to_pfn)
  #define pfn_to_page __pfn_to_page
  #endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */

I'd have thought that __pfn_to_page() was the place to fix this: the
lower-level point.  Because someone might later start using __pfn_to_page()
for something.

Heaven knows why though - why does __pfn_to_page() even exist?
-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM

2007-11-19 Thread Dave Hansen
On Mon, 2007-11-19 at 13:08 -0800, Andrew Morton wrote:
 
   #else
  -#define page_to_pfn __page_to_pfn
  +#define page_to_pfn ((unsigned long)__page_to_pfn)
   #define pfn_to_page __pfn_to_page
   #endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */
 
 I'd have thought that __pfn_to_page() was the place to fix this: the
 lower-level point.  Because someone might later start using
 __pfn_to_page()
 for something.
 
 Heaven knows why though - why does __pfn_to_page() even exist?

I think it's this stuff:

#ifdef CONFIG_OUT_OF_LINE_PFN_TO_PAGE
struct page *pfn_to_page(unsigned long pfn)
{
return __pfn_to_page(pfn);
}
unsigned long page_to_pfn(struct page *page)
{
return __page_to_pfn(page);
}
EXPORT_SYMBOL(pfn_to_page);
EXPORT_SYMBOL(page_to_pfn);
#endif /* CONFIG_OUT_OF_LINE_PFN_TO_PAGE */

Which comes from:

config OUT_OF_LINE_PFN_TO_PAGE
def_bool X86_64
depends on DISCONTIGMEM

and only on x86_64.  Perhaps it can go away with the
discontig-sparsemem-vmemmap conversion.

-- Dave


-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH] Cast page_to_pfn to unsigned long in CONFIG_SPARSEMEM

2007-11-19 Thread Dave Hansen
On Mon, 2007-11-19 at 13:19 -0800, Dave Hansen wrote:
 On Mon, 2007-11-19 at 13:08 -0800, Andrew Morton wrote:
  Heaven knows why though - why does __pfn_to_page() even exist?
 Perhaps it can go away with the
 discontig-sparsemem-vmemmap conversion.

In fact, Christoph Lameter's

   Subject: 
x86_64: Make sparsemem/vmemmap the
default memory model V2
  Date: 
Thu, 15 Nov 2007 19:55:11
-0800 (PST)

does remove it.  

-- Dave

-
To unsubscribe from this list: send the line unsubscribe linux-kernel in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/