[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240425113746.335530-6-kernel@pankajraghav.com>
Date: Thu, 25 Apr 2024 13:37:40 +0200
From: "Pankaj Raghav (Samsung)" <kernel@...kajraghav.com>
To: willy@...radead.org,
djwong@...nel.org,
brauner@...nel.org,
david@...morbit.com,
chandan.babu@...cle.com,
akpm@...ux-foundation.org
Cc: linux-fsdevel@...r.kernel.org,
hare@...e.de,
linux-kernel@...r.kernel.org,
linux-mm@...ck.org,
linux-xfs@...r.kernel.org,
mcgrof@...nel.org,
gost.dev@...sung.com,
p.raghav@...sung.com
Subject: [PATCH v4 05/11] mm: do not split a folio if it has minimum folio order requirement
From: Pankaj Raghav <p.raghav@...sung.com>
Splitting a larger folio with a base order is supported using
split_huge_page_to_list_to_order() API. However, using that API for LBS
is resulting in an NULL ptr dereference error in the writeback path [1].
Refuse to split a folio if it has minimum folio order requirement until
we can start using split_huge_page_to_list_to_order() API. Splitting the
folio can be added as a later optimization.
[1] https://gist.github.com/mcgrof/d12f586ec6ebe32b2472b5d634c397df
Signed-off-by: Pankaj Raghav <p.raghav@...sung.com>
Signed-off-by: Luis Chamberlain <mcgrof@...nel.org>
---
mm/huge_memory.c | 9 +++++++++
1 file changed, 9 insertions(+)
diff --git a/mm/huge_memory.c b/mm/huge_memory.c
index 9859aa4f7553..dadf1e68dbdc 100644
--- a/mm/huge_memory.c
+++ b/mm/huge_memory.c
@@ -3117,6 +3117,15 @@ int split_huge_page_to_list_to_order(struct page *page, struct list_head *list,
goto out;
}
+ /*
+ * Do not split if mapping has minimum folio order
+ * requirement.
+ */
+ if (mapping_min_folio_order(mapping)) {
+ ret = -EINVAL;
+ goto out;
+ }
+
gfp = current_gfp_context(mapping_gfp_mask(mapping) &
GFP_RECLAIM_MASK);
--
2.34.1
Powered by blists - more mailing lists