Thread (33 messages) 33 messages, 9 authors, 2021-12-15

Re: [PATCH 7/9] lib/cpumask: add num_{possible, present, active}_cpus_{eq, gt, le}

From: Emil Renner Berthing <hidden>
Date: 2021-11-28 18:02:22
Also in: kvm, linux-alpha, linux-crypto, linux-mips, linux-mm, linux-perf-users, linux-riscv, linux-s390, lkml

On Sun, 28 Nov 2021 at 18:43, Yury Norov [off-list ref] wrote:
On Sun, Nov 28, 2021 at 09:07:52AM -0800, Joe Perches wrote:
quoted
On Sat, 2021-11-27 at 19:57 -0800, Yury Norov wrote:
quoted
Add num_{possible,present,active}_cpus_{eq,gt,le} and replace num_*_cpus()
with one of new functions where appropriate. This allows num_*_cpus_*()
to return earlier depending on the condition.
[]
quoted
diff --git a/arch/arc/kernel/smp.c b/arch/arc/kernel/smp.c
[]
quoted
@@ -103,7 +103,7 @@ void __init smp_prepare_cpus(unsigned int max_cpus)
     * if platform didn't set the present map already, do it now
     * boot cpu is set to present already by init/main.c
     */
-   if (num_present_cpus() <= 1)
+   if (num_present_cpus_le(2))
            init_cpu_present(cpu_possible_mask);
?  is this supposed to be 2 or 1
X <= 1 is the equivalent of X < 2.
Ah, then the function is confusing. Usually it's lt = less than and lt
= less than or equal. Same idea for gt vs ge.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help