From: Kirill Tkhai <tkhai@yandex.ru>
To: Peter Zijlstra <peterz@infradead.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Ingo Molnar <mingo@redhat.com>,
Kirill Tkhai <ktkhai@parallels.com>,
"oleg@redhat.com" <oleg@redhat.com>,
"linux@roeck-us.net" <linux@roeck-us.net>,
"ralf@linux-mips.org" <ralf@linux-mips.org>,
"tony.luck@intel.com" <tony.luck@intel.com>,
"linux-mips@linux-mips.org" <linux-mips@linux-mips.org>,
"linux-ia64@vger.kernel.org" <linux-ia64@vger.kernel.org>
Subject: Re: [RFC][PATCH] sched,mips,ia64: Remove __ARCH_WANT_UNLOCKED_CTXSW
Date: Tue, 23 Sep 2014 19:16:44 +0400 [thread overview]
Message-ID: <32571411485404@web24g.yandex.ru> (raw)
In-Reply-To: <20140923150641.GH3312@worktop.programming.kicks-ass.net>
23.09.2014, 19:06, "Peter Zijlstra" <peterz@infradead.org>:
> On Mon, Sep 22, 2014 at 10:36:18PM +0400, Kirill Tkhai wrote:
>> From: Kirill Tkhai <ktkhai@parallels.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@redhat.com>
> Cc: Guenter Roeck <linux@roeck-us.net>
> Cc: Ralf Baechle <ralf@linux-mips.org>
> Cc: Tony Luck <tony.luck@intel.com>
> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org>
Reviewed-by: Kirill Tkhai <ktkhai@parallels.com> (one more review of ia64 part)
next prev parent reply other threads:[~2014-09-23 15:16 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20140922183612.11015.64200.stgit@localhost>
[not found] ` <20140922183618.11015.95007.stgit@localhost>
2014-09-23 15:06 ` [RFC][PATCH] sched,mips,ia64: Remove __ARCH_WANT_UNLOCKED_CTXSW Peter Zijlstra
2014-09-23 15:16 ` Kirill Tkhai [this message]
2014-09-23 19:45 ` Guenter Roeck
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=32571411485404@web24g.yandex.ru \
--to=tkhai@yandex.ru \
--cc=ktkhai@parallels.com \
--cc=linux-ia64@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@linux-mips.org \
--cc=linux@roeck-us.net \
--cc=mingo@redhat.com \
--cc=oleg@redhat.com \
--cc=peterz@infradead.org \
--cc=ralf@linux-mips.org \
--cc=tony.luck@intel.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox