From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753210AbbCXVP1 (ORCPT ); Tue, 24 Mar 2015 17:15:27 -0400 Received: from mail-wg0-f54.google.com ([74.125.82.54]:33123 "EHLO mail-wg0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752234AbbCXVPZ (ORCPT ); Tue, 24 Mar 2015 17:15:25 -0400 Date: Tue, 24 Mar 2015 22:15:17 +0100 From: Frederic Weisbecker To: cmetcalf@ezchip.com Cc: linux-kernel@vger.kernel.org, Andrew Morton , Gilad Ben-Yossef , "H. Peter Anvin" , Ingo Molnar , Li Zhong , "Paul E. McKenney" , Peter Zijlstra , Steven Rostedt , Thomas Gleixner Subject: Re: [PATCH 2/4] tile: support CONTEXT_TRACKING and thus NOHZ_FULL Message-ID: <20150324211513.GB11409@lerouge> References: <1427224895-30830-1-git-send-email-cmetcalf@ezchip.com> <1427224895-30830-3-git-send-email-cmetcalf@ezchip.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1427224895-30830-3-git-send-email-cmetcalf@ezchip.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 24, 2015 at 03:21:33PM -0400, cmetcalf@ezchip.com wrote: > From: Chris Metcalf > > 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. > 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 > #include > #include > +#include > #include > #include > #include > @@ -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? Well if it's always followed by a return to userspace, it should be fine.