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: 17410 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp224173wru; Wed, 9 Nov 2022 00:55:40 -0800 (PST) X-Google-Smtp-Source: AA0mqf45ByAJ8q5id7kbWd8QeATz/iloW14F+SRpONIlRPFqzg3/bk0nfkmyQRD+dG14FVeN4V46 X-Received: by 2002:a63:e548:0:b0:46f:7e1c:aa49 with SMTP id z8-20020a63e548000000b0046f7e1caa49mr3608225pgj.335.1667984140503; Wed, 09 Nov 2022 00:55:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1667984140; cv=none; d=google.com; s=arc-20160816; b=nFpFav3jxST6Ic+3nUpZdTE16xtFn5GFi/gMLx29PeVyHDs/k4O5voP4PjVVDS1nYc Gp9svBADM8jfnGbP5Elzq5s8K3XFuS/RnUP8DurxDxLETQaBTOaXxmc6/wpLMa/lf15O Ztelj+tMc7RHAVSlLytn14qSuFiXFlJyxzlt/De17KgD+4vKyOr4C1NpIHdwIuTabEJR k3Lce0/4J1zVCAOQO9qAu7V+9QWk5E48QigwAfRpr8CuFCPCOR4FRXJ+WaOz/YDxH2wO OISzNEKr7v65H5VEkSAR2FqMy5loF/9yIbtZvMOv9DK96xEtYbuFWQw3bVT/1Zcjlekj HokA== 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 Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v184-20020a6389c1000000b0043a20e51026si16645317pgd.8.2022.11.09.00.55.27; Wed, 09 Nov 2022 00:55:40 -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 + 99 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1749008138222515477?= X-GMAIL-MSGID: =?utf-8?q?1749008138222515477?= 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;