netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: jamal <hadi@cyberus.ca>
To: Patrick McHardy <kaber@trash.net>
Cc: Jesper Dangaard Brouer <hawk@comx.dk>,
	hawk@diku.dk, russell-tcatm@stuart.id.au, netdev@vger.kernel.org,
	Stephen Hemminger <shemminger@osdl.org>
Subject: Re: [PATCH 0/2] NET: Accurate packet scheduling for ATM/ADSL
Date: Sun, 02 Jul 2006 09:59:32 -0400	[thread overview]
Message-ID: <1151848772.5093.252.camel@jzny2> (raw)
In-Reply-To: <44A74A44.4000304@trash.net>

On Sun, 2006-02-07 at 06:23 +0200, Patrick McHardy wrote:
[..]
> > - Any message to user space may be lost whether it has ifi_change or
> > not. You need some way to figure out a message was lost and declare your
> > state may be invalid. The -ENOBUFs is one way to discover stale state.
> 
> Thats not the point. ifi_change doesn't inform you about updates, it
> informs you about specific changes. 

yes, 

> And you can't determine those in
> the case of lost notifications without keeping the old state yourself.

nod,

> It may save you some time _comparing_ (not searching) in case it wasn't
> lost, 

This is one of the points of where it has value.

Take a hypothetical example of when you have a gazillion events/sec
happening, this is an exageration in case of ifi_change, just assume it
so for illustration purposes. Assume no messages are lost. Assume you
are only interested in the netdevice becoming  promisc or un-promisc.
In such a case, you can quickly check if among the vector of events
that this just happened or not.

> but it only contains a very limited set of information and nothing
> saves you from searching the entry a message refers to based on the
> primary keys (which unfortunately aren't even defined for every message
> type, which means they're not even clearly defined inside the kernel.
> routing rules are one example). 

In some cases it does provide you with details - example in the case of
booleans where it will tell you something changed from 0->1 or 1->0.
Actually the promisc case i gave is a bad example because it falls under
such a category although i hope it still made the point i was trying to
make. 

But yes in general, it is just supposed to provide you with info of
"dude, you got a message from X and Y" - which is more useful than the
select() "dude, you got a message". You have then to go and read that
message if you are interested or if you are busy you can go later.

> Its a hack for some specific usage case,
> and since you're defending this so hard, I'm naturally wondering if
> you introduced it?
> 

No, i didnt - it has been there for years; it may/must have been Alexey
who introduced it.

The reason i am defending it is i find it useful and it is a classical
approach in event management; i have seen it used in a lot of middleware
as an optimization. When you have a vector of events that can be
reported, then as optimization you dont waste resources by sending
details about the event in case nobody is interested in hearing about
the details or is ready to process them.

BTW,theres a consistency bug/hack at the moment in iproute2 on its
usage.

> > - by looking at ifi_change i can tell what changed from about 10 
> > other things reflected in the flags. If you get an ENOBUFS in this case
> > (or any other), it means your state is not consistent and to have
> > reliable info you need to query the kernel.
> 
> The flags only reflect a single piece of information, one that userspace
> needs to be able to reconstruct anyway. Once again the point: netlink
> notifications are _update_ messages, not state change messages. This is
> a fundamental difference, misleading userspace (see tc monitor) to
> believing it is something different for very limited usage cases does
> nothing good. I hereby state my believe that 99% of netlink users
> are broken.
> 

yes, it would mislead users who dont use it appropriately such as ip mon
but that doesnt make it less valuable. I thought ip mon would bitch if
it received enobufs? 

cheers,
jamal


  reply	other threads:[~2006-07-02 13:59 UTC|newest]

Thread overview: 56+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-14  9:40 [PATCH 0/2] NET: Accurate packet scheduling for ATM/ADSL Jesper Dangaard Brouer
2006-06-14 12:06 ` jamal
2006-06-14 12:55   ` Jesper Dangaard Brouer
2006-06-15 12:57     ` jamal
2006-06-15 13:16     ` jamal
2006-06-20  1:04       ` Patrick McHardy
2006-06-20 14:59         ` jamal
2006-06-20 15:16           ` Patrick McHardy
2006-06-21 12:21             ` Krzysztof Matusik
2006-06-21 12:54               ` Patrick McHardy
2006-06-21 14:33                 ` Krzysztof Matusik
2006-06-14 15:32   ` Andy Furniss
2006-06-20  0:54   ` Patrick McHardy
2006-06-20 14:56     ` jamal
2006-06-20 15:09       ` Patrick McHardy
2006-06-22 18:41         ` jamal
2006-06-23 14:32           ` Patrick McHardy
2006-06-24 14:39             ` jamal
2006-06-26 11:21               ` Patrick McHardy
2006-06-27 13:01                 ` jamal
2006-07-02  4:23                   ` Patrick McHardy
2006-07-02 13:59                     ` jamal [this message]
     [not found]   ` <1150287983.3246.27.camel@ras.pc.brisbane.lube>
     [not found]     ` <1150292693.5197.1.camel@jzny2>
     [not found]       ` <1150843471.17455.2.camel@ras.pc.brisbane.lube>
     [not found]         ` <15653CE98281AD4FBD7F70BCEE3666E53CD54A@comxexch01.comx.local>
     [not found]           ` <1151000966.5392.34.camel@jzny2>
2006-06-23 12:37             ` Russell Stuart
2006-06-23 15:21               ` Patrick McHardy
2006-06-26  0:45                 ` Russell Stuart
2006-06-26 11:10                   ` Patrick McHardy
2006-06-27  6:19                     ` Russell Stuart
2006-06-27 17:18                       ` Patrick McHardy
2006-07-04 13:29                       ` Patrick McHardy
2006-07-04 19:29                         ` jamal
2006-07-04 23:53                           ` Patrick McHardy
2006-07-06  0:39                         ` Russell Stuart
2006-07-07  8:00                           ` Patrick McHardy
2006-07-10  8:44                             ` Russell Stuart
2006-06-24 14:13               ` jamal
2006-06-26  4:23                 ` Russell Stuart
2006-07-18  2:06                 ` Russell Stuart
2006-07-18 13:35                   ` jamal
2006-07-18 21:46                   ` Andy Furniss
2006-07-19  1:02                     ` Russell Stuart
2006-07-19 14:42                       ` Andy Furniss
2006-07-19 14:54                         ` Patrick McHardy
2006-07-19 20:26                         ` [PATCH 0/2] NET: Accurate packet scheduling for ATM/ADSL (RTAB BUG) Jesper Dangaard Brouer
2006-07-19 21:00                           ` Alexey Kuznetsov
2006-07-20  5:47                             ` Russell Stuart
2006-07-20 23:49                               ` Alexey Kuznetsov
2006-07-19 14:50                       ` [PATCH 0/2] NET: Accurate packet scheduling for ATM/ADSL Patrick McHardy
2006-07-20  4:56                         ` Russell Stuart
2006-07-30 23:06                           ` Russell Stuart
2006-08-08 22:01                             ` Russell Stuart
2006-08-09 11:33                               ` jamal
2006-09-04 10:37                                 ` Russell Stuart
2006-06-14 14:27 ` Phillip Susi
2006-06-14 15:08   ` Jesper Dangaard Brouer
2006-06-20  5:35 ` Chris Wedgwood
2006-06-20  7:33   ` Jesper Dangaard Brouer

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=1151848772.5093.252.camel@jzny2 \
    --to=hadi@cyberus.ca \
    --cc=hawk@comx.dk \
    --cc=hawk@diku.dk \
    --cc=kaber@trash.net \
    --cc=netdev@vger.kernel.org \
    --cc=russell-tcatm@stuart.id.au \
    --cc=shemminger@osdl.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).