Re: [PATCH v2 12/13] mm: Add tail private fields to struct folio

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

 



On 16.08.23 17:12, Matthew Wilcox (Oracle) wrote:
Because THP_SWAP uses page->private for each page, we must not use
the space which overlaps that field for anything which would conflict
with that.  We avoid the conflict on 32-bit systems by disallowing
THP_SWAP on 32-bit.

Signed-off-by: Matthew Wilcox (Oracle) <willy@xxxxxxxxxxxxx>
---
  include/linux/mm_types.h | 14 +++++++++++++-
  1 file changed, 13 insertions(+), 1 deletion(-)

diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 659c7b84726c..3880b3f2e321 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -340,8 +340,11 @@ struct folio {
  			atomic_t _pincount;
  #ifdef CONFIG_64BIT
  			unsigned int _folio_nr_pages;
-#endif
+			/* 4 byte gap here */
  	/* private: the union with struct page is transitional */
+			/* Fix THP_SWAP to not use tail->private */
+			unsigned long _private_1;

If you could give

https://lkml.kernel.org/r/b887e764-ffa3-55ee-3c44-69cb15f8a115@xxxxxxxxxx

a quick glimpse to see if anything important jumps at you, that would be great.

That really should be fixed.

--
Cheers,

David / dhildenb





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux