From: David Miller <davem@davemloft.net>
To: eric.dumazet@gmail.com
Cc: cascardo@redhat.com, dev@openvswitch.org, netdev@vger.kernel.org
Subject: Re: [RFC PATCH] openvswitch: use percpu flow stats
Date: Fri, 19 Aug 2016 22:25:01 -0700 (PDT) [thread overview]
Message-ID: <20160819.222501.684301846870702801.davem@davemloft.net> (raw)
In-Reply-To: <1471666072.29842.123.camel@edumazet-glaptop3.roam.corp.google.com>
From: Eric Dumazet <eric.dumazet@gmail.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.
prev parent reply other threads:[~2016-08-20 5:25 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-08-19 19:47 [RFC PATCH] openvswitch: use percpu flow stats Thadeu Lima de Souza Cascardo
[not found] ` <1471636046-9246-1-git-send-email-cascardo-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>
2016-08-19 19:56 ` Eric Dumazet
[not found] ` <1471636616.29842.110.camel-XN9IlZ5yJG9HTL0Zs8A6p+yfmBU6pStAUsxypvmhUTTZJqsBc5GL+g@public.gmane.org>
2016-08-20 1:09 ` David Miller
[not found] ` <20160819.180953.970774471141286228.davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org>
2016-08-20 4:07 ` Eric Dumazet
2016-08-20 5:25 ` David Miller [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20160819.222501.684301846870702801.davem@davemloft.net \
--to=davem@davemloft.net \
--cc=cascardo@redhat.com \
--cc=dev@openvswitch.org \
--cc=eric.dumazet@gmail.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox