public inbox for linux-ia64@vger.kernel.org
 help / color / mirror / Atom feed
* Recent SPARSEMEM and DISCONTIG changes break some builds
@ 2005-10-31  3:36 Peter Chubb
  2005-10-31 17:45 ` Luck, Tony
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Peter Chubb @ 2005-10-31  3:36 UTC (permalink / raw)
  To: linux-ia64


Is it intended that CONFIG_SPARSEMEM and CONFIG_DISCONTIGMEM be usable
without CONFIG_NUMA?

Currently (2.6.14+GIT as of 31 October) 
	  -- compiling with CONFIG_SPARSEMEM gives undefined ref to
	     pfn_to_node().
	  -- compiling with CONFIG_DISCONTIGMEM gives many errors
	     linux-2.6-import/arch/ia64/mm/discontig.c:326: error: dereferencing
	     pointer to incomplete type when referencing struct
	     ia64_node_data 

-- 
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
The technical we do immediately,  the political takes *forever*

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

* RE: Recent SPARSEMEM and DISCONTIG changes break some builds
  2005-10-31  3:36 Recent SPARSEMEM and DISCONTIG changes break some builds Peter Chubb
@ 2005-10-31 17:45 ` Luck, Tony
  2005-10-31 18:25 ` Bob Picco
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Luck, Tony @ 2005-10-31 17:45 UTC (permalink / raw)
  To: linux-ia64

Peter Chubb wrote:
>Is it intended that CONFIG_SPARSEMEM and CONFIG_DISCONTIGMEM be usable
>without CONFIG_NUMA?
>
>Currently (2.6.14+GIT as of 31 October) 
>	  -- compiling with CONFIG_SPARSEMEM gives undefined ref to
>	     pfn_to_node().
>	  -- compiling with CONFIG_DISCONTIGMEM gives many errors
>	     linux-2.6-import/arch/ia64/mm/discontig.c:326: error: dereferencing
>	     pointer to incomplete type when referencing struct
>	     ia64_node_data 

All of my standard configs build ... the only one that
fails is arch/ia64/configs/gensparse_defconfig which gets
a link error for an undefined reference to pfn_to_kaddr in
sparse_add_one_section.

-Tonh

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

* Re: Recent SPARSEMEM and DISCONTIG changes break some builds
  2005-10-31  3:36 Recent SPARSEMEM and DISCONTIG changes break some builds Peter Chubb
  2005-10-31 17:45 ` Luck, Tony
@ 2005-10-31 18:25 ` Bob Picco
  2005-10-31 19:00 ` Luck, Tony
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Bob Picco @ 2005-10-31 18:25 UTC (permalink / raw)
  To: linux-ia64

luck wrote:	[Mon Oct 31 2005, 12:45:42PM EST]
> Peter Chubb wrote:
> >Is it intended that CONFIG_SPARSEMEM and CONFIG_DISCONTIGMEM be usable
> >without CONFIG_NUMA?
> >
> >Currently (2.6.14+GIT as of 31 October) 
> >	  -- compiling with CONFIG_SPARSEMEM gives undefined ref to
> >	     pfn_to_node().
> >	  -- compiling with CONFIG_DISCONTIGMEM gives many errors
> >	     linux-2.6-import/arch/ia64/mm/discontig.c:326: error: dereferencing
> >	     pointer to incomplete type when referencing struct
> >	     ia64_node_data 
> 
> All of my standard configs build ... the only one that
> fails is arch/ia64/configs/gensparse_defconfig which gets
> a link error for an undefined reference to pfn_to_kaddr in
> sparse_add_one_section.
> 
> -Tonh
> -
Tony,

Your build must be against -mm because pfn_to_kaddr shouldn't be required
in 2.6.14.  The patch below will fix this.

My only objection to pfn_to_kaddr, which was introduced for HotPlug memory,
is that all arches have an identical implementation. I haven't had a chance
to pursue why yet.  There is probably some arch issue I'm unaware of.

bob


Signed-off-by: Bob Picco <bob.picco@hp.com>

 include/asm-ia64/page.h |    1 +
 1 files changed, 1 insertion(+)

Index: linux-2.6.14-rc5-mm1/include/asm-ia64/page.h
=================================--- linux-2.6.14-rc5-mm1.orig/include/asm-ia64/page.h	2005-10-24 14:38:36.000000000 -0400
+++ linux-2.6.14-rc5-mm1/include/asm-ia64/page.h	2005-10-31 13:03:40.000000000 -0500
@@ -120,6 +120,7 @@ extern unsigned long max_low_pfn;
 
 #define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)
 #define virt_to_page(kaddr)	pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
+#define pfn_to_kaddr(pfn)	__va((pfn) << PAGE_SHIFT)
 
 typedef union ia64_va {
 	struct {


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

* RE: Recent SPARSEMEM and DISCONTIG changes break some builds
  2005-10-31  3:36 Recent SPARSEMEM and DISCONTIG changes break some builds Peter Chubb
  2005-10-31 17:45 ` Luck, Tony
  2005-10-31 18:25 ` Bob Picco
@ 2005-10-31 19:00 ` Luck, Tony
  2005-11-01  0:25 ` Bob Picco
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Luck, Tony @ 2005-10-31 19:00 UTC (permalink / raw)
  To: linux-ia64

>Your build must be against -mm because pfn_to_kaddr shouldn't be required
>in 2.6.14.  The patch below will fix this.

I was building 2.6.14+(all the bits in Linus' git tree that I pulled
at about 8:30 PST today).  Presumably this bit has already been moved
from -mm to -linus?

Thanks for the patch, I'll give it a spin.

-Tony

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

* Re: Recent SPARSEMEM and DISCONTIG changes break some builds
  2005-10-31  3:36 Recent SPARSEMEM and DISCONTIG changes break some builds Peter Chubb
                   ` (2 preceding siblings ...)
  2005-10-31 19:00 ` Luck, Tony
@ 2005-11-01  0:25 ` Bob Picco
  2005-11-01  0:31 ` Peter Chubb
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Bob Picco @ 2005-11-01  0:25 UTC (permalink / raw)
  To: linux-ia64

luck wrote:	[Mon Oct 31 2005, 02:00:46PM EST]
> >Your build must be against -mm because pfn_to_kaddr shouldn't be required
> >in 2.6.14.  The patch below will fix this.
> 
> I was building 2.6.14+(all the bits in Linus' git tree that I pulled
> at about 8:30 PST today).  Presumably this bit has already been moved
> from -mm to -linus?
Actually you are correct. I just updated my local Linus' git tree and 
pfn_to_kaddr is now required for ia64 because of changes in mm/sparse.c.
> 
> Thanks for the patch, I'll give it a spin.
your welcome.
> 
> -Tony
> -
bob

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

* RE: Recent SPARSEMEM and DISCONTIG changes break some builds
  2005-10-31  3:36 Recent SPARSEMEM and DISCONTIG changes break some builds Peter Chubb
                   ` (3 preceding siblings ...)
  2005-11-01  0:25 ` Bob Picco
@ 2005-11-01  0:31 ` Peter Chubb
  2005-11-01  0:46 ` Luck, Tony
  2005-11-01  2:11 ` Peter Chubb
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Chubb @ 2005-11-01  0:31 UTC (permalink / raw)
  To: linux-ia64

>>>>> "Tony" = Tony Luck <Luck> writes:

Tony> Peter Chubb wrote:
>> Is it intended that CONFIG_SPARSEMEM and CONFIG_DISCONTIGMEM be
>> usable without CONFIG_NUMA?
>> 
>> Currently (2.6.14+GIT as of 31 October) -- compiling with
>> CONFIG_SPARSEMEM gives undefined ref to pfn_to_node().  --
>> compiling with CONFIG_DISCONTIGMEM gives many errors
>> linux-2.6-import/arch/ia64/mm/discontig.c:326: error: dereferencing
>> pointer to incomplete type when referencing struct ia64_node_data

Tony> All of my standard configs build ... the only one that fails is
Tony> arch/ia64/configs/gensparse_defconfig which gets a link error
Tony> for an undefined reference to pfn_to_kaddr in
Tony> sparse_add_one_section.

I see many other problems when compiling for a large-memory ZX1
configuration:  I do:
		make zx1_defconfig
then edit .config to turn SMP OFF  and DISCONTIG ON
then
		make oldconfig
		make


Here's the sparsemem fix, BTWL:

Index: linux-2.6-import/include/asm-ia64/page.h
=================================--- linux-2.6-import.orig/include/asm-ia64/page.h	2005-10-31 13:34:33.864315350 +1100
+++ linux-2.6-import/include/asm-ia64/page.h	2005-11-01 10:49:47.817687789 +1100
@@ -110,20 +110,21 @@ extern int ia64_pfn_valid (unsigned long
 # define pfn_valid(pfn)		(((pfn) < max_mapnr) && ia64_pfn_valid(pfn))
 # define page_to_pfn(page)	((unsigned long) (page - mem_map))
 # define pfn_to_page(pfn)	(mem_map + (pfn))
 #elif defined(CONFIG_DISCONTIGMEM)
 extern struct page *vmem_map;
 extern unsigned long max_low_pfn;
 # define pfn_valid(pfn)		(((pfn) < max_low_pfn) && ia64_pfn_valid(pfn))
 # define page_to_pfn(page)	((unsigned long) (page - vmem_map))
 # define pfn_to_page(pfn)	(vmem_map + (pfn))
 #endif
+#define pfn_to_kaddr(pfn) 	__va((pfn) << PAGE_SHIFT)
 
 #define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)
 #define virt_to_page(kaddr)	pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)
 
 typedef union ia64_va {
 	struct {
 		unsigned long off : 61;		/* intra-region offset */
 		unsigned long reg :  3;		/* region number */
 	} f;
 	unsigned long l;



-- 
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
The technical we do immediately,  the political takes *forever*

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

* RE: Recent SPARSEMEM and DISCONTIG changes break some builds
  2005-10-31  3:36 Recent SPARSEMEM and DISCONTIG changes break some builds Peter Chubb
                   ` (4 preceding siblings ...)
  2005-11-01  0:31 ` Peter Chubb
@ 2005-11-01  0:46 ` Luck, Tony
  2005-11-01  2:11 ` Peter Chubb
  6 siblings, 0 replies; 8+ messages in thread
From: Luck, Tony @ 2005-11-01  0:46 UTC (permalink / raw)
  To: linux-ia64

>+#define pfn_to_kaddr(pfn) 	__va((pfn) << PAGE_SHIFT)
> 
> #define page_to_phys(page)	(page_to_pfn(page) << PAGE_SHIFT)
> #define virt_to_page(kaddr)	pfn_to_page(__pa(kaddr) >> PAGE_SHIFT)

Almost identical to Bob Picco's fix.  He put exactly the same
definition for pfn_to_kaddr() three lines further down ... and
since he got there first, his patch is going in.

But thanks for confirming.

-Tony
 

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

* RE: Recent SPARSEMEM and DISCONTIG changes break some builds
  2005-10-31  3:36 Recent SPARSEMEM and DISCONTIG changes break some builds Peter Chubb
                   ` (5 preceding siblings ...)
  2005-11-01  0:46 ` Luck, Tony
@ 2005-11-01  2:11 ` Peter Chubb
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Chubb @ 2005-11-01  2:11 UTC (permalink / raw)
  To: linux-ia64


Please note I'm still seeing problems with DISCONTIGMEM builds...
I think the simplest would be to make CONFIG_DISCONTIGMEM depend on
CONFIG_NUMA and use SPARSEMEM for the other cases.

(This is with:
# CONFIG_SMP is not set
# CONFIG_PREEMPT is not set
CONFIG_SELECT_MEMORY_MODEL=y
# CONFIG_FLATMEM_MANUAL is not set
CONFIG_DISCONTIGMEM_MANUAL=y
# CONFIG_SPARSEMEM_MANUAL is not set
CONFIG_DISCONTIGMEM=y
CONFIG_FLAT_NODE_MEM_MAP=y
CONFIG_NEED_MULTIPLE_NODES=y
# CONFIG_SPARSEMEM_STATIC is not set
CONFIG_SPLIT_PTLOCK_CPUS=4
CONFIG_ARCH_SELECT_MEMORY_MODEL=y
CONFIG_ARCH_DISCONTIGMEM_ENABLE=y
CONFIG_ARCH_FLATMEM_ENABLE=y
CONFIG_ARCH_SPARSEMEM_ENABLE=y
CONFIG_ARCH_DISCONTIGMEM_DEFAULT=y
# CONFIG_NUMA is not set
CONFIG_VIRTUAL_MEM_MAP=y
CONFIG_HOLES_IN_ZONE=y
CONFIG_HAVE_ARCH_EARLY_PFN_TO_NID=y
)
:
In file included from linux-2.6-import/include/linux/slab.h:16,
                 from linux-2.6-import/include/linux/percpu.h:5,
                 from linux-2.6-import/include/linux/sched.h:35,
                 from linux-2.6-import/arch/ia64/kernel/asm-offsets.c:11:
linux-2.6-import/include/linux/gfp.h: In function 'alloc_pages_node':
linux-2.6-import/include/linux/gfp.h:98: warning: implicit declaration of function 'NODE_DATA'
linux-2.6-import/include/linux/gfp.h:98: error: invalid type argument of '->'


-- 
Dr Peter Chubb  http://www.gelato.unsw.edu.au  peterc AT gelato.unsw.edu.au
The technical we do immediately,  the political takes *forever*

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

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

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-10-31  3:36 Recent SPARSEMEM and DISCONTIG changes break some builds Peter Chubb
2005-10-31 17:45 ` Luck, Tony
2005-10-31 18:25 ` Bob Picco
2005-10-31 19:00 ` Luck, Tony
2005-11-01  0:25 ` Bob Picco
2005-11-01  0:31 ` Peter Chubb
2005-11-01  0:46 ` Luck, Tony
2005-11-01  2:11 ` Peter Chubb

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