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 X-Spam-Level: X-Spam-Status: No, score=-19.6 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,NICE_REPLY_A, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 73D96C433F5 for ; Mon, 13 Sep 2021 12:15:31 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0A72C60F9B for ; Mon, 13 Sep 2021 12:15:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0A72C60F9B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 868F46B0071; Mon, 13 Sep 2021 08:15:30 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 818FD6B0072; Mon, 13 Sep 2021 08:15:30 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6DF996B0073; Mon, 13 Sep 2021 08:15:30 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0037.hostedemail.com [216.40.44.37]) by kanga.kvack.org (Postfix) with ESMTP id 5EB576B0071 for ; Mon, 13 Sep 2021 08:15:30 -0400 (EDT) Received: from smtpin11.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 0C66E8249980 for ; Mon, 13 Sep 2021 12:15:30 +0000 (UTC) X-FDA: 78582445620.11.BB143C5 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf18.hostedemail.com (Postfix) with ESMTP id 959E44002088 for ; Mon, 13 Sep 2021 12:15:29 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631535328; 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=y2p5SDD6IORI+fInxe4LBTCv8TDK2jhwukd7jpIldoU=; b=H3z+jgX3Y6D2RDkKriqjEnnBV3g+KfTjaMgRrwaXE/eUzPKpGx/jJSyCAZHVEElHv8Wd3x tNUoIjyL0NVRqiyElUXxwEeycoCirkgEH+21smqAlVxbVbKxEDtlXIKjz2jy9Chna2fOUh isbbbKFMd5bbS9Ws0w4DhxVCgKq0pbM= 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-127-GC9IvTspNZSAjBNib0kdyQ-1; Mon, 13 Sep 2021 08:15:27 -0400 X-MC-Unique: GC9IvTspNZSAjBNib0kdyQ-1 Received: by mail-wm1-f71.google.com with SMTP id y23-20020a05600c365700b003015b277f98so1240713wmq.2 for ; Mon, 13 Sep 2021 05:15:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; 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=y2p5SDD6IORI+fInxe4LBTCv8TDK2jhwukd7jpIldoU=; b=GtlypJu/rTla8rDmo4oZxu71YvZ3m4CrMlktlUScpUlbvZ21/80lXzE2RyIyx6siX0 RNMd63OY3qAOCGD3ngbq34eS0hXEBDj7N+WNjko8sUdeEtWalRQuNMDzndrSiGY+DMiK kRBE0wfDsU75jrjJNzDGSqp8r1BGalwIpWVXkJTeC5+CiPbaKL9yH6sjjRCSuAaocErY DGPmsLUjx5ZkarjDZWVf9Jq11iE4isoQtY0y5lSXg+fWMlVaV5ay8VyuGEYBWG39PHrf BtwZ7roLsVqlK4nfp3iPHe/v+CGeTKwzQf7oSUNh26d4+Buo9GWvLIzm3BSm32SW2dYQ We0A== X-Gm-Message-State: AOAM532HosJhw4/CntxMYBHGzVX92msTE6neMJHsKFp6PE+nQEH3a+IC hq1Ih32Tca+xl/WizWw87oB+MqN/ayR7rlatPM69Gs0h9G24Bra9CCc87Z+gitGOiAkRRQ7YjH/ khEk8KRRjLCs= X-Received: by 2002:adf:eb89:: with SMTP id t9mr12555005wrn.66.1631535326607; Mon, 13 Sep 2021 05:15:26 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyCxFO6DKktrj8lKNb1+U4fp7k8BOq4Ntk4gLy+hpqYduDMn4fqB/UjPSNSs1Kk2rNklNZzRg== X-Received: by 2002:adf:eb89:: with SMTP id t9mr12554979wrn.66.1631535326400; Mon, 13 Sep 2021 05:15:26 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6576.dip0.t-ipconnect.de. [91.12.101.118]) by smtp.gmail.com with ESMTPSA id m3sm9583281wrg.45.2021.09.13.05.15.25 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 13 Sep 2021 05:15:26 -0700 (PDT) Subject: Re: [PATCH v2] mm/page_isolation: don't putback unisolated page To: Miaohe Lin , akpm@linux-foundation.org Cc: jhubbard@nvidia.com, vbabka@suse.cz, iamjoonsoo.kim@lge.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210913115021.27597-1-linmiaohe@huawei.com> From: David Hildenbrand Organization: Red Hat Message-ID: <6a096a23-83b8-139d-b2dd-87ea3e405050@redhat.com> Date: Mon, 13 Sep 2021 14:15:25 +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: <20210913115021.27597-1-linmiaohe@huawei.com> X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 959E44002088 Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=H3z+jgX3; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf18.hostedemail.com: domain of david@redhat.com has no SPF policy when checking 216.205.24.124) smtp.mailfrom=david@redhat.com X-Stat-Signature: permoxrkytxpm7bjqn5r9x78qz4rcird X-HE-Tag: 1631535329-705186 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 13.09.21 13:50, 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 > --- > v1->v2: > Add VM_WARN_ON to catch unexpected isolating failure. > --- > mm/page_isolation.c | 9 +++++++-- > 1 file changed, 7 insertions(+), 2 deletions(-) > > diff --git a/mm/page_isolation.c b/mm/page_isolation.c > index f93cc63d8fa1..f67c4c70f17f 100644 > --- a/mm/page_isolation.c > +++ b/mm/page_isolation.c > @@ -94,8 +94,13 @@ static void unset_migratetype_isolate(struct page *page, unsigned migratetype) > buddy = page + (buddy_pfn - pfn); > > if (!is_migrate_isolate_page(buddy)) { > - __isolate_free_page(page, order); > - isolated_page = true; > + isolated_page = !!__isolate_free_page(page, order); > + /* > + * Isolating a free page in an isolated pageblock > + * is expected to always work as watermarks don't > + * apply here. > + */ > + VM_WARN_ON(!isolated_page); Didn't we discuss that this can never happen? In that case, the patch description+subject needs updating and the "Fixes" line would be wrong. > } > } > } > -- Thanks, David / dhildenb