Re: [PATCH 2/2 v4] sched: Rewrite per entity runnable load average tracking

From: Peter Zijlstra
Date: Tue Jul 29 2014 - 09:20:09 EST


On Tue, Jul 29, 2014 at 09:09:45AM +0800, Yuyang Du wrote:
> > > +#define subtract_until_zero(minuend, subtrahend) \
> > > + (subtrahend < minuend ? minuend - subtrahend : 0)
> >
> > WTH is a minuend or subtrahend? Are you a wordsmith in your spare time
> > and like to make up your own words?
> >
> > Also, isn't writing: x = max(0, x-y), far more readable to begin with?
> >
>
> Ok. IIUC, max() does not handle minus number super good, and we don't need the type
> overhead in max(), so still use my macro, but won't be wordsmith again, :)

The 'type' muck is compile time, it doesn't generate any code.

And max() deals just fine with negative numbers assuming you use signed
types, which you could force with max_t().
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/