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 02DA7C00140 for ; Fri, 12 Aug 2022 06:40:47 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 20B8D6B0073; Fri, 12 Aug 2022 02:40:47 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1BB048E0001; Fri, 12 Aug 2022 02:40:47 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 083436B0078; Fri, 12 Aug 2022 02:40:47 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0015.hostedemail.com [216.40.44.15]) by kanga.kvack.org (Postfix) with ESMTP id EE9D86B0073 for ; Fri, 12 Aug 2022 02:40:46 -0400 (EDT) Received: from smtpin31.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id C2B5FC18E9 for ; Fri, 12 Aug 2022 06:40:46 +0000 (UTC) X-FDA: 79789992492.31.2A7AAF1 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by imf25.hostedemail.com (Postfix) with ESMTP id BDFB2A007D for ; Fri, 12 Aug 2022 06:40:44 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga03-in.huawei.com (SkyGuard) with ESMTP id 4M3vCj56j2zGpTL; Fri, 12 Aug 2022 14:39:13 +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; Fri, 12 Aug 2022 14:40:40 +0800 Subject: Re: Linux 5.19 __NR_move_pages failed for hugepage To: "Wang, Haiyue" CC: "akpm@linux-foundation.org" , Linux-MM , linux-kernel , Naoya Horiguchi , David Hildenbrand References: From: Miaohe Lin Message-ID: <91da2c3b-96f1-bb03-8fff-4c38f31cb9be@huawei.com> Date: Fri, 12 Aug 2022 14:40:40 +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.177.76] X-ClientProxiedBy: dggems703-chm.china.huawei.com (10.3.19.180) To canpemm500002.china.huawei.com (7.192.104.244) X-CFilter-Loop: Reflected ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1660286445; a=rsa-sha256; cv=none; b=eiThmqvKaXEePazjDR5Jp9YQbP/D7mtzTTYg78kOnsvZmGqWM6YLVILxe6HqI3cez79xKc RimzAqexpYo4Y13zfR2IGrzrG2glXXF2Tnnm2BkDxh+wgNBnc5MIfl+ibUvqbcmlbBFoo1 TWDolNeSjFaq8h7v4NSgbMDtzrWq/+s= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660286445; 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=2uqPp2UEdxRtqS5oo6ybbQ6tV+TQro0qQ6Spq3DUUrg=; b=UzozxgVoN7MDkBkTRDdctrwaJS/LDx/6eunJP7IvCTu5uKdaQAbLoRiQ19qscdT2ShaQI9 2Xf4Y75SFyfDN8KKOJqFeML/NutrLU7NXWP/ns9jY3I5J8dmxny2urCV9d01jhO+3lGvL6 c6amDxBDnaFrIuiFOaTEe4HIZvE9eNk= X-Stat-Signature: 6ec1zyd9ct7uo1jdure9xwbsdewxnyea X-Rspamd-Queue-Id: BDFB2A007D X-Rspam-User: X-Rspamd-Server: rspam03 Authentication-Results: imf25.hostedemail.com; dkim=none; spf=pass (imf25.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.189 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-HE-Tag: 1660286444-214898 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/12 11:04, Wang, Haiyue wrote: >> -----Original Message----- >> From: Miaohe Lin >> Sent: Friday, August 12, 2022 09:59 >> To: Wang, Haiyue >> Cc: akpm@linux-foundation.org; Linux-MM ; linux-kernel > kernel@vger.kernel.org>; Naoya Horiguchi ; David Hildenbrand >> >> Subject: Re: Linux 5.19 __NR_move_pages failed for hugepage >> >> On 2022/8/11 16:01, Wang, Haiyue wrote: >>> Hi Miaohe, >>> >>> >> >> Hi Haiyue, >> >> Many thanks for your report and debug. >> >>> >>> When I call "*syscall (__NR_move_pages, 0, n_pages, ptr, 0, status, 0)*" to get the huge page node >>> >>> information, it is failed with '-2' returned in 'status' array. >>> >>> >>> >>> After some debug, I found that "*follow_huge_pud*" will return NULL if '*FOLL_GET*' is set. >>> >>> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=e66f17ff71772b209eed39de >> 35aaa99ba819c93d >> > e35aaa99ba819c93d> >>> >>> >>> >>> This will make your patch doesn't work for huge page. >>> >>> >> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=4cd614841c06338a087769ee >> 3cfa96718784d1f5 >> > e3cfa96718784d1f5> >>> >> >> Supporting of '*FOLL_GET*' in follow_huge_pud is introduced via the below commit: >> >> https://lore.kernel.org/all/20220714042420.1847125-9- >> naoya.horiguchi@linux.dev/T/#mb3c83df087fba454b7b4ea32227fb8775ca70081 >> >> But that's still not perfect yet. For s390 version of follow_huge_pud, FOLL_GET is still not supported. >> And pgd level >> hugepage doesn't support FOLL_GET now. >> >>> >>> >>> Not sure you know this issue or not, just share my debug information. >> >> I'm not sure whether it's better to revert my above "problematic" patch first then add it back when >> all hugetlb pages support FOLL_GET. >> Or we could just live with it? Any thoughts? >> > > TBH, the issue is more complicated than I think. :-( > > Looks like only '[PATCH v7 5/8] mm, hwpoison: set PG_hwpoison for busy hugetlb pages' will be > backported to 5.19 ? Only this patch has "Fixes:" tag. If so, it will break 5.19. If you want to mitigate the problem of __NR_move_pages failing for hugepage, "[PATCH v7 2/8] mm/hugetlb: make pud_huge() and follow_huge_pud() aware of non-present pud entry" could be backported to 5.19. > > I just run VPP 'https://fd.io/' to find the error message about huge page allocation > after I switched from 5.18 to 5.19. Do you mean the reported problem is found by VPP? Anyway, you can send a patch to fix the problem if you like. :) I will try fixing it if requested of course (but I'm not sure how to fix it yet). Thanks, Miaohe Lin