All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH net-next 0/4] net_sched: sch_fq: round of improvements
@ 2023-09-20 12:54 Eric Dumazet
  2023-09-20 12:54 ` [PATCH net-next 1/4] net_sched: sch_fq: struct sched_data reorg Eric Dumazet
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Eric Dumazet @ 2023-09-20 12:54 UTC (permalink / raw)
  To: David S . Miller, Jakub Kicinski, Paolo Abeni
  Cc: Willem de Bruijn, Jamal Hadi Salim, Cong Wang, Jiri Pirko, netdev,
	eric.dumazet, Eric Dumazet

For FQ tenth anniversary, it was time for making it faster.

The FQ part (as in Fair Queue) is rather expensive, because
we have to classify packets and store them in a per-flow structure,
and add this per-flow structure in a hash table.

Most fq qdisc are almost idle. Trying to share NIC bandwidth has
no benefits, thus the qdisc could behave like a FIFO.

Eric Dumazet (4):
  net_sched: sch_fq: struct sched_data reorg
  net_sched: sch_fq: change how @inactive is tracked
  net_sched: sch_fq: add fast path for mostly idle qdisc
  net_sched: sch_fq: always garbage collect

 include/uapi/linux/pkt_sched.h |   1 +
 net/sched/sch_fq.c             | 127 ++++++++++++++++++++++++---------
 2 files changed, 96 insertions(+), 32 deletions(-)

-- 
2.42.0.459.ge4e396fd5e-goog


^ permalink raw reply	[flat|nested] 8+ messages in thread
* Re: [PATCH net-next 3/4] net_sched: sch_fq: add fast path for mostly idle qdisc
@ 2023-09-25 12:27 kernel test robot
  0 siblings, 0 replies; 8+ messages in thread
From: kernel test robot @ 2023-09-25 12:27 UTC (permalink / raw)
  To: oe-kbuild; +Cc: lkp

:::::: 
:::::: Manual check reason: "low confidence static check warning: net/sched/sch_fq.c:550:1: sparse: sparse: unused label 'queue'"
:::::: 

BCC: lkp@intel.com
CC: oe-kbuild-all@lists.linux.dev
In-Reply-To: <20230920125418.3675569-4-edumazet@google.com>
References: <20230920125418.3675569-4-edumazet@google.com>
TO: Eric Dumazet <edumazet@google.com>
TO: "David S . Miller" <davem@davemloft.net>
TO: Jakub Kicinski <kuba@kernel.org>
TO: Paolo Abeni <pabeni@redhat.com>
CC: Willem de Bruijn <willemb@google.com>
CC: Jamal Hadi Salim <jhs@mojatatu.com>
CC: Cong Wang <xiyou.wangcong@gmail.com>
CC: Jiri Pirko <jiri@resnulli.us>
CC: netdev@vger.kernel.org
CC: eric.dumazet@gmail.com
CC: Eric Dumazet <edumazet@google.com>

Hi Eric,

kernel test robot noticed the following build warnings:

[auto build test WARNING on net-next/main]

url:    https://github.com/intel-lab-lkp/linux/commits/Eric-Dumazet/net_sched-sch_fq-struct-sched_data-reorg/20230920-205744
base:   net-next/main
patch link:    https://lore.kernel.org/r/20230920125418.3675569-4-edumazet%40google.com
patch subject: [PATCH net-next 3/4] net_sched: sch_fq: add fast path for mostly idle qdisc
:::::: branch date: 5 days ago
:::::: commit date: 5 days ago
config: x86_64-randconfig-123-20230925 (https://download.01.org/0day-ci/archive/20230925/202309252000.LAvn3XwF-lkp@intel.com/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20230925/202309252000.LAvn3XwF-lkp@intel.com/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/r/202309252000.LAvn3XwF-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
>> net/sched/sch_fq.c:550:1: sparse: sparse: unused label 'queue'

vim +/queue +550 net/sched/sch_fq.c

39d010504e6b44 Eric Dumazet 2020-05-01  505  
b2377bef637585 Eric Dumazet 2023-09-20  506  
520ac30f45519b Eric Dumazet 2016-06-21  507  static int fq_enqueue(struct sk_buff *skb, struct Qdisc *sch,
520ac30f45519b Eric Dumazet 2016-06-21  508  		      struct sk_buff **to_free)
afe4fd062416b1 Eric Dumazet 2013-08-29  509  {
afe4fd062416b1 Eric Dumazet 2013-08-29  510  	struct fq_sched_data *q = qdisc_priv(sch);
afe4fd062416b1 Eric Dumazet 2013-08-29  511  	struct fq_flow *f;
afe4fd062416b1 Eric Dumazet 2013-08-29  512  
afe4fd062416b1 Eric Dumazet 2013-08-29  513  	if (unlikely(sch->q.qlen >= sch->limit))
520ac30f45519b Eric Dumazet 2016-06-21  514  		return qdisc_drop(skb, sch, to_free);
afe4fd062416b1 Eric Dumazet 2013-08-29  515  
b2377bef637585 Eric Dumazet 2023-09-20  516  	q->ktime_cache = ktime_get_ns();
39d010504e6b44 Eric Dumazet 2020-05-01  517  	if (!skb->tstamp) {
b2377bef637585 Eric Dumazet 2023-09-20  518  		fq_skb_cb(skb)->time_to_send = q->ktime_cache;
39d010504e6b44 Eric Dumazet 2020-05-01  519  	} else {
b2377bef637585 Eric Dumazet 2023-09-20  520  		/* Check if packet timestamp is too far in the future. */
39d010504e6b44 Eric Dumazet 2020-05-01  521  		if (fq_packet_beyond_horizon(skb, q)) {
39d010504e6b44 Eric Dumazet 2020-05-01  522  			if (q->horizon_drop) {
39d010504e6b44 Eric Dumazet 2020-05-01  523  					q->stat_horizon_drops++;
39d010504e6b44 Eric Dumazet 2020-05-01  524  					return qdisc_drop(skb, sch, to_free);
39d010504e6b44 Eric Dumazet 2020-05-01  525  			}
39d010504e6b44 Eric Dumazet 2020-05-01  526  			q->stat_horizon_caps++;
39d010504e6b44 Eric Dumazet 2020-05-01  527  			skb->tstamp = q->ktime_cache + q->horizon;
39d010504e6b44 Eric Dumazet 2020-05-01  528  		}
39d010504e6b44 Eric Dumazet 2020-05-01  529  		fq_skb_cb(skb)->time_to_send = skb->tstamp;
39d010504e6b44 Eric Dumazet 2020-05-01  530  	}
39d010504e6b44 Eric Dumazet 2020-05-01  531  
b2377bef637585 Eric Dumazet 2023-09-20  532  	f = fq_classify(sch, skb);
afe4fd062416b1 Eric Dumazet 2013-08-29  533  	if (unlikely(f->qlen >= q->flow_plimit && f != &q->internal)) {
afe4fd062416b1 Eric Dumazet 2013-08-29  534  		q->stat_flows_plimit++;
520ac30f45519b Eric Dumazet 2016-06-21  535  		return qdisc_drop(skb, sch, to_free);
afe4fd062416b1 Eric Dumazet 2013-08-29  536  	}
afe4fd062416b1 Eric Dumazet 2013-08-29  537  
afe4fd062416b1 Eric Dumazet 2013-08-29  538  	if (fq_flow_is_detached(f)) {
afe4fd062416b1 Eric Dumazet 2013-08-29  539  		fq_flow_add_tail(&q->new_flows, f);
f52ed89971adbe Eric Dumazet 2013-11-15  540  		if (time_after(jiffies, f->age + q->flow_refill_delay))
f52ed89971adbe Eric Dumazet 2013-11-15  541  			f->credit = max_t(u32, f->credit, q->quantum);
afe4fd062416b1 Eric Dumazet 2013-08-29  542  	}
f52ed89971adbe Eric Dumazet 2013-11-15  543  
afe4fd062416b1 Eric Dumazet 2013-08-29  544  	if (unlikely(f == &q->internal)) {
afe4fd062416b1 Eric Dumazet 2013-08-29  545  		q->stat_internal_packets++;
b2377bef637585 Eric Dumazet 2023-09-20  546  	} else {
b2377bef637585 Eric Dumazet 2023-09-20  547  		if (f->qlen == 0)
b2377bef637585 Eric Dumazet 2023-09-20  548  			q->inactive_flows--;
afe4fd062416b1 Eric Dumazet 2013-08-29  549  	}
b2377bef637585 Eric Dumazet 2023-09-20 @550  queue:
b2377bef637585 Eric Dumazet 2023-09-20  551  	f->qlen++;
b2377bef637585 Eric Dumazet 2023-09-20  552  	/* Note: this overwrites f->age */
b2377bef637585 Eric Dumazet 2023-09-20  553  	flow_queue_add(f, skb);
b2377bef637585 Eric Dumazet 2023-09-20  554  
b2377bef637585 Eric Dumazet 2023-09-20  555  	qdisc_qstats_backlog_inc(sch, skb);
afe4fd062416b1 Eric Dumazet 2013-08-29  556  	sch->q.qlen++;
afe4fd062416b1 Eric Dumazet 2013-08-29  557  
afe4fd062416b1 Eric Dumazet 2013-08-29  558  	return NET_XMIT_SUCCESS;
afe4fd062416b1 Eric Dumazet 2013-08-29  559  }
afe4fd062416b1 Eric Dumazet 2013-08-29  560  

-- 
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2023-09-25 12:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-20 12:54 [PATCH net-next 0/4] net_sched: sch_fq: round of improvements Eric Dumazet
2023-09-20 12:54 ` [PATCH net-next 1/4] net_sched: sch_fq: struct sched_data reorg Eric Dumazet
2023-09-20 12:54 ` [PATCH net-next 2/4] net_sched: sch_fq: change how @inactive is tracked Eric Dumazet
2023-09-20 12:54 ` [PATCH net-next 3/4] net_sched: sch_fq: add fast path for mostly idle qdisc Eric Dumazet
2023-09-20 14:09   ` kernel test robot
2023-09-25  2:25   ` kernel test robot
2023-09-20 12:54 ` [PATCH net-next 4/4] net_sched: sch_fq: always garbage collect Eric Dumazet
  -- strict thread matches above, loose matches on Subject: below --
2023-09-25 12:27 [PATCH net-next 3/4] net_sched: sch_fq: add fast path for mostly idle qdisc kernel test robot

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.