From: Li Zhong <zhong@linux.vnet.ibm.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Steven Rostedt <rostedt@goodmis.org>,
linux-kernel@vger.kernel.org,
"Paul E. McKenney" <paulmck@us.ibm.com>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>,
Thomas Gleixner <tglx@linutronix.de>,
"H. Peter Anvin" <hpa@zytor.com>
Subject: Re: [PATCH 1/3] x86/sched/context_tracking: Call new schedule_preempt_user() from entry_64.S
Date: Wed, 15 May 2013 09:38:50 +0800 [thread overview]
Message-ID: <1368581930.2618.109.camel@ThinkPad-T5421> (raw)
In-Reply-To: <20130514141306.GB19719@somewhere>
On Tue, 2013-05-14 at 16:13 +0200, Frederic Weisbecker wrote:
> On Fri, May 10, 2013 at 05:12:26PM -0400, Steven Rostedt wrote:
> > +/*
> > + * This is a entry point to the scheduler() just before going
> > + * back to user space. This is called with irqs disabled
> > + * which prevents races with the CONTEXT_TRACKING updates.
> > + */
> > +asmlinkage void __sched schedule_preempt_user(void)
> > +{
> > + enum ctx_state prev_state;
> > +
> > + prev_state = exception_enter();
> > +
> > + local_irq_enable();
> > + __schedule();
> > + local_irq_disable();
> > +
> > + exception_exit(prev_state);
> > +}
>
> Ok I just had a look at how ARM and PPC64 are handling user preemption and it seems
> that irqs are disabled around the call to schedule() on these archs too. Although
> do_work_pending() in ARM surprisingly doesn't re-enable irqs before calling schedule?
>
> Anyway having irqs disabled around user preemption seem to be a requirement to make
> sure the TIF_NEED_RESCHED check is not racy against irqs and return to userspace.
> So I guess we can keep the above function as it is.
>
> But perhaps we should queue this for 3.11 given that it's a bit of a sensitive change
> in the x86 user return path.
>
> Look, I'm just going to make a seperate pull request with this patch based on 3.10-rc1
> and let Ingo choose the target.
Could the deletion of schedule_user() be separated to another patch. So
for other archs, such as ppc64, we could have both
schedule_preempt_user() and schedule_user() there for the conversion?
Or are there some better ways to avoid the conflict with arch trees?
Thanks, Zhong
>
> (Meanwhile I still think it would be a good idea to keep LOCKDEP_SYS_EXIT in the loop :-)
>
> Thanks!
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
next prev parent reply other threads:[~2013-05-15 1:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-05-10 21:12 [PATCH 0/3] nohz: Some fixes and updates Steven Rostedt
2013-05-10 21:12 ` [PATCH 1/3] x86/sched/context_tracking: Call new schedule_preempt_user() from entry_64.S Steven Rostedt
2013-05-11 1:36 ` Frederic Weisbecker
2013-05-13 9:56 ` Li Zhong
2013-05-13 15:03 ` Steven Rostedt
2013-05-14 9:44 ` Li Zhong
2013-05-14 14:13 ` Frederic Weisbecker
2013-05-15 1:38 ` Li Zhong [this message]
2013-05-10 21:12 ` [PATCH 2/3] nohz: Disable LOCKUP_DETECTOR when NO_HZ_FULL is enabled Steven Rostedt
2013-05-10 21:12 ` [PATCH 3/3] nohz: Warn if the machine can not perform nohz_full Steven Rostedt
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=1368581930.2618.109.camel@ThinkPad-T5421 \
--to=zhong@linux.vnet.ibm.com \
--cc=akpm@linux-foundation.org \
--cc=fweisbec@gmail.com \
--cc=hpa@zytor.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=paulmck@us.ibm.com \
--cc=rostedt@goodmis.org \
--cc=tglx@linutronix.de \
/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
Powered by JetHome