lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YCu0wleNK9a/rUWr@hirez.programming.kicks-ass.net>
Date:   Tue, 16 Feb 2021 13:04:18 +0100
From:   Peter Zijlstra <peterz@...radead.org>
To:     Nadav Amit <nadav.amit@...il.com>
Cc:     Thomas Gleixner <tglx@...utronix.de>, linux-kernel@...r.kernel.org,
        Andy Lutomirski <luto@...nel.org>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        Nadav Amit <namit@...are.com>, Rik van Riel <riel@...riel.com>,
        Josh Poimboeuf <jpoimboe@...hat.com>
Subject: Re: [PATCH v5 1/8] smp: Run functions concurrently in
 smp_call_function_many_cond()

On Tue, Feb 09, 2021 at 02:16:46PM -0800, Nadav Amit wrote:
> @@ -894,17 +911,12 @@ EXPORT_SYMBOL(on_each_cpu_mask);
>  void on_each_cpu_cond_mask(smp_cond_func_t cond_func, smp_call_func_t func,
>  			   void *info, bool wait, const struct cpumask *mask)
>  {
> -	int cpu = get_cpu();
> +	unsigned int scf_flags = SCF_RUN_LOCAL;
>  
> -	smp_call_function_many_cond(mask, func, info, wait, cond_func);
> -	if (cpumask_test_cpu(cpu, mask) && cond_func(cpu, info)) {
> -		unsigned long flags;
> +	if (wait)
> +		scf_flags |= SCF_WAIT;
>  
> -		local_irq_save(flags);
> -		func(info);
> -		local_irq_restore(flags);
> -	}
> -	put_cpu();
> +	smp_call_function_many_cond(mask, func, info, scf_flags, cond_func);
>  }
>  EXPORT_SYMBOL(on_each_cpu_cond_mask);

You lost the preempt_disable() there, I've added it back:

---
--- a/kernel/smp.c
+++ b/kernel/smp.c
@@ -920,7 +920,9 @@ void on_each_cpu_cond_mask(smp_cond_func
 	if (wait)
 		scf_flags |= SCF_WAIT;
 
+	preempt_disable();
 	smp_call_function_many_cond(mask, func, info, scf_flags, cond_func);
+	preempt_enable();
 }
 EXPORT_SYMBOL(on_each_cpu_cond_mask);
 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ