lkml.org 
[lkml]   [2018]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH 08/10] psi: pressure stall information for CPU, memory, and IO
On Wed, Jul 18, 2018 at 02:03:18PM +0200, Peter Zijlstra wrote:
> On Thu, Jul 12, 2018 at 01:29:40PM -0400, Johannes Weiner wrote:
> > + for (to = 0; (bo = ffs(set)); to += bo, set >>= bo)
> > + tasks[to + (bo - 1)]++;
>
> You want to benchmark this, but since it's only 3 consecutive bits, it
> might actually be faster to not use ffs() and simply test all 3 bits:
>
> for (to = set, bo = 0; to; to &= ~(1 << bo), bo++)

if (to & (1 << bo))

> tasks[bo]++;


\
 
 \ /
  Last update: 2018-07-18 14:22    [W:0.264 / U:3.984 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site