linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 0/5] Use nth_page() in place of direct struct page manipulation
@ 2023-09-06 15:03 Zi Yan
  2023-09-06 15:03 ` [PATCH v2 1/5] mm/cma: use " Zi Yan
                   ` (5 more replies)
  0 siblings, 6 replies; 11+ messages in thread
From: Zi Yan @ 2023-09-06 15:03 UTC (permalink / raw)
  To: linux-mm, linux-kernel, linux-mips
  Cc: Zi Yan, Andrew Morton, Thomas Bogendoerfer,
	Matthew Wilcox (Oracle),
	David Hildenbrand, Mike Kravetz, Muchun Song, Mike Rapoport (IBM)

From: Zi Yan <ziy@nvidia.com>

On SPARSEMEM without VMEMMAP, struct page is not guaranteed to be
contiguous, since each memory section's memmap might be allocated
independently. hugetlb pages can go beyond a memory section size, thus
direct struct page manipulation on hugetlb pages/subpages might give
wrong struct page. Kernel provides nth_page() to do the manipulation
properly. Use that whenever code can see hugetlb pages.

The patches are on top of next-20230906

Changes from v1:
1. Separated first patch into three and add Fixes for better backport.
2. Collected Reviewed-by.

Zi Yan (5):
  mm/cma: use nth_page() in place of direct struct page manipulation.
  mm/hugetlb: use nth_page() in place of direct struct page
    manipulation.
  mm/memory_hotplug: use nth_page() in place of direct struct page
    manipulation.
  fs: use nth_page() in place of direct struct page manipulation.
  mips: use nth_page() in place of direct struct page manipulation.

 arch/mips/mm/cache.c | 2 +-
 fs/hugetlbfs/inode.c | 4 ++--
 mm/cma.c             | 2 +-
 mm/hugetlb.c         | 2 +-
 mm/memory_hotplug.c  | 2 +-
 5 files changed, 6 insertions(+), 6 deletions(-)

-- 
2.40.1



^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2023-09-08 14:56 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-09-06 15:03 [PATCH v2 0/5] Use nth_page() in place of direct struct page manipulation Zi Yan
2023-09-06 15:03 ` [PATCH v2 1/5] mm/cma: use " Zi Yan
2023-09-06 15:03 ` [PATCH v2 2/5] mm/hugetlb: " Zi Yan
2023-09-06 15:03 ` [PATCH v2 3/5] mm/memory_hotplug: " Zi Yan
2023-09-06 17:17   ` David Hildenbrand
2023-09-06 17:39     ` Zi Yan
2023-09-06 17:46   ` Zi Yan
2023-09-06 15:03 ` [PATCH v2 4/5] fs: " Zi Yan
2023-09-06 15:03 ` [PATCH v2 5/5] mips: " Zi Yan
2023-09-08 14:46 ` [PATCH v2 0/5] Use " Philippe Mathieu-Daudé
2023-09-08 14:56   ` Zi Yan

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox