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: <32571411485404@web24g.yandex.ru>
Date:	Tue, 23 Sep 2014 19:16:44 +0400
From:	Kirill Tkhai <tkhai@...dex.ru>
To:	Peter Zijlstra <peterz@...radead.org>
Cc:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
	Ingo Molnar <mingo@...hat.com>,
	Kirill Tkhai <ktkhai@...allels.com>,
	"oleg@...hat.com" <oleg@...hat.com>,
	"linux@...ck-us.net" <linux@...ck-us.net>,
	"ralf@...ux-mips.org" <ralf@...ux-mips.org>,
	"tony.luck@...el.com" <tony.luck@...el.com>,
	"linux-mips@...ux-mips.org" <linux-mips@...ux-mips.org>,
	"linux-ia64@...r.kernel.org" <linux-ia64@...r.kernel.org>
Subject: Re: [RFC][PATCH] sched,mips,ia64: Remove __ARCH_WANT_UNLOCKED_CTXSW

23.09.2014, 19:06, "Peter Zijlstra" <peterz@...radead.org>:
> On Mon, Sep 22, 2014 at 10:36:18PM +0400, Kirill Tkhai wrote:
>>  From: Kirill Tkhai <ktkhai@...allels.com>
>>
>>  Architectures, which define __ARCH_WANT_UNLOCKED_CTXSW,
>>  may pull a task when it's in the middle of schedule().
>>
>>  CPU1(task1 calls schedule)            CPU2
>>  ...                                   schedule()
>>  ...                                      idle_balance()
>>  ...                                         load_balance()
>>  ...                                            ...
>>  schedule()                                     ...
>>     prepare_lock_switch()                       ...
>>        raw_spin_unlock(&rq1->lock)              ...
>>        ...                                      raw_spin_lock(&rq1->lock)
>>        ...                                         detach_tasks();
>>        ...                                            can_migrate_task(task1)
>>        ...                                         attach_tasks(); <--- move task1 to rq2
>>        ...                                      raw_spin_unlock(&rq1->lock)
>>        ...                                context_switch() <--- switch to task1's stack
>>        ...                                ...
>>     (using task1's stack)                 (using task1's stack)
>>     ...                                   ...
>>     context_switch()                      ...
>>
>>  Parallel use of a single stack is not a good idea.
>
> Indeed it is, but how about we do this instead?

Completely agree, looks good for me.

> ---
> Subject: sched,mips,ia64: Remove __ARCH_WANT_UNLOCKED_CTXSW
>
> Kirill found that there's a subtle race in the
> __ARCH_WANT_UNLOCKED_CTXSW code, and instead of fixing it, remove the
> entire exception because neither arch that uses it seems to actually
> still require it.
>
> Boot tested on mips64el (qemu) only.
>
> Cc: Oleg Nesterov <oleg@...hat.com>
> Cc: Guenter Roeck <linux@...ck-us.net>
> Cc: Ralf Baechle <ralf@...ux-mips.org>
> Cc: Tony Luck <tony.luck@...el.com>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@...radead.org>

Reviewed-by: Kirill Tkhai <ktkhai@...allels.com> (one more review of ia64 part)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ