[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
Re: CVS commit: src/sys/net
On Wed, Feb 17, 2016 at 10:46 AM, Roy Marples <roy%marples.name@localhost> wrote:
> On Tuesday 16 February 2016 22:20:37 Taylor R Campbell wrote:
>> Except for an issue with queueing discussed privately (scheduling a
>> softint that is already scheduled won't cause it to run again, so
>> if_link_state_change_si needs to process the whole queue in one go),
>> that approach looks fine to me, although as we also discussed
>> privately we can easily compact it into a three-bit mask with a
>> trivial update instead of a whole array of states.
> Patch attached to solve change from a priority array into a bit mask approach
> where we swallow the whole queue in a softint.
> Thanks to Taylor for some reviews and suggestions.
>> This has the consequence that if the link goes up/down in quick
>> succession, and then up/down in quick succession, &c., with the queue
>> processed after each up/down transition, userland will never be
>> notified. However, if the link goes down/up, then down/up, &c., the
>> userland will be notified of all the transitions. Roy claims that
>> that's OK, and I'm inclined to believe the author of dhcpcd about
> If you don't read the patch, here is the comment I added to the
> if_link_state_change() function:
> * Queue a change in the interface link state.
> * The queue itself is very limited:
> * no state can be queued more than once
> * a higher priority state will remove lower priority states
> * The queue state priority in descending order is DOWN, UNKNOWN, UP.
> * Rationale is that if the kernel can't process the link state change queue
> * fast enough then userland has no chance of catching up.
> * Any lossage is logged to the console.
> * The queue state priority is ordered so that link state aware programs
> * will still have the correct end result regardless of any lossage.
> Any comments or objections?
I worry about the priority order, where it comes from? I feel that
the kernel does too much decision; which event is important. I think
it depends on applications.
And the priority provides asymmetric event deliveries; when the state
repeats up and down, a down event is delivered if the final state is down
while a down event and a up event are delivered if the final state is up.
It's confusable to me.
Can we pass events as they are as much as possible? I don't complain that
event reductions in the kernel, but I think it should be down based on time
series manner (e.g., pick latest three events), not based on some priority
things. If we accept event reductions, we can do it with bit-encoding
(w/o a linked list (memory allocations)), for example represent the state
as 2 bits and encode event series into a variable (say 16 events in int).
Main Index |
Thread Index |