Re: [PATCH v2 0/2] x86/platform/amd: better handle scheduling delays in hsmp_send_message

From: Ilpo Järvinen
Date: Mon Jun 09 2025 - 03:53:54 EST


On Thu, 05 Jun 2025 19:09:25 +0100, Jake Hillion wrote:

> hsmp_send_message currently relies in 2 places on the assumption that
> usleep_range will complete in well under 100ms. This is not guaranteed,
> and is prevalent when running sched_ext schedulers or possible under
> other high load conditions.
>
> These patches alter the behaviour in two ways:
> 1. Checks the result of `mbox_status` a final time if the sleep took us
> past the timeout. This gives a useful result under test when there
> are significant scheduling delays, rather than -ETIMEDOUT.
> 2. Removes the 100ms limit on awaiting the semaphore. This allows a
> second thread to compete even when the other suffers large scheduling
> delays.
>
> [...]


Thank you for your contribution, it has been applied to my local
review-ilpo-fixes branch. Note it will show up in the public
platform-drivers-x86/review-ilpo-fixes branch only once I've pushed my
local branch there, which might take a while.

The list of commits applied:
[1/2] x86/platform/amd: move final timeout check to after final sleep
commit: f8afb12a2d7503de6558c23cacd7acbf6e9fe678
[2/2] x86/platform/amd: replace down_timeout with down_interruptible
commit: 784e48a82976ee0b645788750343cd1b28a372f3

--
i.