I have a somewhat different patch for this. Let me know what you think.I don't have extensive experience with folios or anything but on the
It depends on a few other patches in my tree, so probably won't compile
for you.
- if (PageKsm(page))This might need an #ifdef?
+ if (mapping & PAGE_MAPPING_KSM)
u |= 1 << KPF_KSM;
/*This makes sense but it'd require changes to the documentation.
* compound pages: export both head/tail info
* they together define a compound page's start/end pos and order
*/
- if (PageHead(page))
- u |= 1 << KPF_COMPOUND_HEAD;
- if (PageTail(page))
+ if (page == &folio->page)
+ u |= kpf_copy_bit(k, KPF_COMPOUND_HEAD, PG_head);
+ else
u |= 1 << KPF_COMPOUND_TAIL;
- if (page_is_idle(page))and
+#if defined(CONFIG_PAGE_IDLE_FLAG) && defined(CONFIG_64BIT)
+ u |= kpf_copy_bit(k, KPF_IDLE, PG_idle);
+#else
+ if (folio_test_idle(folio))
u |= 1 << KPF_IDLE;
+#endif
- if (PageSwapCache(page))it seems to me like the #ifdef/#define could be supplanted by
+#define SWAPCACHE ((1 << PG_swapbacked) | (1 << PG_swapcache))
+ if ((k & SWAPCACHE) == SWAPCACHE)
u |= 1 << KPF_SWAPCACHE;
u |= kpf_copy_bit(k, KPF_SWAPBACKED, PG_swapbacked);