[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <a99f132c-4e92-4755-9ba6-d28d9d168971@redhat.com>
Date: Tue, 18 Feb 2025 17:12:27 +0100
From: David Hildenbrand <david@...hat.com>
To: Zi Yan <ziy@...dia.com>
Cc: linux-mm@...ck.org, Andrew Morton <akpm@...ux-foundation.org>,
"Kirill A . Shutemov" <kirill.shutemov@...ux.intel.com>,
"Matthew Wilcox (Oracle)" <willy@...radead.org>,
Ryan Roberts <ryan.roberts@....com>, Hugh Dickins <hughd@...gle.com>,
Yang Shi <yang@...amperecomputing.com>, Miaohe Lin <linmiaohe@...wei.com>,
Kefeng Wang <wangkefeng.wang@...wei.com>, Yu Zhao <yuzhao@...gle.com>,
John Hubbard <jhubbard@...dia.com>,
Baolin Wang <baolin.wang@...ux.alibaba.com>,
linux-kselftest@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v7 1/8] xarray: add xas_try_split() to split a multi-index
entry.
>>
>> 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
Powered by blists - more mailing lists