From: Shailabh Nagar <nagar@watson.ibm.com>
To: hadi@cyberus.ca
Cc: netdev <netdev@vger.kernel.org>,
linux-kernel <linux-kernel@vger.kernel.org>,
lse-tech@lists.sourceforge.net
Subject: Re: [Patch 7/7] Generic netlink interface (delay accounting)
Date: Mon, 06 Mar 2006 12:00:26 -0500 [thread overview]
Message-ID: <440C6AAA.9030301@watson.ibm.com> (raw)
In-Reply-To: <1141652556.5185.64.camel@localhost.localdomain>
Jamal,
Pls keep lkml and lse-tech on cc since some of this affects the usage
of delay accounting.
jamal wrote:
>Hi Shailabh,
>Apologies for taking a week to respond ..
>
>On Mon, 2006-27-02 at 15:26 -0500, Shailabh Nagar wrote:
>
>
>>jamal wrote:
>>
>>
>
>
>
>>Yes, the current intent is to allow multiple listeners to receive the
>>responses sent by the kernel.
>>
>>
>
>Responses or events? There is a difference:
>Response implies the program in user space requested (ex a GET) for that
>information and is receiving such info.
>Event implies the program in user space asked to be informed of changes
>in the kernel. Example an exit would be considered an event.
>Events are received by virtue of registering to a multicast group.
>[..]
>
>
My design was to have the listener get both responses (what I call
replies in the code)
as well as events (data sent on exit of pid)
>>Since this interface (taskstats) is currently designed for that
>>possibility, having multiple listeners, one for
>>each "component" such as delay accounting, is the model we're using.
>>We expect each component to have a pair of userspace programs, one for
>>sending commands and the other
>>to "listen" to all replies + data generated on task exits.
>>
>>
>
>You need to have a sender of GETs essentially and a listener of events.
>Those are two connections. The replies of a get from user1 will not be
>sent to user2 as well - unless ... thats what you are trying to achieve;
>the question is why?
>
>
Yes, I was trying to have an asymmetric model where the userspace sender
of GETs
doesn't receive the reply as a unicast. Rather the reply is sent by
multicast (alongwith all the
event data).
Reason for this unintuitive design was to make it easier to process the
returned data.
The expected usage of delay accounting is to periodically "sample" the
delays for all
tasks (or tgids) in the system. Also, get the delays from exiting pids
(lets forget how tgid exit
is handled for now...irrelevant to this discussion).
Using the above two pieces of data, userspace can aggregate the "delays"
seen by any
grouping of tasks that it chooses to implement.
In this usage scenario, its more efficient to have one receiver get both
response and event
data and process in a loop.
However, we could switch to the model you suggest and use a
multithreaded send/receive
userspace utility.
>>The listener
>>is expected to register/deregister interest through
>>TASKSTATS_CMD_LISTEN and IGNORE.
>>
>>
>>
>
>It is not necessary if you follow the model i described.
>
>
>
>>>How does this correlate to TASKSTATS_CMD_LISTEN/IGNORE?
>>>
>>>
>>>
>>>
>>See above. Its mainly an optimization so that if no listener is present,
>>there's no need to generate the data.
>>
>>
>>
>
>Also not necessary - There is a recent netlink addition to make sure
>that events dont get sent if no listeners exist.
>genetlink needs to be extended. For now assume such a thing exists.
>
>
Ok. Will this addition work for both unicast and multicast modes ?
>
>
>>>>+
>>>>
>>>>
>
>
>
>>Good point. Should check for users sending it as a cmd and treat it as a
>>noop.
>>
>>
>
>More like return an -EINVAL
>
>
Will this be necessary ? Isn't genl_rcv_msg() going to return a -EOPNOTSUPP
automatically for us since we've not registered the command ?
>
>
>>I'm just using
>>this as a placeholder for data thats returned without being requested.
>>
>>
>>
>
>So it is unconditional?
>
>
Yes.
>
>
>>Come to think of it, there's no real reason to have a genlmsghdr for
>>returned data, is there ?
>>
>>
>
>All messages should be consistent whether they are sent from user
>or kernel.
>
>
Ok. will retain genetlink header.
>>Other than to copy the genlmsghdr that was sent so user can identify
>>which command was sent
>>(and I'm doing that through the reply type, perhaps redundantly).
>>
>>
>>
>
>yes, that is a useful trick. Just make sure they are reflected
>correctly.
>
>
>
>>Actually, the next iteration of the code will move to dynamically
>>generated ID. But yes, will need to check for that.
>>
>>
>>
>
>Also if you can provide feedback whether the doc i sent was any use
>and what wasnt clear etc.
>
>
Will do.
>>Thanks for the review.
>>Couple of questions about general netlink:
>>is it intended to remain a size that will always be aligned to the
>>NLMSG_ALIGNTO so that (NLMSG_DATA(nlhdr) + GENL_HDRLEN) can always
>>be used as a pointer to the genlmsghdr ?
>>
>>
>>
>
>I am not sure i followed.
>The whole message (nlhdr, genlhdr, optionalhdr, TLVs) has to be in
>the end 32 bit aligned.
>
>
Ok , so separate padding isn't needed to make the genlhdr, optionalhdr
and TLV parts aligned
too.
>>Adding some macros like genlmsg_data(nlh) would be handy (currently I
>>just define and use it locally).
>>
>>
>>
>
>Send a patch.
>
>
will do.
Thanks,
Shailabh
>cheers,
>jamal
>
>
>
next prev parent reply other threads:[~2006-03-06 17:00 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <1141026996.5785.38.camel@elinux04.optonline.net>
2006-02-27 8:31 ` [Patch 7/7] Generic netlink interface (delay accounting) Shailabh Nagar
[not found] ` <1141045194.5363.12.camel@localhost.localdomain>
[not found] ` <4403608E.1050304@watson.ibm.com>
[not found] ` <1141652556.5185.64.camel@localhost.localdomain>
2006-03-06 17:00 ` Shailabh Nagar [this message]
2006-03-07 14:38 ` [Lse-tech] " jamal
2006-03-08 21:56 ` Shailabh Nagar
2006-03-09 14:37 ` [UPDATED PATCH] " Balbir Singh
2006-03-09 16:06 ` Shailabh Nagar
2006-03-10 14:53 ` jamal
2006-03-10 15:35 ` [UPDATED PATCH] Re: [Lse-tech] " jamal
2006-03-10 16:39 ` [UPDATED PATCH] " Balbir Singh
2006-03-11 13:30 ` jamal
2006-03-13 16:21 ` [UPDATED PATCH] Re: [Lse-tech] " Balbir Singh
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=440C6AAA.9030301@watson.ibm.com \
--to=nagar@watson.ibm.com \
--cc=hadi@cyberus.ca \
--cc=linux-kernel@vger.kernel.org \
--cc=lse-tech@lists.sourceforge.net \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).