* [PATCH v2 1/4] mm/page_reporting: add PAGE_REPORTING_ORDER_UNSPECIFIED
2026-03-02 11:17 [PATCH v2 0/4] Allow order zero pages in page reporting Yuvraj Sakshith
@ 2026-03-02 11:17 ` Yuvraj Sakshith
2026-03-02 14:57 ` David Hildenbrand (Arm)
2026-03-02 11:17 ` [PATCH v2 2/4] virtio_balloon: set unspecified page reporting order Yuvraj Sakshith
` (2 subsequent siblings)
3 siblings, 1 reply; 8+ messages in thread
From: Yuvraj Sakshith @ 2026-03-02 11:17 UTC (permalink / raw)
To: akpm, mst, david, jasowang, kys, haiyangz, wei.liu, decui
Cc: linux-mm, virtualization, linux-hyperv, linux-kernel, xuanzhuo,
eperezma, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
mhocko, jackmanb, hannes, ziy
Drivers can pass order of pages to be reported while
registering itself. Today, this is a magic number, 0.
Label this with PAGE_REPORTING_ORDER_UNSPECIFIED and
check for it when the driver is being registered.
This macro will be used in relevant drivers next.
Signed-off-by: Yuvraj Sakshith <yuvraj.sakshith@oss.qualcomm.com>
---
include/linux/page_reporting.h | 1 +
mm/page_reporting.c | 14 +++++---------
2 files changed, 6 insertions(+), 9 deletions(-)
diff --git a/include/linux/page_reporting.h b/include/linux/page_reporting.h
index fe648dfa3..d1886c657 100644
--- a/include/linux/page_reporting.h
+++ b/include/linux/page_reporting.h
@@ -7,6 +7,7 @@
/* This value should always be a power of 2, see page_reporting_cycle() */
#define PAGE_REPORTING_CAPACITY 32
+#define PAGE_REPORTING_ORDER_UNSPECIFIED 0
struct page_reporting_dev_info {
/* function that alters pages to make them "reported" */
diff --git a/mm/page_reporting.c b/mm/page_reporting.c
index e4c428e61..51cd88faf 100644
--- a/mm/page_reporting.c
+++ b/mm/page_reporting.c
@@ -12,7 +12,7 @@
#include "internal.h"
/* Initialize to an unsupported value */
-unsigned int page_reporting_order = -1;
+unsigned int page_reporting_order = PAGE_REPORTING_ORDER_UNSPECIFIED;
static int page_order_update_notify(const char *val, const struct kernel_param *kp)
{
@@ -25,12 +25,7 @@ static int page_order_update_notify(const char *val, const struct kernel_param *
static const struct kernel_param_ops page_reporting_param_ops = {
.set = &page_order_update_notify,
- /*
- * For the get op, use param_get_int instead of param_get_uint.
- * This is to make sure that when unset the initialized value of
- * -1 is shown correctly
- */
- .get = ¶m_get_int,
+ .get = ¶m_get_uint,
};
module_param_cb(page_reporting_order, &page_reporting_param_ops,
@@ -369,8 +364,9 @@ int page_reporting_register(struct page_reporting_dev_info *prdev)
* pageblock_order.
*/
- if (page_reporting_order == -1) {
- if (prdev->order > 0 && prdev->order <= MAX_PAGE_ORDER)
+ if (page_reporting_order == PAGE_REPORTING_ORDER_UNSPECIFIED) {
+ if (prdev->order != PAGE_REPORTING_ORDER_UNSPECIFIED &&
+ prdev->order <= MAX_PAGE_ORDER)
page_reporting_order = prdev->order;
else
page_reporting_order = pageblock_order;
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v2 1/4] mm/page_reporting: add PAGE_REPORTING_ORDER_UNSPECIFIED
2026-03-02 11:17 ` [PATCH v2 1/4] mm/page_reporting: add PAGE_REPORTING_ORDER_UNSPECIFIED Yuvraj Sakshith
@ 2026-03-02 14:57 ` David Hildenbrand (Arm)
0 siblings, 0 replies; 8+ messages in thread
From: David Hildenbrand (Arm) @ 2026-03-02 14:57 UTC (permalink / raw)
To: Yuvraj Sakshith, akpm, mst, jasowang, kys, haiyangz, wei.liu, decui
Cc: linux-mm, virtualization, linux-hyperv, linux-kernel, xuanzhuo,
eperezma, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
mhocko, jackmanb, hannes, ziy
On 3/2/26 12:17, Yuvraj Sakshith wrote:
> Drivers can pass order of pages to be reported while
> registering itself. Today, this is a magic number, 0.
>
> Label this with PAGE_REPORTING_ORDER_UNSPECIFIED and
> check for it when the driver is being registered.
>
> This macro will be used in relevant drivers next.
>
> Signed-off-by: Yuvraj Sakshith <yuvraj.sakshith@oss.qualcomm.com>
> ---
> include/linux/page_reporting.h | 1 +
> mm/page_reporting.c | 14 +++++---------
> 2 files changed, 6 insertions(+), 9 deletions(-)
>
> diff --git a/include/linux/page_reporting.h b/include/linux/page_reporting.h
> index fe648dfa3..d1886c657 100644
> --- a/include/linux/page_reporting.h
> +++ b/include/linux/page_reporting.h
> @@ -7,6 +7,7 @@
>
> /* This value should always be a power of 2, see page_reporting_cycle() */
> #define PAGE_REPORTING_CAPACITY 32
> +#define PAGE_REPORTING_ORDER_UNSPECIFIED 0
>
> struct page_reporting_dev_info {
> /* function that alters pages to make them "reported" */
> diff --git a/mm/page_reporting.c b/mm/page_reporting.c
> index e4c428e61..51cd88faf 100644
> --- a/mm/page_reporting.c
> +++ b/mm/page_reporting.c
> @@ -12,7 +12,7 @@
> #include "internal.h"
>
> /* Initialize to an unsupported value */
> -unsigned int page_reporting_order = -1;
> +unsigned int page_reporting_order = PAGE_REPORTING_ORDER_UNSPECIFIED;
>
> static int page_order_update_notify(const char *val, const struct kernel_param *kp)
> {
> @@ -25,12 +25,7 @@ static int page_order_update_notify(const char *val, const struct kernel_param *
>
> static const struct kernel_param_ops page_reporting_param_ops = {
> .set = &page_order_update_notify,
> - /*
> - * For the get op, use param_get_int instead of param_get_uint.
> - * This is to make sure that when unset the initialized value of
> - * -1 is shown correctly
> - */
> - .get = ¶m_get_int,
> + .get = ¶m_get_uint,
> };
>
> module_param_cb(page_reporting_order, &page_reporting_param_ops,
> @@ -369,8 +364,9 @@ int page_reporting_register(struct page_reporting_dev_info *prdev)
> * pageblock_order.
> */
>
> - if (page_reporting_order == -1) {
> - if (prdev->order > 0 && prdev->order <= MAX_PAGE_ORDER)
> + if (page_reporting_order == PAGE_REPORTING_ORDER_UNSPECIFIED) {
> + if (prdev->order != PAGE_REPORTING_ORDER_UNSPECIFIED &&
> + prdev->order <= MAX_PAGE_ORDER)
> page_reporting_order = prdev->order;
> else
> page_reporting_order = pageblock_order;
I think the change to page_reporting_order (and param_get_int) should
come after patch #4.
Otherwise, you temporarily change the semantics of
page_reporting_param_ops() etc.
So you should perform the page_reporting_order changes either in patch
#4 or in a new patch #5.
Apart from that LGTM.
--
Cheers,
David
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 2/4] virtio_balloon: set unspecified page reporting order
2026-03-02 11:17 [PATCH v2 0/4] Allow order zero pages in page reporting Yuvraj Sakshith
2026-03-02 11:17 ` [PATCH v2 1/4] mm/page_reporting: add PAGE_REPORTING_ORDER_UNSPECIFIED Yuvraj Sakshith
@ 2026-03-02 11:17 ` Yuvraj Sakshith
2026-03-02 15:00 ` David Hildenbrand (Arm)
2026-03-02 11:17 ` [PATCH v2 3/4] hv_balloon: " Yuvraj Sakshith
2026-03-02 11:17 ` [PATCH v2 4/4] mm/page_reporting: change PAGE_REPORTING_ORDER_UNSPECIFIED to -1 Yuvraj Sakshith
3 siblings, 1 reply; 8+ messages in thread
From: Yuvraj Sakshith @ 2026-03-02 11:17 UTC (permalink / raw)
To: akpm, mst, david, jasowang, kys, haiyangz, wei.liu, decui
Cc: linux-mm, virtualization, linux-hyperv, linux-kernel, xuanzhuo,
eperezma, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
mhocko, jackmanb, hannes, ziy
virtio_balloon page reporting order is set to MAX_PAGE_ORDER implicitly
as vb->prdev.order is never initialised and is auto-set to zero.
Explicitly mention usage of default page order by making use of
PAGE_REPORTING_ORDER_UNSPECIFIED fallback value.
Signed-off-by: Yuvraj Sakshith <yuvraj.sakshith@oss.qualcomm.com>
---
drivers/virtio/virtio_balloon.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/virtio/virtio_balloon.c b/drivers/virtio/virtio_balloon.c
index 74fe59f5a..2dfe2bcd8 100644
--- a/drivers/virtio/virtio_balloon.c
+++ b/drivers/virtio/virtio_balloon.c
@@ -1044,6 +1044,8 @@ static int virtballoon_probe(struct virtio_device *vdev)
goto out_unregister_oom;
}
+ vb->pr_dev_info.order = PAGE_REPORTING_ORDER_UNSPECIFIED;
+
/*
* The default page reporting order is @pageblock_order, which
* corresponds to 512MB in size on ARM64 when 64KB base page
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread
* Re: [PATCH v2 2/4] virtio_balloon: set unspecified page reporting order
2026-03-02 11:17 ` [PATCH v2 2/4] virtio_balloon: set unspecified page reporting order Yuvraj Sakshith
@ 2026-03-02 15:00 ` David Hildenbrand (Arm)
0 siblings, 0 replies; 8+ messages in thread
From: David Hildenbrand (Arm) @ 2026-03-02 15:00 UTC (permalink / raw)
To: Yuvraj Sakshith, akpm, mst, jasowang, kys, haiyangz, wei.liu, decui
Cc: linux-mm, virtualization, linux-hyperv, linux-kernel, xuanzhuo,
eperezma, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
mhocko, jackmanb, hannes, ziy
On 3/2/26 12:17, Yuvraj Sakshith wrote:
> virtio_balloon page reporting order is set to MAX_PAGE_ORDER implicitly
> as vb->prdev.order is never initialised and is auto-set to zero.
>
> Explicitly mention usage of default page order by making use of
> PAGE_REPORTING_ORDER_UNSPECIFIED fallback value.
>
> Signed-off-by: Yuvraj Sakshith <yuvraj.sakshith@oss.qualcomm.com>
> ---
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
--
Cheers,
David
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 3/4] hv_balloon: set unspecified page reporting order
2026-03-02 11:17 [PATCH v2 0/4] Allow order zero pages in page reporting Yuvraj Sakshith
2026-03-02 11:17 ` [PATCH v2 1/4] mm/page_reporting: add PAGE_REPORTING_ORDER_UNSPECIFIED Yuvraj Sakshith
2026-03-02 11:17 ` [PATCH v2 2/4] virtio_balloon: set unspecified page reporting order Yuvraj Sakshith
@ 2026-03-02 11:17 ` Yuvraj Sakshith
2026-03-02 15:00 ` David Hildenbrand (Arm)
2026-03-02 11:17 ` [PATCH v2 4/4] mm/page_reporting: change PAGE_REPORTING_ORDER_UNSPECIFIED to -1 Yuvraj Sakshith
3 siblings, 1 reply; 8+ messages in thread
From: Yuvraj Sakshith @ 2026-03-02 11:17 UTC (permalink / raw)
To: akpm, mst, david, jasowang, kys, haiyangz, wei.liu, decui
Cc: linux-mm, virtualization, linux-hyperv, linux-kernel, xuanzhuo,
eperezma, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
mhocko, jackmanb, hannes, ziy
Explicitly mention page reporting order to be set to
default value using PAGE_REPORTING_ORDER_UNSPECIFIED fallback
value.
Signed-off-by: Yuvraj Sakshith <yuvraj.sakshith@oss.qualcomm.com>
---
drivers/hv/hv_balloon.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/hv/hv_balloon.c b/drivers/hv/hv_balloon.c
index 2b4080e51..09da68101 100644
--- a/drivers/hv/hv_balloon.c
+++ b/drivers/hv/hv_balloon.c
@@ -1663,7 +1663,7 @@ static void enable_page_reporting(void)
* We let the page_reporting_order parameter decide the order
* in the page_reporting code
*/
- dm_device.pr_dev_info.order = 0;
+ dm_device.pr_dev_info.order = PAGE_REPORTING_ORDER_UNSPECIFIED;
ret = page_reporting_register(&dm_device.pr_dev_info);
if (ret < 0) {
dm_device.pr_dev_info.report = NULL;
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread* Re: [PATCH v2 3/4] hv_balloon: set unspecified page reporting order
2026-03-02 11:17 ` [PATCH v2 3/4] hv_balloon: " Yuvraj Sakshith
@ 2026-03-02 15:00 ` David Hildenbrand (Arm)
0 siblings, 0 replies; 8+ messages in thread
From: David Hildenbrand (Arm) @ 2026-03-02 15:00 UTC (permalink / raw)
To: Yuvraj Sakshith, akpm, mst, jasowang, kys, haiyangz, wei.liu, decui
Cc: linux-mm, virtualization, linux-hyperv, linux-kernel, xuanzhuo,
eperezma, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
mhocko, jackmanb, hannes, ziy
On 3/2/26 12:17, Yuvraj Sakshith wrote:
> Explicitly mention page reporting order to be set to
> default value using PAGE_REPORTING_ORDER_UNSPECIFIED fallback
> value.
>
> Signed-off-by: Yuvraj Sakshith <yuvraj.sakshith@oss.qualcomm.com>
> ---
Acked-by: David Hildenbrand (Arm) <david@kernel.org>
--
Cheers,
David
^ permalink raw reply [flat|nested] 8+ messages in thread
* [PATCH v2 4/4] mm/page_reporting: change PAGE_REPORTING_ORDER_UNSPECIFIED to -1
2026-03-02 11:17 [PATCH v2 0/4] Allow order zero pages in page reporting Yuvraj Sakshith
` (2 preceding siblings ...)
2026-03-02 11:17 ` [PATCH v2 3/4] hv_balloon: " Yuvraj Sakshith
@ 2026-03-02 11:17 ` Yuvraj Sakshith
3 siblings, 0 replies; 8+ messages in thread
From: Yuvraj Sakshith @ 2026-03-02 11:17 UTC (permalink / raw)
To: akpm, mst, david, jasowang, kys, haiyangz, wei.liu, decui
Cc: linux-mm, virtualization, linux-hyperv, linux-kernel, xuanzhuo,
eperezma, lorenzo.stoakes, Liam.Howlett, vbabka, rppt, surenb,
mhocko, jackmanb, hannes, ziy
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.
Signed-off-by: Yuvraj Sakshith <yuvraj.sakshith@oss.qualcomm.com>
---
include/linux/page_reporting.h | 2 +-
mm/page_reporting.c | 7 ++++++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/include/linux/page_reporting.h b/include/linux/page_reporting.h
index d1886c657..9d4ca5c21 100644
--- a/include/linux/page_reporting.h
+++ b/include/linux/page_reporting.h
@@ -7,7 +7,7 @@
/* This value should always be a power of 2, see page_reporting_cycle() */
#define PAGE_REPORTING_CAPACITY 32
-#define PAGE_REPORTING_ORDER_UNSPECIFIED 0
+#define PAGE_REPORTING_ORDER_UNSPECIFIED -1
struct page_reporting_dev_info {
/* function that alters pages to make them "reported" */
diff --git a/mm/page_reporting.c b/mm/page_reporting.c
index 51cd88faf..21c11b75e 100644
--- a/mm/page_reporting.c
+++ b/mm/page_reporting.c
@@ -25,7 +25,12 @@ static int page_order_update_notify(const char *val, const struct kernel_param *
static const struct kernel_param_ops page_reporting_param_ops = {
.set = &page_order_update_notify,
- .get = ¶m_get_uint,
+ /*
+ * For the get op, use param_get_int instead of param_get_uint.
+ * This is to make sure that when unset the initialized value of
+ * -1 is shown correctly
+ */
+ .get = ¶m_get_int,
};
module_param_cb(page_reporting_order, &page_reporting_param_ops,
--
2.34.1
^ permalink raw reply [flat|nested] 8+ messages in thread