On Thu, 19 Sept 2024 at 06:36, Matthew Wilcox <willy@xxxxxxxxxxxxx> wrote: > > Probably xas_split_alloc() needs to just do the alloc, like the name > says, and drop the 'entry' argument. ICBW, but I think it explains > what you're seeing? Maybe it doesn't? .. or we make the rule be that you have to re-check that the order and the entry still matches when you do the actual xas_split().. Like commit 6758c1128ceb does, in this case. We do have another xas_split_alloc() - in the hugepage case - but there we do have xas_lock(&xas); xas_reset(&xas); if (xas_load(&xas) != folio) goto fail; and the folio is locked over the whole sequence, so I think that code is probably safe and guarantees that we're splitting with the same details we alloc'ed. Linus