[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <5c8e3ea0-8e6f-7431-96d6-f4fe94a02488@gmail.com>
Date: Thu, 16 Nov 2017 05:31:20 -0800
From: John Fastabend <john.fastabend@...il.com>
To: Willem de Bruijn <willemdebruijn.kernel@...il.com>
Cc: Daniel Borkmann <daniel@...earbox.net>,
Eric Dumazet <eric.dumazet@...il.com>,
Michael Ma <make0818@...il.com>,
Network Development <netdev@...r.kernel.org>,
Jiří Pírko <jiri@...nulli.us>,
Cong Wang <xiyou.wangcong@...il.com>
Subject: Re: [RFC PATCH 06/17] net: sched: explicit locking in gso_cpu
fallback
On 11/15/2017 09:51 AM, Willem de Bruijn wrote:
> On Wed, Nov 15, 2017 at 10:11 AM, John Fastabend
> <john.fastabend@...il.com> wrote:
>> On 11/14/2017 04:41 PM, Willem de Bruijn wrote:
>>>> /* use instead of qdisc->dequeue() for all qdiscs queried with ->peek() */
>>>> static inline struct sk_buff *qdisc_dequeue_peeked(struct Qdisc *sch)
>>>> {
>>>> - struct sk_buff *skb = sch->gso_skb;
>>>> + struct sk_buff *skb = skb_peek(&sch->gso_skb);
>>>>
>>>> if (skb) {
>>>> - sch->gso_skb = NULL;
>>>> + skb = __skb_dequeue(&sch->gso_skb);
>>>> qdisc_qstats_backlog_dec(sch, skb);
>>>> sch->q.qlen--;
>>>
>>> In lockless qdiscs, can this race, so that __skb_dequeue returns NULL?
>>> Same for its use in qdisc_peek_dequeued.
>>>
>>
>> Yes, agree if this was used in lockless qdisc it could race. However,
>> I don't think it is actually used in the lockless cases yet. For pfifo
>> fast __skb_array_peek is used.
>
> Oh right. That will be easy to miss when other qdiscs are converted
> to lockless. Perhaps another location to add lockdep annotations.
>
Yep. Will add lockdep here.
> Related: what happens when pfifo_fast is used as a leaf in a non-lockless
> qdisc hierarchy, say htb? The individual leaves will still have
> TCQ_F_NOLOCK, so will try to take the qdisc lock in dequeue_skb
> and other locations, but that is already held?
>
Right. So I guess TCQ_F_NOLOCK needs to be propagated through the chain
of qdiscs and at attach we can only set TCQ_F_NOLOCK if the entire chain
of qdisc's are NOLOCK. Will spin an update with this as well.
> Thanks for revising and resubmitting the patchset, btw!
>
no problem will be good to finally get this out of my queue.
Powered by blists - more mailing lists