[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210513082222.3b23d3a3@kicinski-fedora-PC1C0HJN>
Date: Thu, 13 May 2021 08:22:22 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Yunsheng Lin <linyunsheng@...wei.com>
Cc: <davem@...emloft.net>, <olteanv@...il.com>, <ast@...nel.org>,
<daniel@...earbox.net>, <andriin@...com>, <edumazet@...gle.com>,
<weiwan@...gle.com>, <cong.wang@...edance.com>,
<ap420073@...il.com>, <netdev@...r.kernel.org>,
<linux-kernel@...r.kernel.org>, <linuxarm@...neuler.org>,
<mkl@...gutronix.de>, <linux-can@...r.kernel.org>,
<jhs@...atatu.com>, <xiyou.wangcong@...il.com>, <jiri@...nulli.us>,
<andrii@...nel.org>, <kafai@...com>, <songliubraving@...com>,
<yhs@...com>, <john.fastabend@...il.com>, <kpsingh@...nel.org>,
<bpf@...r.kernel.org>, <jonas.bonn@...rounds.com>,
<pabeni@...hat.com>, <mzhivich@...mai.com>, <johunt@...mai.com>,
<albcamus@...il.com>, <kehuan.feng@...il.com>,
<a.fatoum@...gutronix.de>, <atenart@...nel.org>,
<alexander.duyck@...il.com>, <hdanton@...a.com>, <jgross@...e.com>,
<JKosina@...e.com>, <mkubecek@...e.cz>, <bjorn@...nel.org>,
<alobakin@...me>
Subject: Re: [PATCH net v7 3/3] net: sched: fix tx action reschedule issue
with stopped queue
On Thu, 13 May 2021 09:11:00 +0800 Yunsheng Lin wrote:
> The netdev qeueue might be stopped when byte queue limit has
> reached or tx hw ring is full, net_tx_action() may still be
> rescheduled endlessly if STATE_MISSED is set, which consumes
> a lot of cpu without dequeuing and transmiting any skb because
> the netdev queue is stopped, see qdisc_run_end().
>
> This patch fixes it by checking the netdev queue state before
> calling qdisc_run() and clearing STATE_MISSED if netdev queue is
> stopped during qdisc_run(), the net_tx_action() is recheduled
> again when netdev qeueue is restarted, see netif_tx_wake_queue().
>
> As there is time window betewwn netif_xmit_frozen_or_stopped()
> checking and STATE_MISSED clearing, between which STATE_MISSED
> is set by net_tx_action() scheduled by netif_tx_wake_queue(),
> so set the STATE_MISSED again if netdev queue is restarted.
>
> Fixes: 6b3ba9146fe6 ("net: sched: allow qdiscs to handle locking")
> Reported-by: Michal Kubecek <mkubecek@...e.cz>
> Signed-off-by: Yunsheng Lin <linyunsheng@...wei.com>
> @@ -35,6 +35,25 @@
> const struct Qdisc_ops *default_qdisc_ops = &pfifo_fast_ops;
> EXPORT_SYMBOL(default_qdisc_ops);
>
> +static void qdisc_maybe_stop_tx(struct Qdisc *q,
nit: qdisc_maybe_clear_missed()?
Powered by blists - more mailing lists