Hi Matthew, On Fri, Apr 17, 2020 at 12:01 AM Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote:
From: "Matthew Wilcox (Oracle)" <willy@xxxxxxxxxxxxx> PageWaiters is used by PageWriteback and PageLocked (and no other page flags), so it makes sense to use the same codepaths that have already been optimised for PageLocked, even if there's probably no real performance benefit to be had. Unfortunately, clear_bit_unlock_is_negative_byte() isn't present on every architecture, and the default implementation is only available in filemap.c while I want to use it in page-writeback.c. Rather than move the default implementation to a header file, I've done optimised implementations for alpha and ia64. I can't figure out optimised implementations for m68k, mips, riscv and s390, so I've just replicated the effect of the generic implementation in them. I leave it to the experts to fix that (... or convert over to using asm-generic/bitops/lock.h ...) v3: - Added implementations of clear_bit_unlock_is_negative_byte() to architectures which need it
I have two questions here? 1. Why not implement arch_clear_bit_unlock_is_negative_byte() instead, so the kasan check in asm-generic is used everywhere? 2. Why not add the default implementation to include/asm-generic/bitops/instrumented-lock.h, in case an arch_*() variant is not provided yet? Note that you did 1 for s390. Thanks! Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@xxxxxxxxxxxxxx In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds