Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1408581rwb; Thu, 11 Aug 2022 23:47:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR5gwUieFn+OFhO56X5IPUzo6A7xb8XzwxraOC8K49cXyPsIRn3jPnPRSKVBzI70xTImdJSV X-Received: by 2002:a17:90b:4f4e:b0:1f5:8a65:9192 with SMTP id pj14-20020a17090b4f4e00b001f58a659192mr12091267pjb.224.1660286831799; Thu, 11 Aug 2022 23:47:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660286831; cv=none; d=google.com; s=arc-20160816; b=WJb9S4On0z6towq3WXubv7CpUpdXkHYsQVWuubDv9+kR1xwSoJyRssS4kzOY1SM7+r Cl1Rb42xZxs5BwXMvfVF8UeqYPVwIGzbbdcmUeXpkUubx5iZ6L1DhIYfbP8+iRELzXPT zPq4cG149+uYOkszwk0y/bNFJh5/VbD4U6cRK7ARr/G2z2MZaJCy7bCjMzfF/H6fz3mt fkctuMendx5aMpLQqgrT0X86RPAuCu27y4RnvNffTD64IvwVb5MnX2CO20iY1dscF4C1 Goho36eaIPHk36pYmXxI0kL3M+43Kzg359JLHDE6BpL70u6aiD1XPUOcTQuFU9mQsTXV K4Ng== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=2uqPp2UEdxRtqS5oo6ybbQ6tV+TQro0qQ6Spq3DUUrg=; b=vikP5S70R1FEU5LzmhjDAlnd01NcPzNo/j0W1f8eZ//JjrjYCBkkSZ1aDncbD5vnml q5AD7l09FH6AinRePOAKgdO5GWZUsiZPBgjR4nEwcUgBUD5xCQp6TFnNFX/+6q6F2Emo HMYxirRzt7oO+6VwVEy2HDjUVrzf6ypEIqwyMBOCLIllJyM2+AT0ckAohLCQoiCWjDB5 XSqHIcUhZH+Doq9zM3R3jTG6hbTKQbYvf2077eDQmttekHh1o4V/8Fdnbtwc50e8wShB 3on9Oh0U61aqi67Tklr6g3Kdf83vTRULXPhospBkfqRg9WOyYOm1sn1c7pBJdnpTqm0m gKIw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q17-20020a632a11000000b0041c9a3e846fsi1638573pgq.506.2022.08.11.23.46.57; Thu, 11 Aug 2022 23:47:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=huawei.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237049AbiHLGks (ORCPT + 99 others); Fri, 12 Aug 2022 02:40:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45256 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229524AbiHLGkq (ORCPT ); Fri, 12 Aug 2022 02:40:46 -0400 Received: from szxga03-in.huawei.com (szxga03-in.huawei.com [45.249.212.189]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F37EF5B78F for ; Thu, 11 Aug 2022 23:40:43 -0700 (PDT) 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 X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_MED,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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