From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752347AbbCXVuA (ORCPT ); Tue, 24 Mar 2015 17:50:00 -0400 Received: from mail-am1on0072.outbound.protection.outlook.com ([157.56.112.72]:24464 "EHLO emea01-am1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751916AbbCXVt5 (ORCPT ); Tue, 24 Mar 2015 17:49:57 -0400 Message-ID: <5511DBF7.2010404@ezchip.com> Date: Tue, 24 Mar 2015 17:49:43 -0400 From: Chris Metcalf User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Frederic Weisbecker CC: , 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 References: <1427224895-30830-1-git-send-email-cmetcalf@ezchip.com> <1427224895-30830-3-git-send-email-cmetcalf@ezchip.com> <20150324211513.GB11409@lerouge> In-Reply-To: <20150324211513.GB11409@lerouge> Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [173.76.21.154] X-ClientProxiedBy: BN3PR0401CA0015.namprd04.prod.outlook.com (25.162.159.153) To DB3PR02MB0537.eurprd02.prod.outlook.com (25.160.51.149) Authentication-Results: linutronix.de; dkim=none (message not signed) header.d=none; X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:DB3PR02MB0537; X-Microsoft-Antispam-PRVS: X-Forefront-Antispam-Report: BMV:1;SFV:NSPM;SFS:(10009020)(6049001)(6009001)(41574002)(51704005)(479174004)(52314003)(377454003)(33656002)(23746002)(66066001)(50466002)(1411001)(36756003)(65956001)(65806001)(87976001)(110136001)(47776003)(122386002)(83506001)(19580405001)(80316001)(19580395003)(62966003)(77156002)(54356999)(87266999)(65816999)(40100003)(50986999)(76176999)(2950100001)(42186005)(117156001)(92566002)(77096005)(575784001)(46102003)(64126003)(86362001)(15975445007)(59896002)(18886065003);DIR:OUT;SFP:1101;SCL:1;SRVR:DB3PR02MB0537;H:[192.168.1.160];FPR:;SPF:None;MLV:sfv;LANG:en; X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(5002010);SRVR:DB3PR02MB0537;BCL:0;PCL:0;RULEID:;SRVR:DB3PR02MB0537; X-Forefront-PRVS: 0525BB0ADF X-OriginatorOrg: ezchip.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 24 Mar 2015 21:49:51.8615 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB3PR02MB0537 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 >> >> 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 >> #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? 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