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=-7.6 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no 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 380CFC433FE for ; Mon, 6 Sep 2021 11:42:53 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B3D7960F43 for ; Mon, 6 Sep 2021 11:42:52 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B3D7960F43 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=huawei.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 31FC5900002; Mon, 6 Sep 2021 07:42:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2CF566B0072; Mon, 6 Sep 2021 07:42:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1BD89900002; Mon, 6 Sep 2021 07:42:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0050.hostedemail.com [216.40.44.50]) by kanga.kvack.org (Postfix) with ESMTP id 0C6C16B0071 for ; Mon, 6 Sep 2021 07:42:52 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id A62B1181EBA48 for ; Mon, 6 Sep 2021 11:42:51 +0000 (UTC) X-FDA: 78556961742.38.88883C9 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf17.hostedemail.com (Postfix) with ESMTP id BC7ABF000090 for ; Mon, 6 Sep 2021 11:42:50 +0000 (UTC) Received: from dggeme703-chm.china.huawei.com (unknown [172.30.72.57]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4H362N10Y7z8sqS; Mon, 6 Sep 2021 19:42:20 +0800 (CST) Received: from [10.174.178.100] (10.174.178.100) by dggeme703-chm.china.huawei.com (10.1.199.99) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.2308.8; Mon, 6 Sep 2021 19:42:47 +0800 Subject: Re: [PATCH] mm/page_isolation: fix potential missing call to unset_migratetype_isolate() To: David Hildenbrand , CC: , , , References: <20210904092053.33037-1-linmiaohe@huawei.com> From: Miaohe Lin Message-ID: Date: Mon, 6 Sep 2021 19:42:47 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.178.100] X-ClientProxiedBy: dggems706-chm.china.huawei.com (10.3.19.183) To dggeme703-chm.china.huawei.com (10.1.199.99) X-CFilter-Loop: Reflected Authentication-Results: imf17.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=huawei.com; spf=pass (imf17.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: BC7ABF000090 X-Stat-Signature: imj5mzdku73de53jaonxagx9xmuabszg X-HE-Tag: 1630928570-836987 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 2021/9/6 17:46, David Hildenbrand wrote: > On 06.09.21 11:38, Miaohe Lin wrote: >> On 2021/9/6 17:27, David Hildenbrand wrote: >>> On 04.09.21 11:20, Miaohe Lin wrote: >>>> In start_isolate_page_range() undo path, pfn_to_online_page() just checks >>>> the first pfn in a pageblock while __first_valid_page() will traverse the >>>> 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 will >>>> also help to remove some duplicated codes. >>>> >>>> Fixes: 2ce13640b3f4 ("mm: __first_valid_page skip over offline pages") >>> >>> While that is true, we shouldn't ever trigger, neither via cma, virtio-mem nor memory offlining, because essentially all operate on MAX_ORDER -1 -aligned ranges without memory holes. >> >> I think this should never trigger too. It's a theoretical issue. So is the Fixes tag necessary ? >> > > I think it's one of these "let's add Fixes: but no need for Cc: stable". > > BUT in older kernels we could have triggered this via memory offlining eventually ... before c5e79ef561b0 ("mm/memory_hotplug.c: don't allow to online/offline memory blocks with holes") ... so maybe even a Cc: stable? Looks like it could happen in older kernels. Maybe a Cc: stable is necessary. Many thanks. >