From patchwork Mon Mar 29 19:38:28 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Shi X-Patchwork-Id: 12170897 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED,DKIM_INVALID,DKIM_SIGNED,FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4EC01C433C1 for ; Mon, 29 Mar 2021 19:38:54 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id B9D776192F for ; Mon, 29 Mar 2021 19:38:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org B9D776192F Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 439CB6B007D; Mon, 29 Mar 2021 15:38:53 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3E9046B007E; Mon, 29 Mar 2021 15:38:53 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 263096B0080; Mon, 29 Mar 2021 15:38:53 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0177.hostedemail.com [216.40.44.177]) by kanga.kvack.org (Postfix) with ESMTP id 069686B007D for ; Mon, 29 Mar 2021 15:38:53 -0400 (EDT) Received: from smtpin38.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id B27848249980 for ; Mon, 29 Mar 2021 19:38:52 +0000 (UTC) X-FDA: 77973924504.38.CAC82E3 Received: from mail-pf1-f176.google.com (mail-pf1-f176.google.com [209.85.210.176]) by imf11.hostedemail.com (Postfix) with ESMTP id 8686B2000381 for ; Mon, 29 Mar 2021 19:38:31 +0000 (UTC) Received: by mail-pf1-f176.google.com with SMTP id l123so10527375pfl.8 for ; Mon, 29 Mar 2021 12:38:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eXavjCp5f5S1D/8sxQU3rBvbwYs1dXET9+zoeDr0T5g=; b=HWRCseaPveOFsAf0pEO2427aSZwjep2nSfkPLTbwrLXjYC2a8S4BMrUYyZf8fohx+/ RZ/wCUFs7b83gaGcJ9l+hbJVt0n/chZ1hRERGjFi7oDO8CjHkVgJIh6SnMpUj5mf8dRO 0SXYielq/7TH77F0dYcg01PV+Hxk0K+CIu4gYOeEXc8ADRAgQVeMNgGoYWremkn+tg9q a0qRThDdtD5WFiIVYAiXohizskcZC8pu92DuSbf6snPBmo6iNTFCs0bnKO+sTJ/mY4Al ABdY+rhvryMtjFWsipSd1DaMdXEbsvHtGo8i6mbfR+yOtJfagHGuyVaD7uL2LJ9DTvOt vktw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=eXavjCp5f5S1D/8sxQU3rBvbwYs1dXET9+zoeDr0T5g=; b=oo8oDdMK1Yc29I89jO5PAyN5+78Fn+N9U0MxmyO5XNCjsinVUJFbOZc6XR2KEyJOyM Ype7blmhq6Ce+gnR8E5vEfYhf/8/jNFnCdoZxC3RmpHpBiytfFMPa4bzBEvMQu9gBsdQ EsUMj/kATfI27rNp6FoVugnXz448BRCcL17bKd+Q/nUwr6DoFZBC3Co4N0y+miZ+ZfoI 5e3GuNy6GmcuwTQqDQWIVhY5RrMBTWKTDHSJew+Xle5iKUXXPJD25te13o+Jk5qUbKR0 f9D+sfprMEJyBuK1W7Z39Yka8+R7BNnwdFMBuWNzw7Kh3T7eVCvoGWnLD+hpchKt9EjQ hsvQ== X-Gm-Message-State: AOAM533gEK2EuIR6VNldaJLuhuJWV8jbCbqefecke+VufMd39AhfopY8 3p9cyY4f792Xc8KT99Ka3GY= X-Google-Smtp-Source: ABdhPJz4uRJqp5XuS8BfxQJxe9UeJgdgf/c8QCW04sR2N1rf8gJ+iixITr3T+Epd2w9Wu4j/CjtZLg== X-Received: by 2002:a63:d904:: with SMTP id r4mr9691006pgg.321.1617046710451; Mon, 29 Mar 2021 12:38:30 -0700 (PDT) Received: from localhost.localdomain (c-73-93-239-127.hsd1.ca.comcast.net. [73.93.239.127]) by smtp.gmail.com with ESMTPSA id n38sm10155222pgb.2.2021.03.29.12.38.29 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 29 Mar 2021 12:38:29 -0700 (PDT) From: Yang Shi To: akpm@linux-foundation.org Cc: shy828301@gmail.com, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH] mm: gup: remove FOLL_SPLIT Date: Mon, 29 Mar 2021 12:38:28 -0700 Message-Id: <20210329193828.179993-1-shy828301@gmail.com> X-Mailer: git-send-email 2.26.2 MIME-Version: 1.0 X-Rspamd-Queue-Id: 8686B2000381 X-Stat-Signature: rkf9dixwicbeq1fuyopjjue4j3nrfm5y X-Rspamd-Server: rspam02 Received-SPF: none (gmail.com>: No applicable sender policy available) receiver=imf11; identity=mailfrom; envelope-from=""; helo=mail-pf1-f176.google.com; client-ip=209.85.210.176 X-HE-DKIM-Result: pass/pass X-HE-Tag: 1617046711-687711 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: Since commit 5a52c9df62b4 ("uprobe: use FOLL_SPLIT_PMD instead of FOLL_SPLIT") and commit ba925fa35057 ("s390/gmap: improve THP splitting") FOLL_SPLIT has not been used anymore. Remove the dead code. Signed-off-by: Yang Shi Reported-by: kernel test robot Reviewed-by: John Hubbard --- include/linux/mm.h | 1 - mm/gup.c | 28 ++-------------------------- 2 files changed, 2 insertions(+), 27 deletions(-) diff --git a/include/linux/mm.h b/include/linux/mm.h index 8ba434287387..3568836841f9 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -2780,7 +2780,6 @@ struct page *follow_page(struct vm_area_struct *vma, unsigned long address, #define FOLL_NOWAIT 0x20 /* if a disk transfer is needed, start the IO * and return without waiting upon it */ #define FOLL_POPULATE 0x40 /* fault in page */ -#define FOLL_SPLIT 0x80 /* don't return transhuge pages, split them */ #define FOLL_HWPOISON 0x100 /* check page is hwpoisoned */ #define FOLL_NUMA 0x200 /* force NUMA hinting page fault */ #define FOLL_MIGRATION 0x400 /* wait for page to replace migration entry */ diff --git a/mm/gup.c b/mm/gup.c index e40579624f10..f3d45a8f18ae 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -435,18 +435,6 @@ static struct page *follow_page_pte(struct vm_area_struct *vma, } } - if (flags & FOLL_SPLIT && PageTransCompound(page)) { - get_page(page); - pte_unmap_unlock(ptep, ptl); - lock_page(page); - ret = split_huge_page(page); - unlock_page(page); - put_page(page); - if (ret) - return ERR_PTR(ret); - goto retry; - } - /* try_grab_page() does nothing unless FOLL_GET or FOLL_PIN is set. */ if (unlikely(!try_grab_page(page, flags))) { page = ERR_PTR(-ENOMEM); @@ -591,7 +579,7 @@ static struct page *follow_pmd_mask(struct vm_area_struct *vma, spin_unlock(ptl); return follow_page_pte(vma, address, pmd, flags, &ctx->pgmap); } - if (flags & (FOLL_SPLIT | FOLL_SPLIT_PMD)) { + if (flags & FOLL_SPLIT_PMD) { int ret; page = pmd_page(*pmd); if (is_huge_zero_page(page)) { @@ -600,19 +588,7 @@ static struct page *follow_pmd_mask(struct vm_area_struct *vma, split_huge_pmd(vma, pmd, address); if (pmd_trans_unstable(pmd)) ret = -EBUSY; - } else if (flags & FOLL_SPLIT) { - if (unlikely(!try_get_page(page))) { - spin_unlock(ptl); - return ERR_PTR(-ENOMEM); - } - spin_unlock(ptl); - lock_page(page); - ret = split_huge_page(page); - unlock_page(page); - put_page(page); - if (pmd_none(*pmd)) - return no_page_table(vma, flags); - } else { /* flags & FOLL_SPLIT_PMD */ + } else { spin_unlock(ptl); split_huge_pmd(vma, pmd, address); ret = pte_alloc(mm, pmd) ? -ENOMEM : 0;