Thread (84 messages) 84 messages, 6 authors, 2019-03-19

Re: [PATCH v7 01/15] sched/core: uclamp: Add CPU's clamp buckets refcounting

From: Patrick Bellasi <hidden>
Date: 2019-03-13 18:22:36
Also in: linux-pm, lkml

On 13-Mar 18:22, Peter Zijlstra wrote:
On Wed, Mar 13, 2019 at 04:12:29PM +0000, Patrick Bellasi wrote:
quoted
Yes, the for looks better, but perhaps like that:

	unsigned int bucket_id = UCLAMP_BUCKETS;

 	/*
 	 * Both min and max clamps are MAX aggregated, thus the topmost
 	 * bucket with some tasks defines the rq's clamp value.
 	 */
	for (; bucket_id >= 0; --bucket_id) {
GCC will be clever and figure that unsigned will never be smaller than 0
and turn the above into an infinite loop or something daft.

That is; use 'int', not 'unsigned int' for bucket_id.
Right, which remembers me now why I originally went for a do { } while();

-- 
#include <best/regards.h>

Patrick Bellasi
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help