mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Chris Metcalf <cmetcalf@ezchip.com>
To: Frederic Weisbecker <fweisbec@gmail.com>
Cc: <linux-kernel@vger.kernel.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Gilad Ben-Yossef <gilad@benyossef.com>,
	"H. Peter Anvin" <hpa@zytor.com>, Ingo Molnar <mingo@kernel.org>,
	Li Zhong <zhong@linux.vnet.ibm.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>,
	Peter Zijlstra <peterz@infradead.org>,
	Steven Rostedt <rostedt@goodmis.org>,
	Thomas Gleixner <tglx@linutronix.de>
Subject: Re: [PATCH 2/4] tile: support CONTEXT_TRACKING and thus NOHZ_FULL
Date: Tue, 24 Mar 2015 17:49:43 -0400	[thread overview]
Message-ID: <5511DBF7.2010404@ezchip.com> (raw)
In-Reply-To: <20150324211513.GB11409@lerouge>

On 3/24/2015 5:15 PM, Frederic Weisbecker wrote:
> On Tue, Mar 24, 2015 at 03:21:33PM -0400, cmetcalf@ezchip.com wrote:
>> From: Chris Metcalf <cmetcalf@ezchip.com>
>>
>> Add the TIF_NOHZ flag appropriately.
>>
>> Add call to user_exit() on entry to do_work_pending() and on entry
>> to syscalls via do_syscall_trace_enter(), and also the top of
>> do_syscall_trace_exit() just because it's done in x86.
> You only need to protect do_syscall_trace_exit() if there is a risk
> that something calls user_enter() before. x86 does it so because
> schedule_user() can be called before although I think we've changed
> schedule_user() to use exception_enter/exit. I should check if that
> user_exit() in do_syscall_trace_exit() is still necessary in x86.
>
> Anyway, calling user_exit() on context tracking kerne mode doesn't do
> any harm.

Yes, I see the exception_enter/exit in schedule_user().  I guess I will plan to
leave the user_exit() in for now, but if you conclude it's not necessary for x86,
I can remove it for tile as well at that point.

>> diff --git a/arch/tile/kernel/process.c b/arch/tile/kernel/process.c
>> index 48e5773dd0b7..b403c2e3e263 100644
>> --- a/arch/tile/kernel/process.c
>> +++ b/arch/tile/kernel/process.c
>> @@ -27,6 +27,7 @@
>>   #include <linux/kernel.h>
>>   #include <linux/tracehook.h>
>>   #include <linux/signal.h>
>> +#include <linux/context_tracking.h>
>>   #include <asm/stack.h>
>>   #include <asm/switch_to.h>
>>   #include <asm/homecache.h>
>> @@ -474,6 +475,8 @@ int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)
>>   	if (!user_mode(regs))
>>   		return 0;
>>   
>> +	user_exit();
>> +
>>   	/* Enable interrupts; they are disabled again on return to caller. */
>>   	local_irq_enable();
>>   
>> @@ -496,11 +499,12 @@ int do_work_pending(struct pt_regs *regs, u32 thread_info_flags)
>>   		tracehook_notify_resume(regs);
>>   		return 1;
>>   	}
>> -	if (thread_info_flags & _TIF_SINGLESTEP) {
>> +	if (thread_info_flags & _TIF_SINGLESTEP)
>>   		single_step_once(regs);
>> -		return 0;
>> -	}
>> -	panic("work_pending: bad flags %#x\n", thread_info_flags);
>> +
>> +	user_enter();
> So, do work pending is called from syscall exit only? Or does it concern
> interrupts, exceptions as well?

It's called on every return to userspace if the TIF flags require it.

> Well if it's always followed by a return to userspace, it should be fine.

Let me know if you'd like me to put your Acked-by on the commit. Thanks!

-- 
Chris Metcalf, EZChip Semiconductor
http://www.ezchip.com


  reply	other threads:[~2015-03-24 21:50 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-24 19:21 [PATCH 0/4] initial NOHZ_FULL support for tile cmetcalf
2015-03-24 19:21 ` [PATCH 1/4] tile: support arch_irq_work_raise cmetcalf
2015-03-24 21:00   ` Frederic Weisbecker
2015-03-24 21:14   ` Peter Zijlstra
2015-03-24 22:06     ` Chris Metcalf
2015-03-25  8:03       ` Peter Zijlstra
2015-03-24 19:21 ` [PATCH 2/4] tile: support CONTEXT_TRACKING and thus NOHZ_FULL cmetcalf
2015-03-24 21:15   ` Frederic Weisbecker
2015-03-24 21:49     ` Chris Metcalf [this message]
2015-03-24 19:21 ` [PATCH 3/4] nohz: add tick_nohz_full_clear_cpus() API cmetcalf
2015-03-30 16:20   ` Chris Metcalf
2015-03-30 16:41     ` Rik van Riel
2015-03-30 16:45       ` Chris Metcalf
2015-03-24 19:21 ` [PATCH 4/4] net: tile: don't send interrupts to nohz cores by default cmetcalf

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=5511DBF7.2010404@ezchip.com \
    --to=cmetcalf@ezchip.com \
    --cc=akpm@linux-foundation.org \
    --cc=fweisbec@gmail.com \
    --cc=gilad@benyossef.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=peterz@infradead.org \
    --cc=rostedt@goodmis.org \
    --cc=tglx@linutronix.de \
    --cc=zhong@linux.vnet.ibm.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

Powered by JetHome