Files
erofs-linux/include/linux/page_reporting.h
T
Yuvraj Sakshith 5467c292d0 mm/page_reporting: change PAGE_REPORTING_ORDER_UNSPECIFIED to -1
PAGE_REPORTING_ORDER_UNSPECIFIED is now set to zero.  This means, pages of
order zero cannot be reported to a client/driver -- as zero is used to
signal a fallback to MAX_PAGE_ORDER.

Change PAGE_REPORTING_ORDER_UNSPECIFIED to (-1), so that zero can be used
as a valid order with which pages can be reported.

Link: https://lkml.kernel.org/r/[email protected]
Signed-off-by: Yuvraj Sakshith <[email protected]>
Acked-by: David Hildenbrand (Arm) <[email protected]>
Reviewed-by: Michael Kelley <[email protected]>
Acked-by: Michael S. Tsirkin <[email protected]>
Cc: Brendan Jackman <[email protected]>
Cc: Dexuan Cui <[email protected]>
Cc: Eugenio Pérez <[email protected]>
Cc: Haiyang Zhang <[email protected]>
Cc: Jason Wang <[email protected]>
Cc: Johannes Weiner <[email protected]>
Cc: K. Y. Srinivasan <[email protected]>
Cc: Liam Howlett <[email protected]>
Cc: Long Li <[email protected]>
Cc: Lorenzo Stoakes (Oracle) <[email protected]>
Cc: Michal Hocko <[email protected]>
Cc: Mike Rapoport <[email protected]>
Cc: Suren Baghdasaryan <[email protected]>
Cc: Vlastimil Babka <[email protected]>
Cc: Wei Liu <[email protected]>
Cc: Xuan Zhuo <[email protected]>
Cc: Zi Yan <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
2026-04-05 13:53:17 -07:00

31 lines
939 B
C

/* SPDX-License-Identifier: GPL-2.0 */
#ifndef _LINUX_PAGE_REPORTING_H
#define _LINUX_PAGE_REPORTING_H
#include <linux/mmzone.h>
#include <linux/scatterlist.h>
/* This value should always be a power of 2, see page_reporting_cycle() */
#define PAGE_REPORTING_CAPACITY 32
#define PAGE_REPORTING_ORDER_UNSPECIFIED -1
struct page_reporting_dev_info {
/* function that alters pages to make them "reported" */
int (*report)(struct page_reporting_dev_info *prdev,
struct scatterlist *sg, unsigned int nents);
/* work struct for processing reports */
struct delayed_work work;
/* Current state of page reporting */
atomic_t state;
/* Minimal order of page reporting */
unsigned int order;
};
/* Tear-down and bring-up for page reporting devices */
void page_reporting_unregister(struct page_reporting_dev_info *prdev);
int page_reporting_register(struct page_reporting_dev_info *prdev);
#endif /*_LINUX_PAGE_REPORTING_H */