[RFC PATCH 02/16] mm: Define structs for allocation requests and store allocations
From: Juan Yescas
Date: Thu Jul 23 2026 - 03:51:50 EST
This change introduces the next structs:
- struct req_alloc to keep the request info for the allocation.
- struct page_alloc to store a pointer to the page that was
allocated, the request info and the file that represents this
allocation. This file will be used to free the allocation when
it is not longer needed.
Signed-off-by: Juan Yescas <jyescas@xxxxxxxxxx>
---
mm/page_alloc_hogger.c | 28 ++++++++++++++++++++++++++++
1 file changed, 28 insertions(+)
diff --git a/mm/page_alloc_hogger.c b/mm/page_alloc_hogger.c
index dfdc2ee2eafe..47b08d056978 100644
--- a/mm/page_alloc_hogger.c
+++ b/mm/page_alloc_hogger.c
@@ -91,6 +91,34 @@
struct dentry *mmdir;
+/**
+ * struct req_alloc - Represents the requested allocation
+ * @node_idx: The Node index to allocate from.
+ * @zone_idx: The Zone index to allocate from.
+ * @order: The Order of pages to allocate.
+ * @migrate_type: The Migrate type to allocate from.
+ * @parentdir: The parent dir where the file representing the alloc was created.
+ */
+struct req_alloc {
+ int node_idx;
+ int zone_idx;
+ int order;
+ int migrate_type;
+ struct dentry *parentdir;
+};
+
+/*
+ * struct page_alloc - Represents the page allocation.
+ * @page: The pointer to the page(s) allocated.
+ * @req_alloc: The details of the allocation.
+ * @alloc_dentry: The pointer to the file that represents the allocation.
+ */
+struct page_alloc {
+ struct page *page;
+ struct req_alloc *req_alloc;
+ struct dentry *alloc_dentry;
+};
+
static int __init page_alloc_hogger_debugfs_init(void)
{
mmdir = debugfs_create_dir("mm", NULL);
--
2.55.0.229.g6434b31f56-goog