Re: Modifying the mbuf data structure?
Re: Modifying the mbuf data structure?
- Subject: Re: Modifying the mbuf data structure?
- From: Michael Smith <email@hidden>
- Date: Fri, 4 Dec 2009 07:38:55 +1100
On Dec 4, 2009, at 1:59 AM, Godfrey van der Linden wrote:
> 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.
Note that network buffers can be (and are routinely) split, merged and resized. You may need to ensure that any ancillary data you come up with can be likewise manipulated.
> Is this the easiest way of doing this or is their an easier way?
There's no easy way to deal with charging work to an unknown consumer.
Given that you're already being forced to generalise (e.g. no trivial way to account for work that benefits multiple consumers, no good way to tentatively account for speculative work, etc.) it may be enough just to have the work billing travel with the packet header and bill whichever poor sucker first pulls it out of the socket buffer at the receive end.
= Mike _______________________________________________
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