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: <f3078a0e-0f2b-c773-228f-988087d0561a@scylladb.com>
Date:   Mon, 31 Jul 2017 09:03:09 +0300
From:   Avi Kivity <avi@...lladb.com>
To:     Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
        "Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Cc:     maged michael <maged.michael@...il.com>,
        Andrew Hunter <ahh@...gle.com>, gromer <gromer@...gle.com>,
        linux-kernel <linux-kernel@...r.kernel.org>,
        Peter Zijlstra <peterz@...radead.org>
Subject: Re: Udpated sys_membarrier() speedup patch, FYI



On 07/28/2017 12:02 AM, Mathieu Desnoyers wrote:
> ----- On Jul 27, 2017, at 4:58 PM, Mathieu Desnoyers mathieu.desnoyers@...icios.com wrote:
>
>> ----- On Jul 27, 2017, at 4:37 PM, Paul E. McKenney paulmck@...ux.vnet.ibm.com
>> wrote:
>>
>>> On Thu, Jul 27, 2017 at 11:04:13PM +0300, Avi Kivity wrote:
> [...]
>>>>> +
>>>>> +	this_cpu = raw_smp_processor_id();
>>>>> +	for_each_online_cpu(cpu) {
>>>>> +		struct task_struct *p;
>>>>> +
>>>>> +		if (cpu == this_cpu)
>>>>> +			continue;
>>>>> +		rcu_read_lock();
>>>>> +		p = task_rcu_dereference(&cpu_rq(cpu)->curr);
>>>>> +		if (p && p->mm == current->mm)
>>>>> +			__cpumask_set_cpu(cpu, tmpmask);
>>>> This gets you some false positives, if the CPU idled then mm will
>>>> not have changed.
>>> Good point!  The battery-powered embedded guys would probably prefer
>>> we not needlessly IPI idle CPUs.  We cannot rely on RCU's dyntick-idle
>>> state in nohz_full cases.  Not sure if is_idle_task() can be used
>>> safely, given things like play_idle().
>> Would changing the check in this loop to:
>>
>> if (p && !is_idle_task(p) && p->mm == current->mm) {
>>
>> work for you ?
> Avi, is there an optimization that allows current->mm to be non-null
> when the idle task is scheduled that I am missing ?
>
> I would have expected current->mm to be always NULL for idle
> tasks.
>
>

I remembered that current->mm does not change when switching to a kernel 
task, but my Kernlish is very rusty, or maybe it has changed.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ