From: Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>
To: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Cc: paulmck@linux.vnet.ibm.com, peterz@infradead.org,
mingo@redhat.com, mpe@ellerman.id.au, paulus@samba.org,
benh@kernel.crashing.org, Waiman.Long@hpe.com,
boqun.feng@gmail.com, will.deacon@arm.com, dave@stgolabs.net,
Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>
Subject: [PATCH 1/3] kernel/sched: introduce vcpu preempted check interface
Date: Mon, 27 Jun 2016 13:41:28 -0400 [thread overview]
Message-ID: <1467049290-32359-2-git-send-email-xinhui.pan@linux.vnet.ibm.com> (raw)
In-Reply-To: <1467049290-32359-1-git-send-email-xinhui.pan@linux.vnet.ibm.com>
this supports to fix lock holder preempted issue which run as a guest
for kernel users, we could use bool vcpu_is_preempted(int cpu) to detech
if one vcpu is preempted or not.
The default implementation is a macrodefined by false. So compiler can
wrap it out if arch dose not support such vcpu pteempted check.
archs can implement it by define arch_vcpu_is_preempted().
Signed-off-by: Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>
---
include/linux/sched.h | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/include/linux/sched.h b/include/linux/sched.h
index 6e42ada..dc0a9c3 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -3293,6 +3293,15 @@ static inline void set_task_cpu(struct task_struct *p, unsigned int cpu)
#endif /* CONFIG_SMP */
+#ifdef arch_vcpu_is_preempted
+static inline bool vcpu_is_preempted(int cpu)
+{
+ return arch_vcpu_is_preempted(cpu);
+}
+#else
+#define vcpu_is_preempted(cpu) false
+#endif
+
extern long sched_setaffinity(pid_t pid, const struct cpumask *new_mask);
extern long sched_getaffinity(pid_t pid, struct cpumask *mask);
--
2.4.11
next prev parent reply other threads:[~2016-06-27 13:43 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-06-27 17:41 [PATCH 0/3] implement vcpu preempted check Pan Xinhui
2016-06-27 17:41 ` Pan Xinhui [this message]
2016-06-27 14:00 ` [PATCH 1/3] kernel/sched: introduce vcpu preempted check interface Peter Zijlstra
2016-06-27 14:02 ` Peter Zijlstra
2016-06-28 3:14 ` xinhui
2016-06-28 7:00 ` Heiko Carstens
2016-06-28 9:47 ` xinhui
2016-06-27 14:05 ` Boqun Feng
2016-06-28 3:15 ` xinhui
2016-06-27 17:41 ` [PATCH 2/3] powerpc/spinlock: support vcpu preempted check Pan Xinhui
2016-06-27 14:17 ` Peter Zijlstra
2016-06-28 3:23 ` xinhui
2016-06-27 14:58 ` Boqun Feng
2016-06-28 3:39 ` xinhui
2016-06-28 5:03 ` Boqun Feng
2016-06-28 5:38 ` xinhui
2016-06-27 17:41 ` [PATCH 3/3] locking/osq: Drop the overload of osq_lock() Pan Xinhui
2016-06-27 14:21 ` Peter Zijlstra
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=1467049290-32359-2-git-send-email-xinhui.pan@linux.vnet.ibm.com \
--to=xinhui.pan@linux.vnet.ibm.com \
--cc=Waiman.Long@hpe.com \
--cc=benh@kernel.crashing.org \
--cc=boqun.feng@gmail.com \
--cc=dave@stgolabs.net \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=paulmck@linux.vnet.ibm.com \
--cc=paulus@samba.org \
--cc=peterz@infradead.org \
--cc=will.deacon@arm.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.