All of lore.kernel.org
 help / color / mirror / Atom feed
From: John Fastabend <john.fastabend@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: xiyou.wangcong@gmail.com, jhs@mojatatu.com,
	alexei.starovoitov@gmail.com, brouer@redhat.com,
	john.r.fastabend@intel.com, netdev@vger.kernel.org,
	davem@davemloft.net
Subject: Re: [RFC PATCH 07/13] net: sched: support qdisc_reset on NOLOCK qdisc
Date: Wed, 17 Aug 2016 15:59:32 -0700	[thread overview]
Message-ID: <57B4EC54.4090500@gmail.com> (raw)
In-Reply-To: <1471474381.29842.51.camel@edumazet-glaptop3.roam.corp.google.com>

On 16-08-17 03:53 PM, Eric Dumazet wrote:
> On Wed, 2016-08-17 at 12:36 -0700, John Fastabend wrote:
>> The qdisc_reset operation depends on the qdisc lock at the moment
>> to halt any additions to gso_skb and statistics while the list is
>> free'd and the stats zeroed.
> 
> ...
> 
>> Signed-off-by: John Fastabend <john.r.fastabend@intel.com>
>> ---
>>  net/sched/sch_generic.c |   45 +++++++++++++++++++++++++++++++++++----------
>>  1 file changed, 35 insertions(+), 10 deletions(-)
>>
>> diff --git a/net/sched/sch_generic.c b/net/sched/sch_generic.c
>> index 3b9a21f..29238c4 100644
>> --- a/net/sched/sch_generic.c
>> +++ b/net/sched/sch_generic.c
>> @@ -737,6 +737,20 @@ void qdisc_reset(struct Qdisc *qdisc)
>>  	kfree_skb(qdisc->skb_bad_txq);
>>  	qdisc->skb_bad_txq = NULL;
>>  
>> +	if (qdisc->gso_cpu_skb) {
>> +		int i;
>> +
>> +		for_each_possible_cpu(i) {
>> +			struct gso_cell *cell;
>> +
>> +			cell = per_cpu_ptr(qdisc->gso_cpu_skb, i);
>> +			if (cell) {
>> +				kfree_skb_list(cell->skb);
>> +				cell = NULL;
> 
> 	You probably wanted :
> 			cell->skb = NULL;
> 

Yep thanks!

> 
>> +			}
>> +		}
>> +	}
>> +
>>  	if (qdisc->gso_skb) {
>>  		kfree_skb_list(qdisc->gso_skb);
>>  		qdisc->gso_skb = NULL;
>> @@ -812,10 +826,6 @@ struct Qdisc *dev_graft_qdisc(struct netdev_queue *dev_queue,
>>  	root_lock = qdisc_lock(oqdisc);
>>  	spin_lock_bh(root_lock);
>>  
>> -	/* Prune old scheduler */
>> -	if (oqdisc && atomic_read(&oqdisc->refcnt) <= 1)
>> -		qdisc_reset(oqdisc);
>> -
>>  
> 
> This probably belongs to a separate patch, before any per cpu / lockless
> qdisc changes ?
> 
> 
> 

Agreed will do for next rev thanks for reviewing.

  reply	other threads:[~2016-08-17 22:59 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-08-17 19:33 [RFC PATCH 00/13] Series short description John Fastabend
2016-08-17 19:33 ` [RFC PATCH 01/13] net: sched: allow qdiscs to handle locking John Fastabend
2016-08-17 22:33   ` Eric Dumazet
2016-08-17 22:49     ` John Fastabend
2016-08-17 22:34   ` Eric Dumazet
2016-08-17 22:48     ` John Fastabend
2016-08-17 19:34 ` [RFC PATCH 02/13] net: sched: qdisc_qlen for per cpu logic John Fastabend
2016-08-17 19:34 ` [RFC PATCH 03/13] net: sched: provide per cpu qstat helpers John Fastabend
2016-08-17 19:35 ` [RFC PATCH 04/13] net: sched: provide atomic qlen helpers for bypass case John Fastabend
2016-08-17 19:35 ` [RFC PATCH 05/13] net: sched: a dflt qdisc may be used with per cpu stats John Fastabend
2016-08-17 19:35 ` [RFC PATCH 06/13] net: sched: per cpu gso handlers John Fastabend
2016-08-17 19:36 ` [RFC PATCH 07/13] net: sched: support qdisc_reset on NOLOCK qdisc John Fastabend
2016-08-17 22:53   ` Eric Dumazet
2016-08-17 22:59     ` John Fastabend [this message]
2016-08-17 19:36 ` [RFC PATCH 08/13] net: sched: support skb_bad_tx with lockless qdisc John Fastabend
2016-08-17 22:58   ` Eric Dumazet
2016-08-17 23:00     ` John Fastabend
2016-08-23 20:11       ` John Fastabend
2016-08-17 19:37 ` [RFC PATCH 09/13] net: sched: helper to sum qlen John Fastabend
2016-08-17 19:37 ` [RFC PATCH 10/13] net: sched: lockless support for netif_schedule John Fastabend
2016-08-17 19:46   ` John Fastabend
2016-08-17 23:01   ` Eric Dumazet
2016-08-17 23:17     ` John Fastabend
2016-08-17 23:33       ` Eric Dumazet
2016-08-17 19:38 ` [RFC PATCH 11/13] net: sched: pfifo_fast use alf_queue John Fastabend
2016-08-19 10:13   ` Jesper Dangaard Brouer
2016-08-19 15:44     ` John Fastabend
2016-08-17 19:38 ` [RFC PATCH 12/13] net: sched: add support for TCQ_F_NOLOCK subqueues to sch_mq John Fastabend
2016-08-17 19:49   ` John Fastabend
2016-08-17 23:04   ` Eric Dumazet
2016-08-17 23:18     ` John Fastabend
2016-08-17 19:39 ` [RFC PATCH 13/13] net: sched: add support for TCQ_F_NOLOCK subqueues to sch_mqprio John Fastabend

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=57B4EC54.4090500@gmail.com \
    --to=john.fastabend@gmail.com \
    --cc=alexei.starovoitov@gmail.com \
    --cc=brouer@redhat.com \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=jhs@mojatatu.com \
    --cc=john.r.fastabend@intel.com \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.