Re: [NUMA x86_64] problem accessing global Node List pgdat_list

From: Eric Dumazet
Date: Wed Oct 05 2005 - 07:43:23 EST


Hi Devesh

devesh sharma a écrit :
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 ;

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.



int init_module( void )
{

pg_data_t *pg_dat ;

printk ("<1>****Module initialized to retrive the information of
pgdat_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.

Eric


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