Re: [PATCH 1/3] rust: completion: implement initial abstraction

From: Boqun Feng
Date: Wed Jun 11 2025 - 16:02:08 EST


On Tue, Jun 03, 2025 at 10:48:50PM +0200, Danilo Krummrich wrote:
> Implement a minimal abstraction for the completion synchronization
> primitive.
>
> This initial abstraction only adds complete_all() and
> wait_for_completion(), since that is what is required for the subsequent
> Devres patch.
>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Juri Lelli <juri.lelli@xxxxxxxxxx>
> Cc: Vincent Guittot <vincent.guittot@xxxxxxxxxx>
> Cc: Dietmar Eggemann <dietmar.eggemann@xxxxxxx>
> Cc: Steven Rostedt <rostedt@xxxxxxxxxxx>
> Cc: Ben Segall <bsegall@xxxxxxxxxx>
> Cc: Mel Gorman <mgorman@xxxxxxx>
> Cc: Valentin Schneider <vschneid@xxxxxxxxxx>
> Signed-off-by: Danilo Krummrich <dakr@xxxxxxxxxx>

There is a DECLARE_COMPLETION() which allows to customiz the lock class
for a particular completion allocated on the stack, but we can add that
feature in the future, the current abstraction looks good to me. And I
think this should go into the driver-core with the rest of the fixes.

Reviewed-by: Boqun Feng <boqun.feng@xxxxxxxxx>

Regards,
Boqun