static allocation of space in the kernel

Steve Shah (sshah@cs.ucr.edu)
Wed, 9 Sep 1998 13:38:56 -0700


Hello Gang,

I modified some of the kernel to track network queue lengths.
This was done in the CBQ code (net/sched/sch_cbq.c) and in the core
for incoming traffic (net/core/dev.c). The results are made available
through /proc/net. I need 32 bit counters so I use unsigned int
under x86 -- I don't think this will ever need to be cross platform.

I allocate a static two dimentional array for the data I collect.

I have two questions/problems:

1) During my functions for dumping the data I have, do I need to put
locks around the code? I regularly freeze up during those routines.
I find this odd because I'm only doing reads from that buffer and
updates should be able to happen without it affecting my code.

2) Would it be better to dynamically allocate memory with kmalloc
instead of doing an unsigned int backlog_track[SIZE_X][SIZE_Y]??

Thanks,

-Steve

-- 
______________________________________________________________________________
Steve Shah (sshah@cs.ucr.edu) | SysAdmin/Coder/Gabbernaut/DJ/Writer/Minister
http://www.cs.ucr.edu/~sshah  | We're not dropping out, we're infiltrating.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      Beating code into submission, one operating system at a time...
-
To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.rutgers.edu