mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2026-05-09 21:42:09 +02:00
5467c292d0
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/20260303113032.3008371-5-yuvraj.sakshith@oss.qualcomm.com Signed-off-by: Yuvraj Sakshith <yuvraj.sakshith@oss.qualcomm.com> Acked-by: David Hildenbrand (Arm) <david@kernel.org> Reviewed-by: Michael Kelley <mhklinux@outlook.com> Acked-by: Michael S. Tsirkin <mst@redhat.com> Cc: Brendan Jackman <jackmanb@google.com> Cc: Dexuan Cui <decui@microsoft.com> Cc: Eugenio Pérez <eperezma@redhat.com> Cc: Haiyang Zhang <haiyangz@microsoft.com> Cc: Jason Wang <jasowang@redhat.com> Cc: Johannes Weiner <hannes@cmpxchg.org> Cc: K. Y. Srinivasan <kys@microsoft.com> Cc: Liam Howlett <liam.howlett@oracle.com> Cc: Long Li <longli@microsoft.com> Cc: Lorenzo Stoakes (Oracle) <ljs@kernel.org> Cc: Michal Hocko <mhocko@suse.com> Cc: Mike Rapoport <rppt@kernel.org> Cc: Suren Baghdasaryan <surenb@google.com> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: Wei Liu <wei.liu@kernel.org> Cc: Xuan Zhuo <xuanzhuo@linux.alibaba.com> Cc: Zi Yan <ziy@nvidia.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
31 lines
939 B
C
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 */
|