summaryrefslogtreecommitdiff
path: root/include/linux/mm_types.h
diff options
context:
space:
mode:
authorMatteo Croce <mcroce@microsoft.com>2021-06-07 21:02:36 +0200
committerDavid S. Miller <davem@davemloft.net>2021-06-07 14:11:47 -0700
commitc07aea3ef4d4076f18f567b98ed01e082e02ed51 (patch)
treef52beca6a7fefeb1f14f7fb92efa914a3682b86f /include/linux/mm_types.h
parent35cba15a504bf4f585bb9d78f47b22b28a1a06b2 (diff)
mm: add a signature in struct page
This is needed by the page_pool to avoid recycling a page not allocated via page_pool. The page->signature field is aliased to page->lru.next and page->compound_head, but it can't be set by mistake because the signature value is a bad pointer, and can't trigger a false positive in PageTail() because the last bit is 0. Co-developed-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Matthew Wilcox (Oracle) <willy@infradead.org> Signed-off-by: Matteo Croce <mcroce@microsoft.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/mm_types.h')
-rw-r--r--include/linux/mm_types.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 5aacc1c10a45..ed6862eacb52 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -97,6 +97,13 @@ struct page {
};
struct { /* page_pool used by netstack */
/**
+ * @pp_magic: magic value to avoid recycling non
+ * page_pool allocated pages.
+ */
+ unsigned long pp_magic;
+ struct page_pool *pp;
+ unsigned long _pp_mapping_pad;
+ /**
* @dma_addr: might require a 64-bit value on
* 32-bit architectures.
*/