Re: [PATCH v3] wait_on_bit: add an acquire memory barrier

From: Mikulas Patocka
Date: Fri Aug 26 2022 - 13:51:07 EST




On Fri, 26 Aug 2022, Linus Torvalds wrote:

> That code sequence really doesn't matter, but it was interesting
> seeing the generated code. Not pretty, but the ugliest part was
> actually how the might_sleep() calls in those helper functions result
> in __cond_resched() when PREEMPT_VOLUNTARY is on, and how horrid that
> is for register allocation.

Perhaps, use __attribute__((no_caller_saved_registers)) on
__cond_resched() ?

Mikulas