Re: static allocation of space in the kernel

Steve Shah (sshah@cs.ucr.edu)
Thu, 10 Sep 1998 09:17:32 -0700


On Thu, Sep 10, 1998 at 07:59:53PM +0400, kuznet@ms2.inr.ac.ru wrote:
> > 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.
>
> It is strange. Maybe, your /proc reading procedure is incorrect
> and loops sometimes. Did you try to catch loop with sysreq?
>

<insert maniacal laugh here>
Sysreq never works for me!!! Since I usually have to reboot to get a
new kernel in place, a crash without a sync first doesn't do much
damage. (If I changed anything or edited files first, I make it a
point to manually sync before trying anything.)

In my CBQ dumping routines, I stole the code from cbq_walk to get
all the class information. I haven't been able to confirm a correlation
between network activity (specifically network activity that needs
CBQ) and locking things up when I check the data in /proc.

> BTW locks may be necessary only in the case if you need "atomic" snapshots
> of counters. As I understand, atomicity of your data is not very important.

No, I don't need atomic snapshots. When counting 3 billion packets,
a little error is pretty hard to notice! ;)

Thanks for the info on memory allocation. I think I'll stick to
statically allocating the buffers for now. 20x20 grids are enough
data and 40x40 grids made things too unstable.

-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