[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date: Fri, 19 Aug 2016 22:25:01 -0700 (PDT)
From: David Miller <davem@...emloft.net>
To: eric.dumazet@...il.com
Cc: cascardo@...hat.com, dev@...nvswitch.org, netdev@...r.kernel.org
Subject: Re: [RFC PATCH] openvswitch: use percpu flow stats
From: Eric Dumazet <eric.dumazet@...il.com>
Date: Fri, 19 Aug 2016 21:07:52 -0700
> Here is an example of a system I had in the past.
>
> 8 cpus (num_possible_cpus() returns 8)
>
> Cpus were numbered : 0, 1, 2, 3, 8, 9, 10, 11 : (nr_cpu_ids = 12)
>
> I am pretty sure they are still alive.
>
> Since you want an array indexed by cpu numbers, you need to size it by
> nr_cpu_ids, otherwise array[11] will crash / access garbage.
>
> This is why you find many nr_cpu_ids in the linux tree, not
> num_possible_cpus() to size arrays.
My bad, I misunderstood what nr_cpu_ids means. You are absolutely right.
Powered by blists - more mailing lists