Received: by 2002:a25:23cc:0:0:0:0:0 with SMTP id j195csp766819ybj; Tue, 5 May 2020 07:16:19 -0700 (PDT) X-Google-Smtp-Source: APiQypI+vHAJFOdtojurzSX4JFoVKrQIO7rw4PsO0DPQbQ2oK1JcbdjWuFmIoxwXp9FucY7Gt6ZA X-Received: by 2002:a17:906:4c8e:: with SMTP id q14mr3045109eju.208.1588688179043; Tue, 05 May 2020 07:16:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1588688179; cv=none; d=google.com; s=arc-20160816; b=OfyOoTeLzFFuS1Ly1VDO7X1AYKr6XXsyrwHjs1XEGtFcpwSQG0x67DtRetKSzt0K8t UE5ID+sPlgsoVoQR0dBdZIwP3dVgOaL0gMMDw3/Uff7ZfDW7m23JpkL8k0Hb0bnjdtuG OpXLhls8j8ahrsOc9W+zFhZiiELV0zPYbDf05wa10QlLj00lvjJYMGilGrA+8+an7zhn qMN7w/l4RiecELDRNBpb3e/2SMQPmLs+DmdgQNre+QBG8yD/36JJuHC5nDEXjavlOzvi ZlZT79BkqjWl3pHRElmuCXN8EPXQ+jsaRJZw/CAbZSGWzF4uuV6nyXzG8m+A6cPpNXNm ZMvA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:subject:cc:to:from:date:user-agent:message-id; bh=ZVgtUCrnoBEyO4ER15/9/X83+DQziqeYvzRRtyCYhsg=; b=MAlaCsIxVbdC+l/sGpawtDRqKLVYNVgYBNM3R874/RhxKU2HHqsJeb/vKjfebKX6Nd MW4+06P21DQxQAbZxfi/2YFsiCAjBj89/jePlBj6OywNTVcXBD5JbzDbHXIAiAJ7Vk9d +eL14g68bTGRP6HSI3WTcMuyAhcK788gG9w1A4veqn82wW51qcnBOHdQ0Bzp5D8fGDi9 x+14vwuJq6OU3jBJu0iuBWGQmEIO12HJ+s68WhKhHYZKnkjgHWJtzOFIr+QsqV7/irms viMH5RDubzk2vhr8byeRBJMzLL/eWbGTTLDjSp6ybLNIx7yqygfYK3KcaiSELC8YoSFT Gc9w== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id e8si1411072edl.2.2020.05.05.07.15.43; Tue, 05 May 2020 07:16:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729416AbgEEONu (ORCPT + 99 others); Tue, 5 May 2020 10:13:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48522 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1729216AbgEEONs (ORCPT ); Tue, 5 May 2020 10:13:48 -0400 Received: from Galois.linutronix.de (Galois.linutronix.de [IPv6:2a0a:51c0:0:12e:550::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D065AC0610D5 for ; Tue, 5 May 2020 07:13:47 -0700 (PDT) Received: from p5de0bf0b.dip0.t-ipconnect.de ([93.224.191.11] helo=nanos.tec.linutronix.de) by Galois.linutronix.de with esmtpsa (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1jVyJz-0000KY-6k; Tue, 05 May 2020 16:13:19 +0200 Received: from nanos.tec.linutronix.de (localhost [IPv6:::1]) by nanos.tec.linutronix.de (Postfix) with ESMTP id A3A0DFFC8D; Tue, 5 May 2020 16:13:18 +0200 (CEST) Message-Id: <20200505134058.453581595@linutronix.de> User-Agent: quilt/0.65 Date: Tue, 05 May 2020 15:16:06 +0200 From: Thomas Gleixner To: LKML Cc: x86@kernel.org, "Paul E. McKenney" , Andy Lutomirski , Alexandre Chartre , Frederic Weisbecker , Paolo Bonzini , Sean Christopherson , Masami Hiramatsu , Petr Mladek , Steven Rostedt , Joel Fernandes , Boris Ostrovsky , Juergen Gross , Brian Gerst , Mathieu Desnoyers , Josh Poimboeuf , Will Deacon Subject: [patch V4 part 1 04/36] sched: Make scheduler_ipi inline References: <20200505131602.633487962@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-transfer-encoding: 8-bit X-Linutronix-Spam-Score: -1.0 X-Linutronix-Spam-Level: - X-Linutronix-Spam-Status: No , -1.0 points, 5.0 required, ALL_TRUSTED=-1,SHORTCIRCUIT=-0.0001 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Now that the scheduler IPI is trivial and simple again there is no point to have the little function out of line. This simplifies the effort of constraining the instrumentation nicely. Signed-off-by: Thomas Gleixner --- include/linux/sched.h | 10 +++++++++- kernel/sched/core.c | 10 ---------- 2 files changed, 9 insertions(+), 11 deletions(-) --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -1719,7 +1719,15 @@ extern char *__get_task_comm(char *to, s }) #ifdef CONFIG_SMP -void scheduler_ipi(void); +static __always_inline void scheduler_ipi(void) +{ + /* + * Fold TIF_NEED_RESCHED into the preempt_count; anybody setting + * TIF_NEED_RESCHED remotely (for the first time) will also send + * this IPI. + */ + preempt_fold_need_resched(); +} extern unsigned long wait_task_inactive(struct task_struct *, long match_state); #else static inline void scheduler_ipi(void) { } --- a/kernel/sched/core.c +++ b/kernel/sched/core.c @@ -2312,16 +2312,6 @@ static void wake_csd_func(void *info) sched_ttwu_pending(); } -void scheduler_ipi(void) -{ - /* - * Fold TIF_NEED_RESCHED into the preempt_count; anybody setting - * TIF_NEED_RESCHED remotely (for the first time) will also send - * this IPI. - */ - preempt_fold_need_resched(); -} - static void ttwu_queue_remote(struct task_struct *p, int cpu, int wake_flags) { struct rq *rq = cpu_rq(cpu);