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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux