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 BC844C25B0E for ; Wed, 17 Aug 2022 02:12:22 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4DED88D0002; Tue, 16 Aug 2022 22:12:22 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 48E3C8D0001; Tue, 16 Aug 2022 22:12:22 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 356668D0002; Tue, 16 Aug 2022 22:12:22 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0017.hostedemail.com [216.40.44.17]) by kanga.kvack.org (Postfix) with ESMTP id 25B7C8D0001 for ; Tue, 16 Aug 2022 22:12:22 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id C0AF9140466 for ; Wed, 17 Aug 2022 02:12:21 +0000 (UTC) X-FDA: 79807460082.30.A69237F Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf23.hostedemail.com (Postfix) with ESMTP id CCBFB1401AF for ; Wed, 17 Aug 2022 02:12:20 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4M6s0t1R5czmVqw; Wed, 17 Aug 2022 10:10:06 +0800 (CST) Received: from [10.174.177.76] (10.174.177.76) by canpemm500002.china.huawei.com (7.192.104.244) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Wed, 17 Aug 2022 10:12:17 +0800 Subject: Re: [PATCH v6 1/2] mm: migration: fix the FOLL_GET failure on following huge page To: Haiyue Wang , , CC: , , , , , , References: <20220812084921.409142-1-haiyue.wang@intel.com> <20220816022102.582865-1-haiyue.wang@intel.com> <20220816022102.582865-2-haiyue.wang@intel.com> From: Miaohe Lin Message-ID: <5392ee32-e814-3f7c-a360-722ff5656cc7@huawei.com> Date: Wed, 17 Aug 2022 10:12:16 +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: <20220816022102.582865-2-haiyue.wang@intel.com> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.177.76] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=none; spf=pass (imf23.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660702341; a=rsa-sha256; cv=none; b=A2w79fCQ8C5iInuHqP440Wx+TOKFV+bf5oV1bfqyUbo1+YhCbC/pAqK6xHBZhHL+k+vmkP kB2xbhv9H3gCewEJtGo7NXfEm+AvEtP789olUBD0qj4O5ciIoey1WnGEDMj7f4MAAsCaLb Leo0BtwYO1RVTgfnASy5TCTabCGP/IM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660702341; 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:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Mz/7Yc59tMYjTpQOS6ZMvgTt/JbObqBaELZnysVQRjM=; b=S3d8Cvq8ivnPgaJLJccVPbTRy/nCfWyjHoqZZodch7h0NmtsNuE/XWZ9wX3pucaMlAd02O eRcw/KlHqQcbOSW893mZObzPEbms1dEIbksaYW1NCn9mbEL1Qk3BBQlrTpBnOFXAuaV7od 2s8eIcMddmp+PKxP2A8tCghKkU/fz+M= X-Stat-Signature: gjbo7r413ide7odjzz1bqozohrzemrr1 X-Rspamd-Queue-Id: CCBFB1401AF X-Rspamd-Server: rspam08 Authentication-Results: imf23.hostedemail.com; dkim=none; spf=pass (imf23.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-HE-Tag: 1660702340-115511 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 2022/8/16 10:21, Haiyue Wang wrote: > Not all huge page APIs support FOLL_GET option, so move_pages() syscall > will fail to get the page node information for some huge pages. > > Like x86 on linux 5.19 with 1GB huge page API follow_huge_pud(), it will > return NULL page for FOLL_GET when calling move_pages() syscall with the > NULL 'nodes' parameter, the 'status' parameter has '-2' error in array. > > Note: follow_huge_pud() now supports FOLL_GET in linux 6.0. > Link: https://lore.kernel.org/all/20220714042420.1847125-3-naoya.horiguchi@linux.dev > > But these huge page APIs don't support FOLL_GET: > 1. follow_huge_pud() in arch/s390/mm/hugetlbpage.c > 2. follow_huge_addr() in arch/ia64/mm/hugetlbpage.c > It will cause WARN_ON_ONCE for FOLL_GET. > 3. follow_huge_pgd() in mm/hugetlb.c > > This is an temporary solution to mitigate the side effect of the race > condition fix by calling follow_page() with FOLL_GET set for huge pages. > > After supporting follow huge page by FOLL_GET is done, this fix can be > reverted safely. > > Fixes: 4cd614841c06 ("mm: migration: fix possible do_pages_stat_array racing with memory offline") > Signed-off-by: Haiyue Wang > Reviewed-by: "Huang, Ying" LGTM. Many thanks for fixing this. Reviewed-by: Miaohe Lin Thanks, Miaohe Lin