Re: [PATCH v7 1/8] xarray: add xas_try_split() to split a multi-index entry.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 




Now, can it happen that xas_try_split() would ever perform a partial split in any way, when invoked from __split_unmapped_folio(), such that we run into the do { } while(); loop and fail with -ENOMEM after already having performed changes -- xas_update().

Or is that simply impossible?

Right. It is impossible. xas_try_split() either splits by copying @entry
to all the replacement entries, or is trying to allocate a new xa_node,
which can result in -ENOMEM. These two will not be mixed.


Maybe it's just the do { } while(); loop in there that is confusing me. (again, no expert)

Yeah, that the do while loop is confusing. Let me restructure the code
so that the do while loop only runs in the @entry copy case not the
xa_node allocation case.

Great!



xas_try_split() imposes what kind of split it does and is usually used to
split from order N to order N-1:

You mean that old_order -> split_order will in the case of __split_unmapped_folio() always be a difference of 1?

Yes for !uniform_split case. For uniform_split case (split_huge_page*() uses),
xas_split() is used and all required new xa_node are preallocated by
xas_split_alloc() in __folio_split().

Got it, thanks!

--
Cheers,

David / dhildenb





[Index of Archives]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Samba]     [Device Mapper]

  Powered by Linux