From: Changli Gao <xiaosuo@gmail.com>
To: Eric Dumazet <eric.dumazet@gmail.com>
Cc: "David S. Miller" <davem@davemloft.net>, netdev@vger.kernel.org
Subject: Re: [PATCH v2] net: batch skb dequeueing from softnet input_pkt_queue
Date: Tue, 13 Apr 2010 17:50:29 +0800 [thread overview]
Message-ID: <o2v412e6f7f1004130250rdbe17c5dr5c11c3cbbb2f6dbb@mail.gmail.com> (raw)
In-Reply-To: <1271146112.16881.213.camel@edumazet-laptop>
On Tue, Apr 13, 2010 at 4:08 PM, Eric Dumazet <eric.dumazet@gmail.com> wrote:
>
> Probably not necessary.
>
>> + volatile bool flush_processing_queue;
>
> Use of 'volatile' is strongly discouraged, I would say, forbidden.
>
volatile is used to avoid compiler optimization.
> Its usually a sign of 'I dont exactly what memory ordering I need, so I
> throw a volatile just in case'. We live in a world full of RCU, read ,
> write, full barriers. And these apis are well documented.
>
There isn't memory accessing order problem.
>> @@ -2803,6 +2808,7 @@ static void flush_backlog(void *arg)
>> __skb_unlink(skb, &queue->input_pkt_queue);
>> kfree_skb(skb);
>> }
>> + queue->flush_processing_queue = true;
>
> Probably not necessary
>
If flush_backlog() is called when there are still packets in
processing_queue, there maybe some packets refer to the netdev gone,
if we remove this line.
>> rps_unlock(queue);
>> }
>>
>> @@ -3112,14 +3118,23 @@ static int process_backlog(struct napi_struct *napi, int quota)
>> struct softnet_data *queue = &__get_cpu_var(softnet_data);
>> unsigned long start_time = jiffies;
>>
>> + if (queue->flush_processing_queue) {
>
> Really... this is bloat IMHO
Any better idea?
>
>>
>
> I advise to keep it simple.
>
> My suggestion would be to limit this patch only to process_backlog().
>
> Really if you touch other areas, there is too much risk.
>
> Perform sort of skb_queue_splice_tail_init() into a local (stack) queue,
> but the trick is to not touch input_pkt_queue.qlen, so that we dont slow
> down enqueue_to_backlog().
>
> Process at most 'quota' skbs (or jiffies limit).
>
> relock queue.
> input_pkt_queue.qlen -= number_of_handled_skbs;
>
Oh no, in order to let latter packets in as soon as possible, we have
to update qlen immediately.
--
Regards,
Changli Gao(xiaosuo@gmail.com)
next prev parent reply other threads:[~2010-04-13 9:50 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-04-13 15:38 [PATCH v2] net: batch skb dequeueing from softnet input_pkt_queue Changli Gao
2010-04-13 8:08 ` Eric Dumazet
2010-04-13 9:50 ` Changli Gao [this message]
2010-04-13 10:19 ` Eric Dumazet
2010-04-13 10:23 ` Eric Dumazet
2010-04-13 12:53 ` Changli Gao
2010-04-13 13:21 ` Eric Dumazet
2010-04-13 13:38 ` Changli Gao
2010-04-13 14:37 ` Eric Dumazet
2010-04-13 15:52 ` Paul E. McKenney
2010-04-13 22:43 ` Changli Gao
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=o2v412e6f7f1004130250rdbe17c5dr5c11c3cbbb2f6dbb@mail.gmail.com \
--to=xiaosuo@gmail.com \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.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).