Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp219437rwb; Wed, 9 Nov 2022 01:15:00 -0800 (PST) X-Google-Smtp-Source: AMsMyM5UwZD/3HbxuDGy29W7EaYeERFOITxksLtitL6gk6CEhbfwiKCAhZN4/w3WeoM9CULrXDNw X-Received: by 2002:a17:902:d503:b0:187:2294:d513 with SMTP id b3-20020a170902d50300b001872294d513mr50747861plg.54.1667985300444; Wed, 09 Nov 2022 01:15:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667985300; cv=none; d=google.com; s=arc-20160816; b=hMCvkb5Z1Mbf48BibLIX3re1fE2q27tYnsZwv3zZmtsJT8o40Qirxt0qJtEXuykmzu fdpa/k3RoAfD/JBNPz9idaX7fUVdh8na3L5qgAdf9uPQqHiFC5Ln7EFBucB7Fw0SB3K+ UtjkaKqgPv9I7DQFGrndWSVJyAb8SoKlaXN+XUqeLpyCMqYQu8V9JIWaYCpGLtaQHvBj 7q/JhAi4q75gFvoiikMr8+TMN/LZbpM7xCiv4TOW1Xjo8YKt/BHubh7qqJ5MkdAHlhSy CLybYLRzlbJOslEVzFQCo6y0QOKsrBKzsst/AY9CxyQa9IsIk3ns6xh4N3eVo0ph23gW +2hQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=9rldsTwHTpdcbAxJ6fklIKxKpmBx0e9dfFNUAoouS6s=; b=eTtS2CaOCM7qmIR0VsDHY7QkRi8Mwa9N7eohdEezRq+DiTi2rEdHjfjUPKQiG77kbL XoArAIER2rASbWrcuJ5SEIRFQaw7vNG3j6AwdqxuMcsfi/+ZaAQ06iZ3hOlEzcjOpCpq duP1L8fTW0BCiIYW3mUQ7zyspY4kBFi6aZWdiknaEVmTAcAsgSiga8GlirxFpfaZQ40D tGxdGWIzVBSXRSVXby46nsq8wQq92YPpvBpW7UvlsL7EgBWGAsizFqf29CqeqXeelPsG noqWfCVdftjVYWOrud6DF4KGhvIJB57ErlWOKVJVMlsP0EUXIzO5sg6p/aPL0HAqwNNJ fkIw== 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=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q14-20020a170902788e00b00186b697ec66si14319566pll.399.2022.11.09.01.14.48; Wed, 09 Nov 2022 01:15:00 -0800 (PST) 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=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229754AbiKIIkq (ORCPT + 93 others); Wed, 9 Nov 2022 03:40:46 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52402 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229517AbiKIIkp (ORCPT ); Wed, 9 Nov 2022 03:40:45 -0500 Received: from out30-54.freemail.mail.aliyun.com (out30-54.freemail.mail.aliyun.com [115.124.30.54]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA7C317E29 for ; Wed, 9 Nov 2022 00:40:43 -0800 (PST) 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 X-Spam-Status: No, score=-9.9 required=5.0 tests=BAYES_00, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY,USER_IN_DEF_SPF_WL 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 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 --- 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; -- 1.8.3.1