From: Heiko Carstens <hca@linux.ibm.com>
To: Alexander Gordeev <agordeev@linux.ibm.com>,
Sven Schnelle <svens@linux.ibm.com>,
Vasily Gorbik <gor@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Harald Freudenberger <freude@linux.ibm.com>,
Holger Dengler <dengler@linux.ibm.com>,
Vineeth Vijayan <vneethv@linux.ibm.com>,
Peter Oberparleiter <oberpar@linux.ibm.com>,
Janosch Frank <frankja@linux.ibm.com>,
Claudio Imbrenda <imbrenda@linux.ibm.com>,
David Hildenbrand <david@kernel.org>,
Peter Zijlstra <peterz@infradead.org>
Cc: linux-s390@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: [PATCH 2/4] KVM: s390: Remove cond_resched() calls
Date: Mon, 27 Jul 2026 18:24:28 +0200 [thread overview]
Message-ID: <20260727162430.1599396-3-hca@linux.ibm.com> (raw)
In-Reply-To: <20260727162430.1599396-1-hca@linux.ibm.com>
Since [1] cond_resched() is a no-op on s390. Remove all calls.
[1] commit 7dadeaa6e851 ("sched: Further restrict the preemption modes")
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
---
arch/s390/include/asm/uv.h | 1 -
arch/s390/kvm/gaccess.c | 8 ++------
arch/s390/kvm/gmap.c | 4 ----
arch/s390/kvm/kvm-s390.c | 1 -
arch/s390/kvm/pv.c | 1 -
arch/s390/kvm/vsie.c | 1 -
arch/s390/mm/gmap_helpers.c | 1 -
7 files changed, 2 insertions(+), 15 deletions(-)
diff --git a/arch/s390/include/asm/uv.h b/arch/s390/include/asm/uv.h
index d919e69662f5..795da130342a 100644
--- a/arch/s390/include/asm/uv.h
+++ b/arch/s390/include/asm/uv.h
@@ -461,7 +461,6 @@ static inline int uv_call_sched(unsigned long r1, unsigned long r2)
do {
cc = __uv_call(r1, r2);
- cond_resched();
} while (cc > 1);
return cc;
}
diff --git a/arch/s390/kvm/gaccess.c b/arch/s390/kvm/gaccess.c
index 36102b2727fb..0d389a302a70 100644
--- a/arch/s390/kvm/gaccess.c
+++ b/arch/s390/kvm/gaccess.c
@@ -151,10 +151,8 @@ static void ipte_lock_simple(struct kvm *kvm)
ic = &kvm->arch.sca->ipte_control;
old = READ_ONCE(*ic);
do {
- if (old.k) {
- cond_resched();
+ if (old.k)
goto retry;
- }
new = old;
new.k = 1;
} while (!try_cmpxchg(&ic->val, &old.val, new.val));
@@ -189,10 +187,8 @@ static void ipte_lock_siif(struct kvm *kvm)
ic = &kvm->arch.sca->ipte_control;
old = READ_ONCE(*ic);
do {
- if (old.kg) {
- cond_resched();
+ if (old.kg)
goto retry;
- }
new = old;
new.k = 1;
new.kh++;
diff --git a/arch/s390/kvm/gmap.c b/arch/s390/kvm/gmap.c
index 8abb4f55b306..3758e4009709 100644
--- a/arch/s390/kvm/gmap.c
+++ b/arch/s390/kvm/gmap.c
@@ -941,7 +941,6 @@ void gmap_split_huge_pages(struct gmap *gmap)
scoped_guard(read_lock, &gmap->kvm->mmu_lock)
start = _dat_walk_gfn_range(start, asce_end(gmap->asce), gmap->asce,
&ops, DAT_WALK_IGN_HOLES, gmap);
- cond_resched();
} while (start);
}
@@ -963,7 +962,6 @@ static int _gmap_enable_skeys(struct gmap *gmap)
do {
scoped_guard(write_lock, &gmap->kvm->mmu_lock)
start = dat_reset_skeys(gmap->asce, start);
- cond_resched();
} while (start);
return 0;
}
@@ -1019,7 +1017,6 @@ int gmap_pv_destroy_range(struct gmap *gmap, gfn_t start, gfn_t end, bool interr
DAT_WALK_IGN_HOLES, NULL);
if (interruptible && fatal_signal_pending(current))
return -EINTR;
- cond_resched();
} while (start && start < end);
return 0;
}
@@ -1138,7 +1135,6 @@ void _gmap_set_cmma_all(struct gmap *gmap, bool dirty)
gfn = _dat_walk_gfn_range(gfn, asce_end(gmap->asce), gmap->asce, &ops,
DAT_WALK_IGN_HOLES,
&gmap->kvm->arch.cmma_dirty_pages);
- cond_resched();
} while (gfn);
}
diff --git a/arch/s390/kvm/kvm-s390.c b/arch/s390/kvm/kvm-s390.c
index 150b5dd2170e..2ede8f035a38 100644
--- a/arch/s390/kvm/kvm-s390.c
+++ b/arch/s390/kvm/kvm-s390.c
@@ -1027,7 +1027,6 @@ static int kvm_s390_set_mem_control(struct kvm *kvm, struct kvm_device_attr *att
do {
scoped_guard(read_lock, &kvm->mmu_lock)
start_gfn = dat_reset_cmma(kvm->arch.gmap->asce, start_gfn);
- cond_resched();
} while (start_gfn);
ret = 0;
break;
diff --git a/arch/s390/kvm/pv.c b/arch/s390/kvm/pv.c
index 1beacc841ca8..935fe308a050 100644
--- a/arch/s390/kvm/pv.c
+++ b/arch/s390/kvm/pv.c
@@ -832,7 +832,6 @@ int kvm_s390_pv_unpack(struct kvm *kvm, unsigned long addr, unsigned long size,
while (offset < size) {
ret = unpack_one(kvm, addr, tweak, offset, rc, rrc);
if (ret == -EAGAIN) {
- cond_resched();
if (fatal_signal_pending(current))
break;
continue;
diff --git a/arch/s390/kvm/vsie.c b/arch/s390/kvm/vsie.c
index eea24562e7db..6dcd3b110c17 100644
--- a/arch/s390/kvm/vsie.c
+++ b/arch/s390/kvm/vsie.c
@@ -1434,7 +1434,6 @@ static int vsie_run(struct kvm_vcpu *vcpu, struct vsie_page *vsie_page)
}
if (sg)
sg = gmap_put(sg);
- cond_resched();
}
if (sg)
sg = gmap_put(sg);
diff --git a/arch/s390/mm/gmap_helpers.c b/arch/s390/mm/gmap_helpers.c
index 4bf7c9012feb..d564cdefb90f 100644
--- a/arch/s390/mm/gmap_helpers.c
+++ b/arch/s390/mm/gmap_helpers.c
@@ -272,7 +272,6 @@ static int __gmap_helper_unshare_zeropages(struct mm_struct *mm)
* truncation. In that case, the shared zeropage would be gone
* and we can simply retry and make progress.
*/
- cond_resched();
goto retry;
}
--
2.53.0
next prev parent reply other threads:[~2026-07-27 16:47 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-27 16:24 [PATCH 0/4] s390: Remove or replace cond_resched() calls Heiko Carstens
2026-07-27 16:24 ` [PATCH 1/4] s390/crypto: Replace cond_resched() with schedule() Heiko Carstens
2026-07-27 17:05 ` sashiko-bot
2026-07-27 16:24 ` Heiko Carstens [this message]
2026-07-27 16:57 ` [PATCH 2/4] KVM: s390: Remove cond_resched() calls sashiko-bot
2026-07-27 16:24 ` [PATCH 3/4] " Heiko Carstens
2026-07-27 16:54 ` sashiko-bot
2026-07-27 16:24 ` [PATCH 4/4] s390/cio: " Heiko Carstens
2026-07-27 16:54 ` sashiko-bot
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=20260727162430.1599396-3-hca@linux.ibm.com \
--to=hca@linux.ibm.com \
--cc=agordeev@linux.ibm.com \
--cc=borntraeger@linux.ibm.com \
--cc=david@kernel.org \
--cc=dengler@linux.ibm.com \
--cc=frankja@linux.ibm.com \
--cc=freude@linux.ibm.com \
--cc=gor@linux.ibm.com \
--cc=imbrenda@linux.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-s390@vger.kernel.org \
--cc=oberpar@linux.ibm.com \
--cc=peterz@infradead.org \
--cc=svens@linux.ibm.com \
--cc=vneethv@linux.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 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.