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;
+			/* 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

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

That really should be fixed.


David / dhildenb

[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux