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 0F605C32796 for ; Wed, 24 Aug 2022 18:39:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 2ED2F940008; Wed, 24 Aug 2022 14:39:02 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 2759C940007; Wed, 24 Aug 2022 14:39:02 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 118C1940008; Wed, 24 Aug 2022 14:39:02 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id EFA28940007 for ; Wed, 24 Aug 2022 14:39:01 -0400 (EDT) Received: from smtpin09.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id C0168AAC5D for ; Wed, 24 Aug 2022 18:39:01 +0000 (UTC) X-FDA: 79835348082.09.38713CC Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by imf15.hostedemail.com (Postfix) with ESMTP id 5FA2AA0017 for ; Wed, 24 Aug 2022 18:39:01 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 562B761781; Wed, 24 Aug 2022 18:39:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 48D47C433D6; Wed, 24 Aug 2022 18:38:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1661366339; bh=6WIIhfjVkCvTJa4ixWHqJBYM6NhXSOMJM2g4EDM++PE=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=jwKQ9J0fMGJq76G+/qoOsN1iLuKbFwlsAKCve86un7ZXyxcQogKoV6Pd/hAlqAHbQ UvMVBYjLcu5r6vxaiC0mq+LqhffElWlCGqzd2vTdA8C+GngpDPA+wlL+PJz3FPKC9H zBL7oQlZtrrdKFjMUR7s1beyNZcAOb8PbajUglKg= Date: Wed, 24 Aug 2022 11:38:58 -0700 From: Andrew Morton To: Haiyue Wang Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, david@redhat.com, apopple@nvidia.com, linmiaohe@huawei.com, ying.huang@intel.com, songmuchun@bytedance.com, naoya.horiguchi@linux.dev, alex.sierra@amd.com, mike.kravetz@oracle.com, gerald.schaefer@linux.ibm.com, Baolin Wang Subject: Re: [PATCH v7 1/2] mm: migration: fix the FOLL_GET failure on following huge page Message-Id: <20220824113858.9f0a2200c4d4875a5f4da31c@linux-foundation.org> In-Reply-To: <20220823135841.934465-2-haiyue.wang@intel.com> References: <20220823135841.934465-1-haiyue.wang@intel.com> <20220823135841.934465-2-haiyue.wang@intel.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.33; x86_64-redhat-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=jwKQ9J0f; spf=pass (imf15.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1661366341; a=rsa-sha256; cv=none; b=hNWi9r3Td7BRo0WjEkpHXxtU6mAJZcu06sp5z5eMaJNdHdJDfrz1WyvVEA3LC5+My2RItN NFXV9hP7mRFRbCaYnhrG0+MRdwPpEFehvPE55VrkXrMTH4ppJKXZD6HHu4dhb0BLRKgA2T GbMxQC/1kFZJ5juRdIJeutTxfEgU7Wc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1661366341; 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:dkim-signature; bh=xnM313BxI4imNN5w1FLivictVGXPg7FiPOl/I0YPCDA=; b=rIRWph/FBeSlIiqCSK7iWUvL0ar71Nn+PJ9rQwyGsXVA0LZ+WSL8ivVamgdhwFn3xHJlKd qACZTUok8gkdoMHMEGIyTd29b6qv6rHwRtQUhN/k8XCIgtsfmVGV84XGoX8FcQfNR0BOSQ XoqsbFKqN7TSEw1na2+qmZ4vCVv6FrE= Authentication-Results: imf15.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=jwKQ9J0f; spf=pass (imf15.hostedemail.com: domain of akpm@linux-foundation.org designates 139.178.84.217 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org; dmarc=none X-Rspam-User: X-Rspamd-Server: rspam06 X-Rspamd-Queue-Id: 5FA2AA0017 X-Stat-Signature: 44b1k45bfwryk71zoznqaha58yrc664b X-HE-Tag: 1661366341-740951 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 Tue, 23 Aug 2022 21:58:40 +0800 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 What happened to the proposal to fix these three sites so this patch is not needed? > 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.