From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 307FDECAAA1 for ; Thu, 15 Sep 2022 07:26:21 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3A5156B0071; Thu, 15 Sep 2022 03:26:20 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 353876B0073; Thu, 15 Sep 2022 03:26:20 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 21B6B8D0001; Thu, 15 Sep 2022 03:26:20 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 0E5046B0071 for ; Thu, 15 Sep 2022 03:26:20 -0400 (EDT) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id D558CA7585 for ; Thu, 15 Sep 2022 07:26:19 +0000 (UTC) X-FDA: 79913486478.24.D7E848B Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by imf07.hostedemail.com (Postfix) with ESMTP id 7910140090 for ; Thu, 15 Sep 2022 07:26:18 +0000 (UTC) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 3AD7C22BFB; Thu, 15 Sep 2022 07:26:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1663226777; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OP4fCqJiZrcUBoKZtnNq2ubY4gQ9sGvrUFWRv/Jwd/8=; b=K6GXXjYpighhPMObs6jla85a3QvKkacXUh11NLyl+oTFryVPxyaw8fj1E3ROZ48YWBp4GD ylKX5OP5dqK92ul5gys/9sQXX8/ocD+vvqd9gBXmGP1z3BusRqurtGncmiDQ+xbDe0QQYK ZKIZHW5Un18Ef3+6uRc1X5WSWINm9Jk= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1663226777; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=OP4fCqJiZrcUBoKZtnNq2ubY4gQ9sGvrUFWRv/Jwd/8=; b=IC79jF+zy7RedPVgN783FEHhP5C2PJJNjw0IdxBcm21zLn4/8gkp4iSripdalf5Hdxuwdn 3Bp/9HEokb2bgkCQ== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id CA629133A7; Thu, 15 Sep 2022 07:26:16 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id SSmoLpjTImOfYQAAMHmgww (envelope-from ); Thu, 15 Sep 2022 07:26:16 +0000 Date: Thu, 15 Sep 2022 09:26:15 +0200 From: Oscar Salvador To: Miaohe Lin Cc: akpm@linux-foundation.org, david@redhat.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 08/16] mm/page_alloc: add missing is_migrate_isolate() check in set_page_guard() Message-ID: References: <20220909092451.24883-1-linmiaohe@huawei.com> <20220909092451.24883-9-linmiaohe@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220909092451.24883-9-linmiaohe@huawei.com> ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=K6GXXjYp; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=IC79jF+z; spf=pass (imf07.hostedemail.com: domain of osalvador@suse.de designates 195.135.220.28 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1663226778; a=rsa-sha256; cv=none; b=4ba3h/0s0JcnTFIQFPmqIXME++S9zFPX1K3xhzE4cGFpM7gLd8APBc3DrgZj5JUYFaD97Z uYa2inrg5CY50gpwZOPLBXkgZqITwDKrPvlnfl8at7e/cprSc4MJKM0HNBaPg5C2kvsV/9 RhGD2Jn6dHQBBreCxY6q/tqCUIGyo3M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1663226778; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=OP4fCqJiZrcUBoKZtnNq2ubY4gQ9sGvrUFWRv/Jwd/8=; b=FrezFqjx9nlfPjIMsdp2F5dTT8nvv8iqcbkscc4qRLlm7+u5+tXQ+KX1SKUVFUzM4p1bIM ScL4P2Ry36DD2/tamF0Xz5sh2dVl4YELfD2il+2fGE8MFJnNpTMFRRRTXmj+xWPKg6CdQb Eme6JwabAJj0d+spIIsWF/OyUonlUyc= X-Stat-Signature: p6kad67hzzzbxdnxbgicwkp9kobfx95o X-Rspamd-Queue-Id: 7910140090 X-Rspam-User: Authentication-Results: imf07.hostedemail.com; dkim=pass header.d=suse.de header.s=susede2_rsa header.b=K6GXXjYp; dkim=pass header.d=suse.de header.s=susede2_ed25519 header.b=IC79jF+z; spf=pass (imf07.hostedemail.com: domain of osalvador@suse.de designates 195.135.220.28 as permitted sender) smtp.mailfrom=osalvador@suse.de; dmarc=pass (policy=none) header.from=suse.de X-Rspamd-Server: rspam12 X-HE-Tag: 1663226778-573230 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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 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 > --- > 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