Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp2711638pxb; Mon, 6 Sep 2021 03:44:17 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxCgDceSU1SBMnqavRxeVLD9+9/J4S9ruAdjxWevHsclzAXxGf8yHtQStd0oW6k2Zx5xOU2 X-Received: by 2002:a17:907:7703:: with SMTP id kw3mr13042894ejc.34.1630925057665; Mon, 06 Sep 2021 03:44:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1630925057; cv=none; d=google.com; s=arc-20160816; b=Pw/bKFQXwocjRPUC0CaroxIeMIzFpWigMNCjL7t7WP/BI4pOPnJL8tT9TSr9O2pXiG ezMcOn2ze6+KJ2qG8kAC77DzWa9TgVaZWO75vDKbTyR/gimDfpoevx8pMZAT1ROCuGqC 7qStf653sWkryxuAnKHxSa6mxUvTS0mHdpIlGDQlI8naYg2Fkpodf82FhkvjSZT1Oamp YGoYxzZImexOZ5wRg8tfXGjb01EUR2oubXKIN73u4tRUE4UmLDhJ42G6OtIIJ36mxfO/ sHzEZd5I7VHVRw6AM4kHjFZ+Qcy6J4PAv/PttaQlquPtbmhXisKUx4CgTmiTeRRude3x s6gQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:organization :from:references:cc:to:subject:dkim-signature; bh=cYA37SlRuRPHoIjk69T5OroCeNXU9xA4x0HI4zeLbQw=; b=FpK4Rp0Dxq9RVkyz/M2tMwXbkoDHeD/fFXJb4xnhEyfnrayovyye05sS8PRJRcZEVK ceA9XiArhafaKgsITgCfz8brLQbab79oVhR8WQwByl0kxPE7aK5rrCTmpH0V/X1T8fJ/ Ocb/jYeyV4Lg43uTdwJunq3Rs3ajl/DLUyLRYdkUMZDtqj8swJSixjU5xuuMvz/hAVX/ UaGAEKrlWOkr3aD/6EABmtdmPGKJXAjPkrdUxPpQ7AY20V6XXPrfadfPNPBlGImxlav9 BtKkjGDDgDE7Cn/aSE40Thix+MyfPvdg89Z2oz/ejlBVXvScwG9TWxccB5ycHsKLVwnN Ys3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N3lbHd06; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id h93si10427122edd.487.2021.09.06.03.43.53; Mon, 06 Sep 2021 03:44:17 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=N3lbHd06; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241234AbhIFJln (ORCPT + 99 others); Mon, 6 Sep 2021 05:41:43 -0400 Received: from us-smtp-delivery-124.mimecast.com ([216.205.24.124]:45862 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239548AbhIFJli (ORCPT ); Mon, 6 Sep 2021 05:41:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1630921233; h=from:from: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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=cYA37SlRuRPHoIjk69T5OroCeNXU9xA4x0HI4zeLbQw=; b=N3lbHd06W27kO/UlKam+Mu0aM+/CXd0eB3Pg+TcfCIqUtOh4A3b2Mi5FWd5Ti79koQ876a xtPsLicw+WPFIbKq006JssSVdlsb6voTTc5w8TwaN1L5xVYoR5g6pj9gJhEtwIHqrr2ovG UcFc2MPvWLzJBNp0pFSK0pspxp2TUG0= Received: from mail-wm1-f71.google.com (mail-wm1-f71.google.com [209.85.128.71]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-461-uHdRa3-hNDW3hv6og1Rsqg-1; Mon, 06 Sep 2021 05:40:32 -0400 X-MC-Unique: uHdRa3-hNDW3hv6og1Rsqg-1 Received: by mail-wm1-f71.google.com with SMTP id n16-20020a1c7210000000b002ea2ed60dc6so1997745wmc.0 for ; Mon, 06 Sep 2021 02:40:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:organization :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=cYA37SlRuRPHoIjk69T5OroCeNXU9xA4x0HI4zeLbQw=; b=Oo+DwInh/nAvpN8T6PSjfJ2GH0wZrMTVpaOG2egV+tUxPCGtT2HcbMAUdsoTeiXGWT yHrhBVBLYWj2xex6VEZrO82d9HVlCGLJrEty3AE9qSa71r9uVFWIW/m51dJz/kKspbRb H/H0GFBNXxRIW/hyklv2OxxnA5u4A9IJAMRPT3vpPBBGNajA2jhOHLdhnwrR+l/1dBJI A0wSxyCpsX+Ubu6ILYGCIHcHxMdcMcTgPlC96SSYwfAOc/Nm/0ebcKn1xBhc4G2S6upE NCGje0hTj0LgGxNwZmaXkft1XhyYzITRRIIdvSuCb0bOI2/RUlDMH35UREInufpdU4ZJ m0AA== X-Gm-Message-State: AOAM532Bvo7oZXshUBdM37U5eAUc7L4R2l+YUcWMjDASGFmTMWTdPR5g gZcD9y/PaJIaVACpmQDvzeAm+Bmx/Rk3XQiLcJ+If1ZpBk0MOGJ8ktsHTPzdfjatp/T4epnj6Wr wuaiaBg+AEQT2rv0ciLjtdb8WvFfcWvNIinHBm73b4BbYlD3XUva17qhYtTUSHDw4rzgYdQw1 X-Received: by 2002:a1c:4cd:: with SMTP id 196mr10331372wme.10.1630921231215; Mon, 06 Sep 2021 02:40:31 -0700 (PDT) X-Received: by 2002:a1c:4cd:: with SMTP id 196mr10331346wme.10.1630921230940; Mon, 06 Sep 2021 02:40:30 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6323.dip0.t-ipconnect.de. [91.12.99.35]) by smtp.gmail.com with ESMTPSA id f20sm6656589wmb.32.2021.09.06.02.40.30 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 06 Sep 2021 02:40:30 -0700 (PDT) Subject: Re: [PATCH] mm/page_isolation: don't putback unisolated page To: Miaohe Lin , akpm@linux-foundation.org Cc: vbabka@suse.cz, iamjoonsoo.kim@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210904091839.20270-1-linmiaohe@huawei.com> From: David Hildenbrand Organization: Red Hat Message-ID: Date: Mon, 6 Sep 2021 11:40:29 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.11.0 MIME-Version: 1.0 In-Reply-To: <20210904091839.20270-1-linmiaohe@huawei.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 04.09.21 11:18, Miaohe Lin wrote: > If __isolate_free_page() failed, due to zone watermark check, the page is > still on the free list. But this page will be put back to free list again > via __putback_isolated_page() now. This may trigger page->flags checks in > __free_one_page() if PageReported is set. Or we will corrupt the free list > because list_add() will be called for pages already on another list. > > Fixes: 3c605096d315 ("mm/page_alloc: restrict max order of merging on isolated pageblock") > Signed-off-by: Miaohe Lin > --- > mm/page_isolation.c | 6 ++---- > 1 file changed, 2 insertions(+), 4 deletions(-) > > diff --git a/mm/page_isolation.c b/mm/page_isolation.c > index 9bb562d5d194..7d70d772525c 100644 > --- a/mm/page_isolation.c > +++ b/mm/page_isolation.c > @@ -93,10 +93,8 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype) > buddy_pfn = __find_buddy_pfn(pfn, order); > buddy = page + (buddy_pfn - pfn); > > - if (!is_migrate_isolate_page(buddy)) { > - __isolate_free_page(page, order); > - isolated_page = true; > - } > + if (!is_migrate_isolate_page(buddy)) > + isolated_page = !!__isolate_free_page(page, order); > } > } > > Shouldn't we much rather force to ignore watermarks here and make sure __isolate_free_page() never fails? -- Thanks, David / dhildenb