Hi Catalin, On Thu, Jun 9, 2022 at 8:32 PM Catalin Marinas <catalin.marinas@xxxxxxx> wrote: > > > This would make __GFP_SKIP_KASAN_UNPOISON do two logically unrelated > > things: skip setting memory tags and reset page tags. This seems > > weird. > > Not entirely weird, it depends on how you look at it. After allocation, > you expect the accesses to page_address() to work, irrespective of the > GFP flags. __kasan_unpoison_pages() ensures that the page->flags match > the written tag without a new GFP flag to set the page->flags. If you > skip the unpoisoning something should reset the page->flags tag to > ensure an accessible page_address(). I find it weirder that you need > another GFP flag to pretty much say 'give me an accessible page'. Hm, this makes sense. > As above, my preference would be to avoid a new flag, just wire this up > to __GFP_SKIP_KASAN_UNPOISON. But if you do want fine-grained control, I > can add the above. OK, let's do as you suggest. Thanks!