Subject: Re: [RFC PATCH 01/13] net: sched: allow qdiscs to handle locking

From: John Fastabend <[email-masked]>
Date: Wed, 17 Aug 2016 15:49:19 -0700

On 16-08-17 03:33 PM, Eric Dumazet wrote:
> On Wed, 2016-08-17 at 12:33 -0700, John Fastabend wrote:
>> This patch adds a flag for queueing disciplines to indicate the stack
>> does not need to use the qdisc lock to protect operations. This can
>> be used to build lockless scheduling algorithms and improving
>> performance.
>>
>> The flag is checked in the tx path and the qdisc lock is only taken
>> if it is not set. For now use a conditional if statement. Later we
>> could be more aggressive if it proves worthwhile and use a static key
>> or wrap this in a likely().
>>
>> Signed-off-by: John Fastabend <[email-masked]>
>> ---
>>  include/net/pkt_sched.h   |    4 +++-
>>  include/net/sch_generic.h |    1 +
>>  net/core/dev.c            |   32 ++++++++++++++++++++++++++++----
>>  net/sched/sch_generic.c   |   26 ++++++++++++++++----------
>>  4 files changed, 48 insertions(+), 15 deletions(-)
>>
>> diff --git a/include/net/pkt_sched.h b/include/net/pkt_sched.h
>> index 7caa99b..69540c6 100644
>> --- a/include/net/pkt_sched.h
>> +++ b/include/net/pkt_sched.h
>> @@ -107,8 +107,10 @@ void __qdisc_run(struct Qdisc *q);
>>  
>>  static inline void qdisc_run(struct Qdisc *q)
>>  {
>> -	if (qdisc_run_begin(q))
>> +	if (qdisc_run_begin(q)) {
>>  		__qdisc_run(q);
>> +		qdisc_run_end(q);
>> +	}
>>  }
> 
> 
> Looks like you could have a separate patch, removing qdisc_run_end()
> call done in __qdisc_run(q) ?
> 
> Then the 'allow qdiscs to handle locking'
> 
> 

Agreed that would clean this up a bit. Will do for next rev.