[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YyLTl8FvmcRuUYi9@localhost.localdomain>
Date: Thu, 15 Sep 2022 09:26:15 +0200
From: Oscar Salvador <osalvador@...e.de>
To: Miaohe Lin <linmiaohe@...wei.com>
Cc: akpm@...ux-foundation.org, david@...hat.com, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH 08/16] mm/page_alloc: add missing is_migrate_isolate()
check in set_page_guard()
On Fri, Sep 09, 2022 at 05:24:43PM +0800, Miaohe Lin wrote:
> In MIGRATE_ISOLATE case, zone freepage state shouldn't be modified as
> caller will take care of it. Add missing is_migrate_isolate() here to
> avoid possible unbalanced freepage state.
>
> Signed-off-by: Miaohe Lin <linmiaohe@...wei.com>
Ok, I gave it some thought and I guess it's safe to assume that this would happen if
someone isolates the block, and then we face an MCE failure/soft-offline on a page
within that block.
take_page_off_buddy
break_down_buddy_pages
set_page_guard
will trigger __mod_zone_freepage_state(), which already had been triggered back
when the block was isolated.
I think the changelog could grow fatter to better explain the issue.
Reviewed-by: Oscar Salvador <osalvador@...e.de>
> ---
> mm/page_alloc.c | 3 ++-
> 1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/mm/page_alloc.c b/mm/page_alloc.c
> index a35ef385d906..94baf33da865 100644
> --- a/mm/page_alloc.c
> +++ b/mm/page_alloc.c
> @@ -873,7 +873,8 @@ static inline bool set_page_guard(struct zone *zone, struct page *page,
> INIT_LIST_HEAD(&page->buddy_list);
> set_page_private(page, order);
> /* Guard pages are not available for any usage */
> - __mod_zone_freepage_state(zone, -(1 << order), migratetype);
> + if (!is_migrate_isolate(migratetype))
> + __mod_zone_freepage_state(zone, -(1 << order), migratetype);
>
> return true;
> }
> --
> 2.23.0
>
--
Oscar Salvador
SUSE Labs
Powered by blists - more mailing lists