lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 20 Nov 2012 13:54:09 -0500 (EST)
From:	David Miller <davem@...emloft.net>
To:	paolo.valente@...more.it
Cc:	jhs@...atatu.com, shemminger@...tta.com,
	linux-kernel@...r.kernel.org, netdev@...r.kernel.org,
	rizzo@....unipi.it, fchecconi@...il.com
Subject: Re: [PATCH] pkt_sched: QFQ Plus: fair-queueing service at DRR cost

From: Paolo Valente <paolo.valente@...more.it>
Date: Tue, 20 Nov 2012 18:45:13 +0100

> -	struct sk_buff *skb;
> +	struct sk_buff *skb = NULL;

This is not really an improvement, now the compiler can think
that NULL is passed eventually into qdisc_bstats_update().

Please make the logic easier for the compiler to digest.

For example, restructure the top-level logic into something like:

	skb = NULL;
	if (!list_empty(&in_serv_agg->active))
		skb = qfq_peek_skb(in_serv_agg, &cl, &len);
	else
		len = 0; /* no more active classes in the in-service agg */

	if (len == 0 || in_serv_agg->budget < len) {
 ...
		/*
		 * If we get here, there are other aggregates queued:
		 * choose the new aggregate to serve.
		 */
		in_serv_agg = q->in_serv_agg = qfq_choose_next_agg(q);
		skb = qfq_peek_skb(in_serv_agg, &cl, &len);
	}
	if (!skb)
		return NULL;

That way it is clearer, to both humans and the compiler, what is
going on here.

Thanks.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ