Linux-mm Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/3] mm: improve insert_pages() error handling
@ 2026-08-05 14:42 Avi Weiss
  2026-08-05 14:42 ` [PATCH v2 1/3] mm/memory.c: rename walk_to_pmd() to populate_to_pmd() Avi Weiss
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Avi Weiss @ 2026-08-05 14:42 UTC (permalink / raw)
  To: Andrew Morton
  Cc: David Hildenbrand, Lorenzo Stoakes, Liam R. Howlett,
	Vlastimil Babka, Mike Rapoport, Suren Baghdasaryan, Michal Hocko,
	Soheil Hassas Yeganeh, Arjun Roy, Eric Dumazet, linux-mm,
	linux-kernel, Avi Weiss

Improve insert_pages() error handling following review of the minor
cleanup in v1.

Rename the helper that populates the upper page-table levels, set error
codes at their points of failure, and return -ENOMEM when that
population fails.

Thanks for the review. I'm new to Linux; most of my previous upstream
work has been on NASA cFS and RTEMS.

I agree that initializing the return value to zero and assigning each
relevant error code at its failure site is clearer and more idiomatic.
The second (middle) patch implements that cleanup.

The pte_alloc() macro returns a boolean, so patch 2 tests it and assigns
-ENOMEM explicitly rather than using its return value as an error code.

Changes in v2:

* rename walk_to_pmd() to populate_to_pmd()
* set error codes at their points of failure and rename ret to err
* split the cleanup and return-code change into separate patches
* drop the Fixes tag because this is a general cleanup

Avi Weiss (3):
  mm/memory.c: rename walk_to_pmd() to populate_to_pmd()
  mm/memory.c: simplify error handling in insert_pages()
  mm: return -ENOMEM for page-table allocation failure in insert_pages()

 mm/memory.c | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)


base-commit: 848acc8ffe1b7cd5f1bf427b93069becfebc2c9d
-- 
2.43.0



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

end of thread, other threads:[~2026-08-05 14:42 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-08-05 14:42 [PATCH v2 0/3] mm: improve insert_pages() error handling Avi Weiss
2026-08-05 14:42 ` [PATCH v2 1/3] mm/memory.c: rename walk_to_pmd() to populate_to_pmd() Avi Weiss
2026-08-05 14:42 ` [PATCH v2 2/3] mm/memory.c: simplify error handling in insert_pages() Avi Weiss
2026-08-05 14:42 ` [PATCH v2 3/3] mm: return -ENOMEM for page-table allocation failure " Avi Weiss

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