From: K Prateek Nayak <kprateek.nayak@amd.com>
To: <linux-kernel@vger.kernel.org>
Cc: "Gautham R. Shenoy" <gautham.shenoy@amd.com>,
K Prateek Nayak <kprateek.nayak@amd.com>,
"David S. Miller" <davem@davemloft.net>,
"Andreas Larsson" <andreas@gaisler.com>,
"Rafael J. Wysocki" <rafael@kernel.org>,
Daniel Lezcano <daniel.lezcano@linaro.org>,
Ingo Molnar <mingo@redhat.com>,
Peter Zijlstra <peterz@infradead.org>,
Juri Lelli <juri.lelli@redhat.com>,
Vincent Guittot <vincent.guittot@linaro.org>,
Dietmar Eggemann <dietmar.eggemann@arm.com>,
Steven Rostedt <rostedt@goodmis.org>,
Ben Segall <bsegall@google.com>, Mel Gorman <mgorman@suse.de>,
"Daniel Bristot de Oliveira" <bristot@redhat.com>,
Valentin Schneider <vschneid@redhat.com>,
<sparclinux@vger.kernel.org>, <linux-pm@vger.kernel.org>
Subject: [PATCH v2 10/14] sparc/thread_info: Introduce TIF_NOTIFY_IPI flag
Date: Thu, 13 Jun 2024 18:16:09 +0000 [thread overview]
Message-ID: <20240613181613.4329-11-kprateek.nayak@amd.com> (raw)
In-Reply-To: <20240613181613.4329-1-kprateek.nayak@amd.com>
Add support for TIF_NOTIFY_IPI on SPARC. With TIF_NOTIFY_IPI, a sender
sending an IPI to an idle CPU in TIF_POLLING mode will set the
TIF_NOTIFY_IPI flag in the target's idle tasks's thread_info to pull the
CPU out of idle, as opposed to setting TIF_NEED_RESCHED previously. This
avoids spurious calls to schedule_idle() in cases where an IPI does not
necessarily wake up a task on the idle CPU.
Cc: "David S. Miller" <davem@davemloft.net>
Cc: Andreas Larsson <andreas@gaisler.com>
Cc: "Rafael J. Wysocki" <rafael@kernel.org>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Juri Lelli <juri.lelli@redhat.com>
Cc: Vincent Guittot <vincent.guittot@linaro.org>
Cc: Dietmar Eggemann <dietmar.eggemann@arm.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ben Segall <bsegall@google.com>
Cc: Mel Gorman <mgorman@suse.de>
Cc: Daniel Bristot de Oliveira <bristot@redhat.com>
Cc: Valentin Schneider <vschneid@redhat.com>
Cc: K Prateek Nayak <kprateek.nayak@amd.com>
Cc: sparclinux@vger.kernel.org
Cc: linux-kernel@vger.kernel.org
Cc: linux-pm@vger.kernel.org
Signed-off-by: K Prateek Nayak <kprateek.nayak@amd.com>
---
v1..v2:
o No changes.
---
arch/sparc/include/asm/thread_info_32.h | 2 ++
arch/sparc/include/asm/thread_info_64.h | 2 ++
2 files changed, 4 insertions(+)
diff --git a/arch/sparc/include/asm/thread_info_32.h b/arch/sparc/include/asm/thread_info_32.h
index 45b4955b253f..f538ede526d1 100644
--- a/arch/sparc/include/asm/thread_info_32.h
+++ b/arch/sparc/include/asm/thread_info_32.h
@@ -105,6 +105,7 @@ register struct thread_info *current_thread_info_reg asm("g6");
#define TIF_NEED_RESCHED 3 /* rescheduling necessary */
#define TIF_RESTORE_SIGMASK 4 /* restore signal mask in do_signal() */
#define TIF_NOTIFY_SIGNAL 5 /* signal notifications exist */
+#define TIF_NOTIFY_IPI 6 /* Pending IPI on TIF_POLLLING idle CPU */
#define TIF_USEDFPU 8 /* FPU was used by this task
* this quantum (SMP) */
#define TIF_POLLING_NRFLAG 9 /* true if poll_idle() is polling
@@ -117,6 +118,7 @@ register struct thread_info *current_thread_info_reg asm("g6");
#define _TIF_SIGPENDING (1<<TIF_SIGPENDING)
#define _TIF_NEED_RESCHED (1<<TIF_NEED_RESCHED)
#define _TIF_NOTIFY_SIGNAL (1<<TIF_NOTIFY_SIGNAL)
+#define _TIF_NOTIFY_IPI (1<<TIF_NOTIFY_IPI)
#define _TIF_USEDFPU (1<<TIF_USEDFPU)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
diff --git a/arch/sparc/include/asm/thread_info_64.h b/arch/sparc/include/asm/thread_info_64.h
index 1a44372e2bc0..3558101ccdd1 100644
--- a/arch/sparc/include/asm/thread_info_64.h
+++ b/arch/sparc/include/asm/thread_info_64.h
@@ -194,6 +194,7 @@ extern struct thread_info *current_thread_info(void);
#define TIF_MCDPER 12 /* Precise MCD exception */
#define TIF_MEMDIE 13 /* is terminating due to OOM killer */
#define TIF_POLLING_NRFLAG 14
+#define TIF_NOTIFY_IPI 15 /* Pending IPI on TIF_POLLLING idle CPU */
#define _TIF_SYSCALL_TRACE (1<<TIF_SYSCALL_TRACE)
#define _TIF_NOTIFY_RESUME (1<<TIF_NOTIFY_RESUME)
@@ -208,6 +209,7 @@ extern struct thread_info *current_thread_info(void);
#define _TIF_SYSCALL_AUDIT (1<<TIF_SYSCALL_AUDIT)
#define _TIF_SYSCALL_TRACEPOINT (1<<TIF_SYSCALL_TRACEPOINT)
#define _TIF_POLLING_NRFLAG (1<<TIF_POLLING_NRFLAG)
+#define _TIF_NOTIFY_IPI (1<<TIF_NOTIFY_IPI)
#define _TIF_USER_WORK_MASK ((0xff << TI_FLAG_WSAVED_SHIFT) | \
_TIF_DO_NOTIFY_RESUME_MASK | \
--
2.34.1
next prev parent reply other threads:[~2024-06-13 18:21 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-06-13 18:15 [PATCH v2 00/14] Introducing TIF_NOTIFY_IPI flag K Prateek Nayak
2024-06-13 18:16 ` [PATCH v2 01/14] thread_info: Add helpers to test and clear TIF_NOTIFY_IPI K Prateek Nayak
2024-06-13 18:16 ` [PATCH v2 02/14] sched: Define a need_resched_or_ipi() helper and use it treewide K Prateek Nayak
2024-06-13 18:16 ` [PATCH v2 03/14] sched/core: Use TIF_NOTIFY_IPI to notify an idle CPU in TIF_POLLING mode of pending IPI K Prateek Nayak
2024-06-13 18:16 ` [PATCH v2 04/14] x86/thread_info: Introduce TIF_NOTIFY_IPI flag K Prateek Nayak
2024-06-13 18:16 ` [PATCH v2 05/14] arm/thread_info: " K Prateek Nayak
2024-06-13 18:16 ` [PATCH v2 06/14] alpha/thread_info: " K Prateek Nayak
2024-06-13 18:16 ` [PATCH v2 07/14] openrisc/thread_info: " K Prateek Nayak
2024-06-13 18:16 ` [PATCH v2 08/14] powerpc/thread_info: " K Prateek Nayak
2024-06-13 18:16 ` [PATCH v2 09/14] sh/thread_info: " K Prateek Nayak
2024-06-13 18:16 ` K Prateek Nayak [this message]
2024-06-13 18:16 ` [PATCH v2 11/14] csky/thread_info: " K Prateek Nayak
2024-06-15 17:13 ` Guo Ren
2024-06-13 18:16 ` [PATCH v2 12/14] parisc/thread_info: " K Prateek Nayak
2024-06-13 18:16 ` [PATCH v2 13/14] nios2/thread_info: " K Prateek Nayak
2024-06-13 18:16 ` [PATCH v2 14/14] microblaze/thread_info: " K Prateek Nayak
2024-06-14 9:28 ` [PATCH v2 00/14] Introducing " Peter Zijlstra
2024-06-14 10:48 ` Vincent Guittot
2024-06-14 16:31 ` Chen Yu
2024-06-17 8:33 ` K Prateek Nayak
2024-06-18 7:49 ` Chen Yu
2024-06-18 18:33 ` K Prateek Nayak
2024-06-20 7:30 ` Chen Yu
2024-06-15 1:28 ` Peter Zijlstra
2024-06-15 1:45 ` Peter Zijlstra
2024-06-16 14:57 ` Vincent Guittot
2024-06-17 5:52 ` K Prateek Nayak
2024-06-15 1:42 ` Peter Zijlstra
2024-06-15 14:26 ` Russell King (Oracle)
2024-06-17 4:35 ` K Prateek Nayak
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240613181613.4329-11-kprateek.nayak@amd.com \
--to=kprateek.nayak@amd.com \
--cc=andreas@gaisler.com \
--cc=bristot@redhat.com \
--cc=bsegall@google.com \
--cc=daniel.lezcano@linaro.org \
--cc=davem@davemloft.net \
--cc=dietmar.eggemann@arm.com \
--cc=gautham.shenoy@amd.com \
--cc=juri.lelli@redhat.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pm@vger.kernel.org \
--cc=mgorman@suse.de \
--cc=mingo@redhat.com \
--cc=peterz@infradead.org \
--cc=rafael@kernel.org \
--cc=rostedt@goodmis.org \
--cc=sparclinux@vger.kernel.org \
--cc=vincent.guittot@linaro.org \
--cc=vschneid@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox