From patchwork Wed Nov 9 08:40:27 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baolin Wang X-Patchwork-Id: 13037260 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 73338C4332F for ; Wed, 9 Nov 2022 08:41:51 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 9A9F96B0072; Wed, 9 Nov 2022 03:41:50 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 95A6A6B0073; Wed, 9 Nov 2022 03:41:50 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 8487D6B0074; Wed, 9 Nov 2022 03:41:50 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 70F4D6B0072 for ; Wed, 9 Nov 2022 03:41:50 -0500 (EST) Received: from smtpin27.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 46C2C812D3 for ; Wed, 9 Nov 2022 08:41:50 +0000 (UTC) X-FDA: 80113260780.27.1140D2F Received: from out30-132.freemail.mail.aliyun.com (out30-132.freemail.mail.aliyun.com [115.124.30.132]) by imf26.hostedemail.com (Postfix) with ESMTP id 5244C14000D for ; Wed, 9 Nov 2022 08:41:40 +0000 (UTC) X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R111e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=ay29a033018046056;MF=baolin.wang@linux.alibaba.com;NM=1;PH=DS;RN=8;SR=0;TI=SMTPD_---0VUNFg20_1667983240; Received: from localhost(mailfrom:baolin.wang@linux.alibaba.com fp:SMTPD_---0VUNFg20_1667983240) by smtp.aliyun-inc.com; Wed, 09 Nov 2022 16:40:41 +0800 From: Baolin Wang To: akpm@linux-foundation.org Cc: haiyue.wang@intel.com, ying.huang@intel.com, mike.kravetz@oracle.com, songmuchun@bytedance.com, baolin.wang@linux.alibaba.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] Revert "mm: migration: fix the FOLL_GET failure on following huge page" Date: Wed, 9 Nov 2022 16:40:27 +0800 Message-Id: <496786039852aba90ffa68f10d0df3f4236a990b.1667983080.git.baolin.wang@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667983302; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references; bh=9rldsTwHTpdcbAxJ6fklIKxKpmBx0e9dfFNUAoouS6s=; b=ZTt6zFK17CLrrs/wRhlFpmoRVtvmMUSNqlrQEoDu8Pi0hh6wpONic+/6bBLmYXEfK7JaY5 l+EYkAI5KD6XUHnwprZbdIdmBqjUc0fU0AW5et2Qxijj574GsOcX4amRJ2pljcUvcGmYyK 1By13+tB2f9JIO1dAJGqT6QEfwTVN9Y= ARC-Authentication-Results: i=1; imf26.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf26.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667983302; a=rsa-sha256; cv=none; b=oLTWSd7tPZGDsolrAhkBgdZ0wm4CqLqA7J4Ph/5kJsaA+rwJhqy4YNCZmS9En1BAeSepMc 9SvL1MgOfVT8m15p1r2A9P0woGdlxxxNbTHb5lTxLDIzn6xZ51foEwO/T947iHDdRZdZx5 +H8LP8nrZV7a9FpfUIQd5QbH/4KVBiM= X-Rspamd-Queue-Id: 5244C14000D X-Rspam-User: X-Rspamd-Server: rspam08 Authentication-Results: imf26.hostedemail.com; dkim=none; dmarc=pass (policy=none) header.from=alibaba.com; spf=pass (imf26.hostedemail.com: domain of baolin.wang@linux.alibaba.com designates 115.124.30.132 as permitted sender) smtp.mailfrom=baolin.wang@linux.alibaba.com X-Stat-Signature: 7urrbtwqri5uwu31u7ufrd5u4u6gi9dx X-HE-Tag: 1667983300-181561 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: Revert commit 831568214883 ("mm: migration: fix the FOLL_GET failure on following huge page"), since after commit 1a6baaa0db73 ("s390/hugetlb: switch to generic version of follow_huge_pud()") and commit 57a196a58421 ("hugetlb: simplify hugetlb handling in follow_page_mask") were merged, now all the following huge page routines can support FOLL_GET operation. Signed-off-by: Baolin Wang Acked-by: Haiyue Wang --- mm/migrate.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/mm/migrate.c b/mm/migrate.c index 1317e5c..53af072 100644 --- a/mm/migrate.c +++ b/mm/migrate.c @@ -1908,7 +1908,6 @@ static void do_pages_stat_array(struct mm_struct *mm, unsigned long nr_pages, for (i = 0; i < nr_pages; i++) { unsigned long addr = (unsigned long)(*pages); - unsigned int foll_flags = FOLL_DUMP; struct vm_area_struct *vma; struct page *page; int err = -EFAULT; @@ -1917,12 +1916,8 @@ static void do_pages_stat_array(struct mm_struct *mm, unsigned long nr_pages, if (!vma) goto set_status; - /* Not all huge page follow APIs support 'FOLL_GET' */ - if (!is_vm_hugetlb_page(vma)) - foll_flags |= FOLL_GET; - /* FOLL_DUMP to ignore special (like zero) pages */ - page = follow_page(vma, addr, foll_flags); + page = follow_page(vma, addr, FOLL_GET | FOLL_DUMP); err = PTR_ERR(page); if (IS_ERR(page)) @@ -1935,8 +1930,7 @@ static void do_pages_stat_array(struct mm_struct *mm, unsigned long nr_pages, if (!is_zone_device_page(page)) err = page_to_nid(page); - if (foll_flags & FOLL_GET) - put_page(page); + put_page(page); set_status: *status = err;