Re: [PATCH 07/10] mm/page_reporting: Fix MAX_ORDER usage in page_reporting_register()

From: Vlastimil Babka
Date: Tue Mar 21 2023 - 04:02:10 EST


On 3/15/23 12:31, Kirill A. Shutemov wrote:
> MAX_ORDER is not inclusive: the maximum allocation order buddy allocator
> can deliver is MAX_ORDER-1.
>
> Fix MAX_ORDER usage in page_reporting_register().
>
> Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>

Reviewed-by: Vlastimil Babka <vbabka@xxxxxxx>

> Cc: Alexander Duyck <alexander.h.duyck@xxxxxxxxxxxxxxx>
> ---
> mm/page_reporting.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/mm/page_reporting.c b/mm/page_reporting.c
> index c65813a9dc78..275b466de37b 100644
> --- a/mm/page_reporting.c
> +++ b/mm/page_reporting.c
> @@ -370,7 +370,7 @@ int page_reporting_register(struct page_reporting_dev_info *prdev)
> */
>
> if (page_reporting_order == -1) {
> - if (prdev->order > 0 && prdev->order <= MAX_ORDER)
> + if (prdev->order > 0 && prdev->order < MAX_ORDER)
> page_reporting_order = prdev->order;
> else
> page_reporting_order = pageblock_order;