On 11.03.22 20:22, Linus Torvalds wrote: > On Fri, Mar 11, 2022 at 10:46 AM David Hildenbrand <david@xxxxxxxxxx> wrote: >> >> - PG_has_hwpoisoned = PG_mappedtodisk, >> + PG_has_hwpoisoned = PG_waiters, > > That makes me too nervous for words. PG_waiters is very subtle. Yes, but PG_has_hwpoisoned is located on the second subpage of a compound page, not on the head page. > > Not only is it magical in bit location ways (and the special > clear_bit_unlock_is_negative_byte() macro that *literally* exists only > for unlocking a page), it just ends up having fairly subtle semantics > with intentionally racy clearing etc. > > Mixing that up with any hwpoison bits - that aren't used by any normal > mortals and thus get very little coverage - just sounds horribly > horribly wrong. I used PG_error before, but felt like using a bit that is never ever valid to be set/cleared/checked on a subpage would be even a better fit: Note the: PAGEFLAG(Waiters, waiters, PF_ONLY_HEAD) __CLEARPAGEFLAG(Waiters, waiters, PF_ONLY_HEAD) whereby PF_ONLY_HEAD translates to: "for compound page, callers only ever operate on the head page." I can just switch to PG_error, but for the second subpage, PG_waiters should be just fine (unless I am missing something important). -- Thanks, David / dhildenb