Re: [PATCH 1/4] s390/crypto: Replace cond_resched() with schedule()

From: Holger Dengler

Date: Tue Jul 28 2026 - 06:10:39 EST


On 7/28/26 10:29, Heiko Carstens wrote:
Well, the main question still remains: why did the code use cond_resched()?

This doesn't make sense to me, at least when reading the comment. So to me
even the schedule() approach I proposed is questionable. Why didn't the code
use msleep() instead? Or can we just remove cond_resched() entirely without
any replacement?

As the comment says, if possible, the scheduler should run any other workload in case of a -EKEYEXPIRED, as the re-creation of the protected key is in progress.

My current understanding was (and still is), that cond_resched() (or even schedule()) is doing exactly that: give back the control to the scheduler. If this is not the case, but msleep() is doing the trick, I would vote for msleep().

Removing the code completely might also work. The situations, where the protected keys expires are very rare (once per protected key after a live guest relocation). These situations are hard to trigger and we should test carefully, if the removal works in all cases.

--
Mit freundlichen Grüßen / Kind regards
Holger Dengler