On 3/24/26 9:53 AM, Huang Shijie wrote:
>> +/*
>> + * The folio_order() was introduced to kernel at v5.16, but the first
>> + * large folio support patch is in v5.17:
>> + * 6795801366da "xfs: Support large folios"
>> + *
>> + * 1.) In kernel v5.17, folio_order() uses page[1].compound_order to
>> + * get the folio order.
>> + *
>> + * 2.) In kernel v6.1, the following patch introduces _folio_order:
>> + * c3a15bff46cb5149 "mm: reimplement folio_order() and
folio_nr_pages()"
>> + *
>> + * folio_order() uses _folio_order to get the folio order.
>> + *
>> + * 3.) In kernel v6.6, the following patch replaces the _folio_order with
_flags_1:
>> + * ebc1baf5c9b46c22 "mm: free up a word in the first tail page"
>> + *
>> + * folio_order() uses _flags_1 to get the folio order.
>> + */
> For this check condition, It's not very good to use kernel version. Let's
> investigate if there is a better way to handle this issue.
Do you have any better idea about it?
Not sure, but probably that can be handled based on the above clues(not
rely on kernel version).
Please let me try later(working on other tasks, need some time).
Lianbo
Thanks
Huang Shijie