Modifying the mbuf data structure?
Modifying the mbuf data structure?
- Subject: Modifying the mbuf data structure?
- From: Godfrey van der Linden <email@hidden>
- Date: Fri, 04 Dec 2009 01:59:18 +1100
G'day, Kernel dudes.
For my Ph.D. research I wish to collect I/O statistics and then to attribute them to the initiating process.
I'm going to be building a new kernel that can track per-process I/O stats. This is reasonably easy to do for raw IOKit memory descriptor I/Os, I can tag the descriptor with a process tag and on completion accumulate it into data. This should be a reasonably narrow change primarily to IOKit.
However, the network stats presents a problem, the drivers where I collect the data do not know which process attribute them to until the top of the network stack. I've had an idea that may work but I'd like real networking experts opinion.
A natural analog to memory descriptors in networking is the mbuf structure. I'd like to add a new field for my research kernel that points to the data collected by the driver. Then I'll modify the top of the networking stack to accumulate it into per process data.
Is this the easiest way of doing this or is their an easier way? Your opinions and advice will be gratefully received. Note the code is very carefully written to be extremely light weight and lock-free (in the sense that no additional locks are required over and above the locks already used by networking. There will be some cache invalidation which appears to be unavoidable).
Cheers
Godfrey
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Darwin-kernel mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden