netdev
[Top] [All Lists]

Kernel locking up in module

To: netdev@xxxxxxxxxxx
Subject: Kernel locking up in module
From: N N Ashok <nalkunda@xxxxxxxxxxx>
Date: Mon, 14 Jul 2003 17:46:30 -0400
Organization: CSE, Michigan State University
Sender: netdev-bounce@xxxxxxxxxxx
User-agent: KMail/1.4.3
Hi All,
    I am creating a module to measure the outgoing bandwidth usage on the 
interfaces. It uses the get_stats() of the device to get the current stats 
and then computes the bandwidth usage. The algorithm for the usage 
calculation are borrowed from iproute2 package (tc/tc_estimator.c).
  The problem is that the kernel keeps locking up. I am using rwlock_t locks 
to lock the data. In the code, I traverse the list of bwuage structures and 
as a debug message am printing whether the traversal ended in the variable 
becoming null (which it should if everything went right), but the variable is 
non-null every other time I insert the module. 
        printk(KERN_INFO "bwestimator: dev: %s. bwusage: %s.\n", dev ? 
"non-null" : 
"null", bwusage ? "non-null" : "null");

  I think this has got to do with some locking issues. As this is my first go 
at the kernel locking, I might have used the wrong kind of locks. I have 
attached the module source, header and the log messages as I inserted the 
module a couple of times. I request you all to please help me as I am totally 
lost here.

Thanks,
Ashok

Attachment: bwestimator.c
Description: Text Data

Attachment: bwestimator.h
Description: Text Data

Attachment: messages.log
Description: Text Data

<Prev in Thread] Current Thread [Next in Thread>