From: Christian Borntraeger <borntraeger@de.ibm.com>
To: Peter Zijlstra <peterz@infradead.org>,
Martin Schwidefsky <schwidefsky@de.ibm.com>,
Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: kernellwp@gmail.com, linux-s390@vger.kernel.org,
benh@kernel.crashing.org, jgross@suse.com, kvm@vger.kernel.org,
Pan Xinhui <xinhui.pan@linux.vnet.ibm.com>,
will.deacon@arm.com, linux-kernel@vger.kernel.org,
virtualization@lists.linux-foundation.org, mingo@redhat.com,
paulus@samba.org, mpe@ellerman.id.au,
xen-devel-request@lists.xenproject.org, pbonzini@redhat.com,
paulmck@linux.vnet.ibm.com
Subject: [PATCH] s390x/spinlock: Provide vcpu_is_preempted globally
Date: Thu, 29 Sep 2016 13:54:16 +0200 [thread overview]
Message-ID: <1475150056-58774-1-git-send-email-borntraeger@de.ibm.com> (raw)
this implements the s390 backend for commit
"kernel/sched: introduce vcpu preempted check interface"
by simply reusing the existing cpu_is_preempted function.
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
---
Martin, Heiko,
this patch is a minimal change by not touching all existing users of
cpu_is_preempted in spinlock.c. If you want it differently, let me
know.
arch/s390/include/asm/spinlock.h | 7 +++++++
arch/s390/lib/spinlock.c | 3 ++-
2 files changed, 9 insertions(+), 1 deletion(-)
diff --git a/arch/s390/include/asm/spinlock.h b/arch/s390/include/asm/spinlock.h
index 63ebf37..6e82986 100644
--- a/arch/s390/include/asm/spinlock.h
+++ b/arch/s390/include/asm/spinlock.h
@@ -21,6 +21,13 @@ _raw_compare_and_swap(unsigned int *lock, unsigned int old, unsigned int new)
return __sync_bool_compare_and_swap(lock, old, new);
}
+int arch_vcpu_is_preempted(int cpu);
+#define vcpu_is_preempted cpu_is_preempted
+static inline bool cpu_is_preempted(int cpu)
+{
+ return arch_vcpu_is_preempted(cpu);
+}
+
/*
* Simple spin lock operations. There are two variants, one clears IRQ's
* on the local processor, one does not.
diff --git a/arch/s390/lib/spinlock.c b/arch/s390/lib/spinlock.c
index e5f50a7..9f473c8 100644
--- a/arch/s390/lib/spinlock.c
+++ b/arch/s390/lib/spinlock.c
@@ -37,7 +37,7 @@ static inline void _raw_compare_and_delay(unsigned int *lock, unsigned int old)
asm(".insn rsy,0xeb0000000022,%0,0,%1" : : "d" (old), "Q" (*lock));
}
-static inline int cpu_is_preempted(int cpu)
+int arch_vcpu_is_preempted(int cpu)
{
if (test_cpu_flag_of(CIF_ENABLED_WAIT, cpu))
return 0;
@@ -45,6 +45,7 @@ static inline int cpu_is_preempted(int cpu)
return 0;
return 1;
}
+EXPORT_SYMBOL(arch_vcpu_is_preempted);
void arch_spin_lock_wait(arch_spinlock_t *lp)
{
--
2.5.5
next reply other threads:[~2016-09-29 11:54 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-09-29 11:54 Christian Borntraeger [this message]
2016-09-29 13:11 ` [PATCH] s390x/spinlock: Provide vcpu_is_preempted globally Martin Schwidefsky
2016-09-29 13:21 ` Christian Borntraeger
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=1475150056-58774-1-git-send-email-borntraeger@de.ibm.com \
--to=borntraeger@de.ibm.com \
--cc=benh@kernel.crashing.org \
--cc=heiko.carstens@de.ibm.com \
--cc=jgross@suse.com \
--cc=kernellwp@gmail.com \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=paulmck@linux.vnet.ibm.com \
--cc=paulus@samba.org \
--cc=pbonzini@redhat.com \
--cc=peterz@infradead.org \
--cc=schwidefsky@de.ibm.com \
--cc=virtualization@lists.linux-foundation.org \
--cc=will.deacon@arm.com \
--cc=xen-devel-request@lists.xenproject.org \
--cc=xinhui.pan@linux.vnet.ibm.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