From patchwork Mon Jul 28 18:58:03 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Oleg Nesterov X-Patchwork-Id: 4636321 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id AC6B09F32F for ; Mon, 28 Jul 2014 19:03:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id D7B212020E for ; Mon, 28 Jul 2014 19:03:10 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 071CC2018B for ; Mon, 28 Jul 2014 19:03:09 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XBq9s-0005i1-Fp; Mon, 28 Jul 2014 19:00:28 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XBq9q-0004fJ-3W for linux-arm-kernel@lists.infradead.org; Mon, 28 Jul 2014 19:00:26 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id s6SIxjqR008754 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Jul 2014 14:59:46 -0400 Received: from tranklukator.brq.redhat.com (dhcp-1-191.brq.redhat.com [10.34.1.191]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with SMTP id s6SIxfIn019986; Mon, 28 Jul 2014 14:59:42 -0400 Received: by tranklukator.brq.redhat.com (nbSMTP-1.00) for uid 500 oleg@redhat.com; Mon, 28 Jul 2014 20:58:07 +0200 (CEST) Date: Mon, 28 Jul 2014 20:58:03 +0200 From: Oleg Nesterov To: Andy Lutomirski , Frederic Weisbecker , "Paul E. McKenney" Subject: TIF_NOHZ can escape nonhz mask? (Was: [PATCH v3 6/8] x86: Split syscall_trace_enter into two phases) Message-ID: <20140728185803.GA24663@redhat.com> References: <3f649f5658a163645e3ce15156176c325283762e.1405992946.git.luto@amacapital.net> <20140728173723.GA20993@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20140728173723.GA20993@redhat.com> User-Agent: Mutt/1.5.18 (2008-05-17) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.22 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140728_120026_200043_FD2D3C11 X-CRM114-Status: UNSURE ( 9.14 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -5.7 (-----) Cc: linux-arch@vger.kernel.org, linux-mips@linux-mips.org, Will Drewry , Kees Cook , x86@kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, hpa@zytor.com, linux-arm-kernel@lists.infradead.org, Alexei Starovoitov X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-2.6 required=5.0 tests=BAYES_00,RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Off-topic, but... On 07/28, Oleg Nesterov wrote: > > But we should always call user_exit() unconditionally? Frederic, don't we need the patch below? In fact clear_() can be moved under "if ()" too. and probably copy_process() should clear this flag... Or. __context_tracking_task_switch() can simply do if (context_tracking_cpu_is_enabled()) set_tsk_thread_flag(next, TIF_NOHZ); else clear_tsk_thread_flag(next, TIF_NOHZ); and then we can forget about copy_process(). Or I am totally confused? I am also wondering if we can extend user_return_notifier to handle enter/exit and kill TIF_NOHZ. Oleg. --- x/kernel/context_tracking.c +++ x/kernel/context_tracking.c @@ -202,7 +202,8 @@ void __context_tracking_task_switch(stru struct task_struct *next) { clear_tsk_thread_flag(prev, TIF_NOHZ); - set_tsk_thread_flag(next, TIF_NOHZ); + if (context_tracking_cpu_is_enabled()) + set_tsk_thread_flag(next, TIF_NOHZ); } #ifdef CONFIG_CONTEXT_TRACKING_FORCE