On 6/8/26 23:16, Zi Yan wrote: > On 8 Jun 2026, at 17:04, Michael S. Tsirkin wrote: > >> On Mon, Jun 08, 2026 at 04:40:15PM -0400, Zi Yan wrote: >>> >>> >>> Change user_alloc_needs_zeroing() to only check address aliasing even >>> if that can cause double zeroing for virtio. >>> >>> Best Regards, >>> Yan, Zi >> >> Ah. I started with exactly that in v1/v2. It's a simple approach.
Simple, and hacky -> unmergable. I tried to push it into a different (no GFP flags -> IMHO better) direction, but the patch set grew in complexity. I kept telling to keep it simple (e.g., no folio_put optimization, no hugetlb optimization, simple wrapper functions), and ideally we would have gotten a better discussion with other folks here much earlier. And I still do not consider providing an user address to selected interfaces while centralizing zeroing a bad idea. The real question is how that could be done in a cleaner way. Or as Willy said, if we could move zeroing further out to callers, where they can special-case. But given that KASAN and friends interact in their own way with zeroing doesn't make that super straight forward as people might think. >> >> But mm maintainers said no, user_alloc_needs_zeroing is a hack and >> I must not add to it. I mean, I would hope that we can agree that our existing page/folio zeroing is a mess and should not be extended by slapping more special casing on top? Sure, we can try cleaning it up, but conceptually, zeroing happening at two places in the callchain, with random optimizations to avoid double-zeroing is just bad. The fact that a vma_alloc_zeroed_movable_folio() that can be overridden by architectures even exists makes me angry. user_alloc_needs_zeroing() is jsut the tip of the ugly iceberg. > > Got it. It sounds that you now get conflicting ideas. Maybe you should > start a [DISCUSSION] thread that presents the high level idea of what > you want to achieve and all the ideas you got from the reviews, so that > people in this thread can have the big picture and come up a consensus > before you send another version. > > Thank you for patiently replying my comments, since those points > apparently have been discussed in prior submissions. > There was Willy's comment in RFC v3 [1], which had 19 patches. Unfortunately, he no longer followed up to my initial push back and Michael's question later [2]. That would have probably been the right time to wait for more discussion. RFC v4 had 22 patches with little replies. v5 had 28 patches with little replies. v6 had 30 patches with no replies. v7 had 31 patches with little replies. v8 had 37 patches with no replies. [1] https://lore.kernel.org/lkml/[email protected]/ [2] https://lore.kernel.org/lkml/[email protected]/ -- Cheers, David

