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=-12.0 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,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 91B4BC433F5 for ; Tue, 14 Sep 2021 18:13:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 46F9F60FC0 for ; Tue, 14 Sep 2021 18:13:35 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 46F9F60FC0 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 BF6766B0071; Tue, 14 Sep 2021 14:13:34 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id BA65F6B0072; Tue, 14 Sep 2021 14:13:34 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A21A4900002; Tue, 14 Sep 2021 14:13:34 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0220.hostedemail.com [216.40.44.220]) by kanga.kvack.org (Postfix) with ESMTP id 9041E6B0071 for ; Tue, 14 Sep 2021 14:13:34 -0400 (EDT) Received: from smtpin25.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 459C982499B9 for ; Tue, 14 Sep 2021 18:13:34 +0000 (UTC) X-FDA: 78586976748.25.165B0EB Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by imf06.hostedemail.com (Postfix) with ESMTP id DBA1B801A8A3 for ; Tue, 14 Sep 2021 18:13:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1631643213; 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=YySJec8Y5cj/XTCgQeMbQDasJy1FDWvLFTbpcSw8zPo=; b=gZPUNJMVNDIGawqnU/1I1AUYuerIZXAS9s1eE6q8SKXKBHTcvJzQnj5uJO6+GxEJ9LiK/g vppeoqU1McDMnXREpF6156QQd4/mFRzGVhinLzB8J3xrwdQ4E5Cj+Gr3g/vVqQUcHeCroz X/7iDNMNGF6cuomTcMAFYcW4kZ0wUqU= 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-539-gLTowrb_OZ-Irjov9wxtXg-1; Tue, 14 Sep 2021 14:13:31 -0400 X-MC-Unique: gLTowrb_OZ-Irjov9wxtXg-1 Received: by mail-wm1-f71.google.com with SMTP id m4-20020a05600c3b0400b00303b904380dso974175wms.6 for ; Tue, 14 Sep 2021 11:13:31 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:to:cc:references:from:organization:subject :message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=YySJec8Y5cj/XTCgQeMbQDasJy1FDWvLFTbpcSw8zPo=; b=43eFdwRtkEzHNijYnepIj3/DnoQ8bAHLJuUIh8jj8biwqAcmZGMzoTAz+sA4bQsJgx bpRpUHGIYO3G4ZCyej/hoU1oeN5AQs6jW8ui3gWzyrzvnHOsO6aqqnqMc9OBw0zqaNIM oTEv5QLe+hJYikPG8ZislhlZvuzhMxy89/mKrmH5B9k9J4w4xQKbrXhw5UlmdAOBBPAR ZMOIyPsxklrmHnyFNSk1FftDCfFTRJdMGQ15KvWqWg5e4ZQslG033k1G6gFYe8t52Twr V7V5xsrsTW66o0k+CTRzTu+Y3B4COTXXw1Wo7yY56/UYt9iGeKU6HgOyXqrX+O3jS5UA FzDQ== X-Gm-Message-State: AOAM530PRH/RP6Jo84Zc7vYt3LQQLj1OzruA1i0k5KeVfJqVoZp6/hmt 0uwpYSaqdGsv31apu/J1fybp5paErQY94cZAACGP+eJQjcKc5xK8qQbSndRvNfE2PEMkxTZz6eB 8VJjME+7dKms= X-Received: by 2002:adf:f18a:: with SMTP id h10mr608670wro.42.1631643210693; Tue, 14 Sep 2021 11:13:30 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXuSsvldGJZ2y/6wWeFKg2c8pciC4yAYkQ8E9oj79YWzMy6FRVZq0JOMa3+LrYgPDmO+KDiA== X-Received: by 2002:adf:f18a:: with SMTP id h10mr608649wro.42.1631643210468; Tue, 14 Sep 2021 11:13:30 -0700 (PDT) Received: from [192.168.3.132] (p5b0c6041.dip0.t-ipconnect.de. [91.12.96.65]) by smtp.gmail.com with ESMTPSA id z79sm512668wmc.17.2021.09.14.11.13.29 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 14 Sep 2021 11:13:29 -0700 (PDT) To: Miaohe Lin , akpm@linux-foundation.org Cc: mhocko@suse.com, vbabka@suse.cz, linux-mm@kvack.org, linux-kernel@vger.kernel.org References: <20210914114348.15569-1-linmiaohe@huawei.com> From: David Hildenbrand Organization: Red Hat Subject: Re: [PATCH v3] mm/page_isolation: fix potential missing call to unset_migratetype_isolate() Message-ID: <454bd51f-d7ee-6304-af23-7c95874f8890@redhat.com> Date: Tue, 14 Sep 2021 20:13:28 +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: <20210914114348.15569-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 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: DBA1B801A8A3 Authentication-Results: imf06.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=gZPUNJMV; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf06.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: 5o458m8xc7s3dzkkcc6xaot1ugyh5gc6 X-HE-Tag: 1631643213-764463 Content-Transfer-Encoding: quoted-printable 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 14.09.21 13:43, Miaohe Lin wrote: > In start_isolate_page_range() undo path, pfn_to_online_page() just chec= ks > the first pfn in a pageblock while __first_valid_page() will traverse t= he > pageblock until the first online pfn is found. So we may miss the call = to > unset_migratetype_isolate() in undo path and pages will remain isolated > unexpectedly. Fix this by calling undo_isolate_page_range() and this wi= ll > also help to simplify the code further. Note we shouldn't ever trigger = it > because MAX_ORDER-1 aligned pfn ranges shouldn't contain memory holes n= ow. >=20 > Fixes: 2ce13640b3f4 ("mm: __first_valid_page skip over offline pages") > Signed-off-by: Miaohe Lin I read Michals reply, however, I am quite conservative with Fixes: tags.=20 If there is nothing to fix, there is no BUG and the patch consequently=20 merely a cleanup. I'd have gone with a patch description/subject as follows: " mm/page_isolation: cleanup start_isolate_page_range() We can heavily simplify the code by reusing undo_isolate_page_range(). Note that this also tackles a theoretical issue that would have been a=20 real BUG before commit c5e79ef561b0 ("mm/memory_hotplug.c: don't allow=20 to online/offline memory blocks with holes"). In=20 start_isolate_page_range() undo path, pfn_to_online_page() just checks the first pfn in a pageblock while __first_valid_page() will traverse=20 the pageblock until the first online pfn is found. So we may miss the=20 call to unset_migratetype_isolate() in undo path and pages will remain=20 isolated unexpectedly. Nowadays, start_isolate_page_range() never gets called on ranges that=20 might contain memory holes. Consequently, this patch is not a fix but a=20 cleanup. " Anyhow, whatever the other people prefer, no strong opinion. Reviewed-by: David Hildenbrand --=20 Thanks, David / dhildenb