problem accessing global Node List pgdat_list
Hi all,
On an dual opteron machine and 2.6.9 kernel, I am accessing the global node list pgdat_list but I am not getting the desired results
#include<linux/module.h>
#include<linux/config.h>
#include<linux/kernel.h>
#include<linux/mmzone.h>
struct pglist_data *pgdat_list ;
int init_module( void )
{
pg_data_t *pg_dat ;
printk ("<1>****Module initialized to retrive the information ofpgdat_list list in the Kernel****\n" ) ;
for_each_pgdat(pg_dat)
{
printk ("<1>The number of zones on this node are %x\n", pg_dat ->nr_zones ) ;
printk ("<1>The Node Id of this node is %d\n", pg_dat -> node_id ) ;}
return 0 ;
}
void cleanup_module ( void )
{
printk ("<1>********Module Exiting***********\n" ) ;
}MODULE_LICENSE("GPL") ;
How I can access this list any body tell me the solution.
Hi Devesh
Quoted 10 lines · devesh sharma
Hi all,
On an dual opteron machine and 2.6.9 kernel, I am accessing the global node listpgdat_listbut I am not getting the desired results#include<linux/module.h>
#include<linux/config.h>
#include<linux/kernel.h>
#include<linux/mmzone.h>struct
pglist_data*pgdat_list;
What are you doing here ? You declare a local variable on this module. You should instead write :
extern struct pglist_data *pgdat_list ;
(But it seems already declared in mmzone.h)
But pgdat_list is an exported symbol of linux kernel : a module cannot access it.
So I suspect you will have to add in mm/page_alloc.c (and recompile your kernel)
EXPORT_SYMBOL(pgdat_list);
And please use a recent kernel (2.6.13 at least) or few people will answer you.
Quoted 22 lines
int
init_module( void )
{
pg_data_t*pg_dat;printk ("<1>****Module initialized to retrive the information of
pgdat_listlist in the Kernel****\n" ) ;
for_each_pgdat(pg_dat){ printk ("<1>The number of zones on this node are %x\n", pg_dat ->
nr_zones) ;printk ("<1>The Node Id of this node is %d\n", pg_dat -> node_id ) ;}return 0 ;
}
Quoted 8 lines
void
cleanup_module( void ){ printk ("<1>********Module Exiting***********\n" ) ; }
MODULE_LICENSE("GPL");How I can access this list any body tell me the solution.
Eric
A message that is not in the archive (sent off-list or not yet received): [email protected]
Hi Eric,
I have tried numa=fake=4 on intel xeon with 2.6.13 kernel it is working fine and by adding EXPORT_SYMBOL(pgdat_list) in mm/page_alloc.c now I am able to access pgdat_list also. But on opteron machine there is some problem in kernel compilation at make install stage I am getting following warning
WARNING: No module mptbase found for kernel 2.6.13, continuing anyway
WARNING: No module mptscsih found for kernel 2.6.13, continuing anyway
now when I boot my kernel, panic is received
Booting the kernel.
Red Hat nash version 4.1.18 starting
mkrootdev: lable / not found
mount: error 2 mounting ext3
mount: error 2 mounting none
switchroot: mount failed : 22
umount : /initrd/dev failed : 22
kernel panic - not syncing : Attempted to kill init
On the other hand when I complie same source code on XEON machine this works fine.
what could be the problem?
Quoted 21 lines · devesh sharma
Hi Eric,
I have tried numa=fake=4 on intel xeon with 2.6.13 kernel it is working fine and by addingEXPORT_SYMBOL(pgdat_list)inmm/page_alloc.cnow I am able to accesspgdat_listalso. But on opteron machine there is some problem in kernel compilation at make install stage I am getting following warningWARNING: No module mptbase found for kernel 2.6.13, continuing anyway
WARNING: No module mptscsih found for kernel 2.6.13, continuing anywaynow when I boot my kernel, panic is received
Booting the kernel.
Red Hat nash version 4.1.18 starting
mkrootdev: lable / not found
mount: error 2 mounting ext3
mount: error 2 mounting none
switchroot: mount failed : 22
umount : /initrd/dev failed : 22
kernel panic - not syncing : Attempted to kill init
Quoted 4 lines
On the other hand when I complie same source code on XEON machine this works fine.
what could be the problem?
Hi Devesh
I believe you have basic kernel compilation problem :)
Your kernel cannot mount / because the boot loader was configured to find a root=LABEL=/
As this is a RedHat kernel extension, your self compiled 2.6.13 kernel cannot understand this. You should change your lilo/grub config to match your root device as root=/dev/hda2 (if hda2 is your root device)
Also check that your kernel (or initrd) contains the disk driver you need.
Eric