From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1929C433EF for ; Wed, 9 Feb 2022 19:58:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230116AbiBIT6j (ORCPT ); Wed, 9 Feb 2022 14:58:39 -0500 Received: from gmail-smtp-in.l.google.com ([23.128.96.19]:48406 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230016AbiBIT6f (ORCPT ); Wed, 9 Feb 2022 14:58:35 -0500 X-Greylist: delayed 78 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Wed, 09 Feb 2022 11:58:33 PST Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5364EE0497B4 for ; Wed, 9 Feb 2022 11:58:33 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sin.source.kernel.org (Postfix) with ESMTPS id 99663CE228E for ; Wed, 9 Feb 2022 19:58:31 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87A0EC340E7; Wed, 9 Feb 2022 19:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644436710; bh=Jys0zUIlLh9UgNKBmxECnOEy0ha/NfM8jGt9IxYZ7lE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SQIVjvCsY26YgzmSVRipVZOe2gtM14cZc5P1IB6wgrysXbK0j0qsZmMWSfqQrZas/ KLwLwlq53LoM8ldljADwKtwXOy222owFug5NYZb8KUhNS96m1VweiIsrcV3jbWNqUp wMt4opnpTe4NGAQiCK7MO3t/qsojBI5akm23J5LNaRZUstss2sEne51Y3lg5MWoICj 9oW2vjbf4jpIRs+rMJJPfp1UADQPB1dSYKgyJBYwvtqYF5X6qyiHpe2PhFLW8mR0PY RwKtkXhHVitKx3FEyGj+3k35rQg6ur5dWdanQyBnFRQCvZe8gSAfUqMPQvRs5Mjy6p CBzDxEnK10NOA== Date: Wed, 9 Feb 2022 20:58:27 +0100 From: Frederic Weisbecker To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, ardb@kernel.org, bp@alien8.de, catalin.marinas@arm.com, dave.hansen@linux.intel.com, james.morse@arm.com, joey.gouly@arm.com, juri.lelli@redhat.com, linux-kernel@vger.kernel.org, luto@kernel.org, mingo@redhat.com, peterz@infradead.org, tglx@linutronix.de, valentin.schneider@arm.com, will@kernel.org Subject: Re: [PATCH v3 0/7] arm64 / sched/preempt: support PREEMPT_DYNAMIC with static keys Message-ID: <20220209195827.GB557593@lothringen> References: <20220209153535.818830-1-mark.rutland@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220209153535.818830-1-mark.rutland@arm.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Feb 09, 2022 at 03:35:28PM +0000, Mark Rutland wrote: > This series enables PREEMPT_DYNAMIC on arm64. To do so, it adds a new > mechanism allowing the preemption functions to be enabled/disabled using > static keys rather than static calls, with architectures selecting > whether they use static calls or static keys. > > With non-inline static calls, each function call results in a call to > the (out-of-line) trampoline which either tail-calls its associated > callee or performs an early return. > > The key idea is that where we're only enabling/disabling a single > callee, we can inline this trampoline into the start of the callee, > using a static key to decide whether to return early, and leaving the > remaining codegen to the compiler. The overhead should be similar to > (and likely lower than) using a static call trampoline. Since most > codegen is up to the compiler, we sidestep a number of implementation > pain-points (e.g. things like CFI should "just work" as well as they do > for any other functions). > > The bulk of the diffstat for kernel/sched/core.c is shuffling the > PREEMPT_DYNAMIC code later in the file, and the actual additions are > fairly trivial. > > I've given this very light build+boot testing so far. > > Since v1 [1]: > * Rework Kconfig text to be clearer > * Rework arm64 entry code > * Clarify commit messages. > > Since v2 [2]: > * Add missing includes > * Always provide prototype for preempt_schedule() > * Always provide prototype for preempt_schedule_notrace() > * Fix __cond_resched() to default to disabled > * Fix might_resched() to default to disabled > * Clarify example in commit message Acked-by: Frederic Weisbecker Thanks! From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 3155FC433F5 for ; Wed, 9 Feb 2022 19:59:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=TtFiLOtGzjZ1cM76EjatQHYaRx3iidQNPmg6xuNSwKk=; b=j8R0nBIMiOo0sG YStBoAodZGPOCvriimyTSCSl6OdYroCnHpeYDSPjQI3/NmbYngkksiW7iqLjkt9IjriwBf7XWmPYy FSdLKDor3S58yAxGGIDAJBBDmhaOpxO8VmPREpo1yDkeS9sdED08nR6ldlXYQ2cUTL3CfhbcZzPVK j089Q5nEmPy+u0yRyyKdXiGPt0Mbj1C5NxJb/d0jrpZ3uzYUgNyH0YvNTcBuFX7j5d1VYla8aNHzi Q6XY0Pk0VzQ96kQiib5DBnWtqcqXTsEeYnU89CrLDirvi4haDxpbuzAp3RJMyRAVkEL6o2s0vDv6U sJLfpb+s6KDduy/54HMw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHt6o-001Rfz-JX; Wed, 09 Feb 2022 19:58:34 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nHt6l-001Rec-2f for linux-arm-kernel@lists.infradead.org; Wed, 09 Feb 2022 19:58:32 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A30A261A6C; Wed, 9 Feb 2022 19:58:30 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 87A0EC340E7; Wed, 9 Feb 2022 19:58:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1644436710; bh=Jys0zUIlLh9UgNKBmxECnOEy0ha/NfM8jGt9IxYZ7lE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SQIVjvCsY26YgzmSVRipVZOe2gtM14cZc5P1IB6wgrysXbK0j0qsZmMWSfqQrZas/ KLwLwlq53LoM8ldljADwKtwXOy222owFug5NYZb8KUhNS96m1VweiIsrcV3jbWNqUp wMt4opnpTe4NGAQiCK7MO3t/qsojBI5akm23J5LNaRZUstss2sEne51Y3lg5MWoICj 9oW2vjbf4jpIRs+rMJJPfp1UADQPB1dSYKgyJBYwvtqYF5X6qyiHpe2PhFLW8mR0PY RwKtkXhHVitKx3FEyGj+3k35rQg6ur5dWdanQyBnFRQCvZe8gSAfUqMPQvRs5Mjy6p CBzDxEnK10NOA== Date: Wed, 9 Feb 2022 20:58:27 +0100 From: Frederic Weisbecker To: Mark Rutland Cc: linux-arm-kernel@lists.infradead.org, ardb@kernel.org, bp@alien8.de, catalin.marinas@arm.com, dave.hansen@linux.intel.com, james.morse@arm.com, joey.gouly@arm.com, juri.lelli@redhat.com, linux-kernel@vger.kernel.org, luto@kernel.org, mingo@redhat.com, peterz@infradead.org, tglx@linutronix.de, valentin.schneider@arm.com, will@kernel.org Subject: Re: [PATCH v3 0/7] arm64 / sched/preempt: support PREEMPT_DYNAMIC with static keys Message-ID: <20220209195827.GB557593@lothringen> References: <20220209153535.818830-1-mark.rutland@arm.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220209153535.818830-1-mark.rutland@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220209_115831_197440_64F79525 X-CRM114-Status: GOOD ( 23.04 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Feb 09, 2022 at 03:35:28PM +0000, Mark Rutland wrote: > This series enables PREEMPT_DYNAMIC on arm64. To do so, it adds a new > mechanism allowing the preemption functions to be enabled/disabled using > static keys rather than static calls, with architectures selecting > whether they use static calls or static keys. > > With non-inline static calls, each function call results in a call to > the (out-of-line) trampoline which either tail-calls its associated > callee or performs an early return. > > The key idea is that where we're only enabling/disabling a single > callee, we can inline this trampoline into the start of the callee, > using a static key to decide whether to return early, and leaving the > remaining codegen to the compiler. The overhead should be similar to > (and likely lower than) using a static call trampoline. Since most > codegen is up to the compiler, we sidestep a number of implementation > pain-points (e.g. things like CFI should "just work" as well as they do > for any other functions). > > The bulk of the diffstat for kernel/sched/core.c is shuffling the > PREEMPT_DYNAMIC code later in the file, and the actual additions are > fairly trivial. > > I've given this very light build+boot testing so far. > > Since v1 [1]: > * Rework Kconfig text to be clearer > * Rework arm64 entry code > * Clarify commit messages. > > Since v2 [2]: > * Add missing includes > * Always provide prototype for preempt_schedule() > * Always provide prototype for preempt_schedule_notrace() > * Fix __cond_resched() to default to disabled > * Fix might_resched() to default to disabled > * Clarify example in commit message Acked-by: Frederic Weisbecker Thanks! _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel