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 40E88C25B06 for ; Fri, 12 Aug 2022 01:59:19 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 883AC8E0001; Thu, 11 Aug 2022 21:59:18 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8328B6B0075; Thu, 11 Aug 2022 21:59:18 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 6FA558E0001; Thu, 11 Aug 2022 21:59:18 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 601F86B0073 for ; Thu, 11 Aug 2022 21:59:18 -0400 (EDT) Received: from smtpin21.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 2EA02AC211 for ; Fri, 12 Aug 2022 01:59:18 +0000 (UTC) X-FDA: 79789283196.21.1EF38BC Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf25.hostedemail.com (Postfix) with ESMTP id 174F9A007A for ; Fri, 12 Aug 2022 01:59:16 +0000 (UTC) Received: from canpemm500002.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4M3myC0WVrzmVbl; Fri, 12 Aug 2022 09:57:07 +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 09:59:12 +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: Date: Fri, 12 Aug 2022 09:59:12 +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="windows-1252" Content-Language: en-US Content-Transfer-Encoding: 8bit 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=1660269557; a=rsa-sha256; cv=none; b=PtiZ2vTtMPGpDQEHG6ODrwRFb0WEzxRvzG+myyBB/sucVWM/xx+KxGJExp2lpCV7mootCq ZD+C+mDNR+5809rZcHpYj+MHwKBgNjMRRuyANvDn/bbE/N4bMYSns+3LPb8NGsSgQoaYdo aIV5Fw/9ecJbrP7nToIne1sSks2asOM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1660269557; 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=PIFRhB1+DXeHF7IbaK711iPzWr0/9zSdQi96yqZMYbc=; b=CIUzIxTcleQh5mb89urr4SPioaeR0CnP34X8rJe31MS4T0UKLILzRsrYlzeoyRI/fFcN7A /JV1EenvxB1UupRLnPKJBoI5scFbW1Jj+Fw7z2c1JmqXTD9qhWbVQAEznTc/oeqT9xLMl5 9ersnKfrAFPBpaKM1JtbNjt4CNjjscE= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf25.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Stat-Signature: 9f3o1xuqc98jisbgk54e4toaqxppm5of X-Rspamd-Queue-Id: 174F9A007A Authentication-Results: imf25.hostedemail.com; dkim=none; dmarc=pass (policy=quarantine) header.from=huawei.com; spf=pass (imf25.hostedemail.com: domain of linmiaohe@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=linmiaohe@huawei.com X-Rspam-User: X-Rspamd-Server: rspam04 X-HE-Tag: 1660269556-830094 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/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=e66f17ff71772b209eed39de35aaa99ba819c93d > >   > > 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=4cd614841c06338a087769ee3cfa96718784d1f5 > 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? Thanks, Miaohe Lin > >   > > BR, > > Haiyue > >   >