[PATCH v10 05/14] mm: multi-gen LRU: groundwork

Linus Torvalds torvalds at linux-foundation.org
Wed Apr 20 13:07:15 PDT 2022


On Tue, Apr 19, 2022 at 5:39 PM Yu Zhao <yuzhao at google.com> wrote:
>
> A related question: if I pass new = old to try_cmpxchg(), does it know
> that and avoid an unnecessary atomic op?

No. try_cmpxchg() basically translates directly to a cmpxchg
instruction (on x86) with the return value being the eflags 'Z' bit.

               Linus



More information about the linux-arm-kernel mailing list