[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <36fc5ec8-12a3-fc04-a8da-59d4e08e41b6@rasmusvillemoes.dk>
Date: Fri, 23 Sep 2022 14:19:14 +0200
From: Rasmus Villemoes <linux@...musvillemoes.dk>
To: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>,
Yury Norov <yury.norov@...il.com>, linux-kernel@...r.kernel.org
Cc: Phil Auld <pauld@...hat.com>
Subject: Re: [PATCH v2 1/1] cpumask: Don't waste memory for sysfs cpulist
nodes
On 22/09/2022 21.49, Andy Shevchenko wrote:
> + * which allows to count the exact maximum length in the worst case,
> + * i.e. when each second CPU is being listed.
I don't think that's actually the worst case. I think that would be
where 2 out of 3 cpus are listed. I.e., with 16 cpus
0-1,3-4,6-7,9-10,12-13,15
is certainly longer than
0,2,4,6,8,10,12,14
It's trivial to see that no bitmap with four consecutive bits can be a
worst-case, and any bitmap with some three consecutive bits is as bad as
the same one with the middle bit cleared (the rep just changes a - to a
,), so the worst case is definitely obtained among bitmaps with at most
two consecutive bits.
Rasmus
Powered by blists - more mailing lists