[PATCH v2] kasan: call clear_page with a match-all tag instead of changing page tag

Catalin Marinas catalin.marinas at arm.com
Mon Feb 20 07:54:51 PST 2023


On Thu, Feb 16, 2023 at 11:59:24AM -0800, Peter Collingbourne wrote:
> Instead of changing the page's tag solely in order to obtain a pointer
> with a match-all tag and then changing it back again, just convert the
> pointer that we get from kmap_atomic() into one with a match-all tag
> before passing it to clear_page().
> 
> On a certain microarchitecture, this has been observed to cause a
> measurable improvement in microbenchmark performance, presumably as a
> result of being able to avoid the atomic operations on the page tag.
> 
> Signed-off-by: Peter Collingbourne <pcc at google.com>
> Link: https://linux-review.googlesource.com/id/I0249822cc29097ca7a04ad48e8eb14871f80e711

Reviewed-by: Catalin Marinas <catalin.marinas at arm.com>

Not sure how this will go upstream, maybe the mm tree? Otherwise happy
to take it through the arm64 tree.

Thanks.

-- 
Catalin



More information about the linux-arm-kernel mailing list