From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753810AbcHQIF0 (ORCPT ); Wed, 17 Aug 2016 04:05:26 -0400 Received: from foss.arm.com ([217.140.101.70]:51123 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750927AbcHQIFW (ORCPT ); Wed, 17 Aug 2016 04:05:22 -0400 Date: Wed, 17 Aug 2016 09:05:31 +0100 From: Will Deacon To: Chris Metcalf Cc: Gilad Ben Yossef , Steven Rostedt , Ingo Molnar , Peter Zijlstra , Andrew Morton , Rik van Riel , Tejun Heo , Frederic Weisbecker , Thomas Gleixner , "Paul E. McKenney" , Christoph Lameter , Viresh Kumar , Catalin Marinas , Andy Lutomirski , Mark Rutland , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v15 07/13] arm64: factor work_pending state machine to C Message-ID: <20160817080531.GA5601@arm.com> References: <1471382376-5443-1-git-send-email-cmetcalf@mellanox.com> <1471382376-5443-8-git-send-email-cmetcalf@mellanox.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1471382376-5443-8-git-send-email-cmetcalf@mellanox.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 Hi Chris, On Tue, Aug 16, 2016 at 05:19:30PM -0400, Chris Metcalf wrote: > Currently ret_fast_syscall, work_pending, and ret_to_user form an ad-hoc > state machine that can be difficult to reason about due to duplicated > code and a large number of branch targets. > > This patch factors the common logic out into the existing > do_notify_resume function, converting the code to C in the process, > making the code more legible. > > This patch tries to closely mirror the existing behaviour while using > the usual C control flow primitives. As local_irq_{disable,enable} may > be instrumented, we balance exception entry (where we will almost most > likely enable IRQs) with a call to trace_hardirqs_on just before the > return to userspace. > > Signed-off-by: Chris Metcalf > --- > arch/arm64/kernel/entry.S | 12 ++++-------- > arch/arm64/kernel/signal.c | 36 ++++++++++++++++++++++++++---------- > 2 files changed, 30 insertions(+), 18 deletions(-) I plan to queue this one in the arm64 tree for 4.9. Should hit -next sometime next week. Will