lkml.org 
[lkml]   [2012]   [Feb]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] Avoid mask based num_possible_cpus and num_online_cpus -v5
On Fri, 03 Feb 2012 06:33:02 +1030
Rusty Russell <rusty@rustcorp.com.au> wrote:

> On Wed, 1 Feb 2012 14:01:25 -0800, Andrew Morton <akpm@linux-foundation.org> wrote:
> > > Though most of the callers of these two routines are init time (with few
> > > exceptions of runtime calls), it is cleaner to use variables
> > > and not go through this repeated mask based calculation.
> >
> > Looks good to me.
>
> But, I wonder who's asking num_possible_cpus(). It's not a very useful
> thing to know, though some arch's "know" it's contiguous, so can cheat.
>
> Optimizing it seems particularly foolish.

We're fools for optimisations!

> We either audit and wean
> everyone off who's using it incorrectly, or insist on contiguous CPU
> numbers and drop the mask altogether.

drivers/block/nvme.c looks like it's assuming a contiguous map. Maybe
also drivers/scsi/bnx2fc (wtf?). I didn't see anything else outside
arch code.



\
 
 \ /
  Last update: 2012-02-02 21:21    [W:0.132 / U:1.756 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site