From patchwork Wed May 25 19:52:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Xu X-Patchwork-Id: 12861698 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 6DE9BC4332F for ; Wed, 25 May 2022 19:52:27 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7BB9D8D0003; Wed, 25 May 2022 15:52:26 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 7678C8D0002; Wed, 25 May 2022 15:52:26 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 605B08D0003; Wed, 25 May 2022 15:52:26 -0400 (EDT) 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 539088D0002 for ; Wed, 25 May 2022 15:52:26 -0400 (EDT) Received: from smtpin11.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay12.hostedemail.com (Postfix) with ESMTP id 34B9D121058 for ; Wed, 25 May 2022 19:52:26 +0000 (UTC) X-FDA: 79505312292.11.2B66AEF Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by imf02.hostedemail.com (Postfix) with ESMTP id 9705980020 for ; Wed, 25 May 2022 19:52:22 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1653508345; h=from:from: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; bh=MoWVBq/Srp3PM5Qk/nZzvo63HOw5jDODOMMJjoSaqDU=; b=XIogzBMRNbL7IAItWb489/xhAY/DRfpWOgXH2PzBzsq30Dp/YUJcRHk3zdoJUgTXFywNnx aF5Rca5WaV3Q0ldCe1MP+/eXfxs+NGAhlipZPZc1CwebkapbC1ZYLjehscCZq46d95DKyP 4FNTQDMMOw7ER1vJBgKlGBQdYxQbPgs= Received: from mail-io1-f70.google.com (mail-io1-f70.google.com [209.85.166.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-610-LsTatIVHP7mHxWIw4ttq_A-1; Wed, 25 May 2022 15:52:24 -0400 X-MC-Unique: LsTatIVHP7mHxWIw4ttq_A-1 Received: by mail-io1-f70.google.com with SMTP id a5-20020a056602208500b0066572ae07f8so4222558ioa.12 for ; Wed, 25 May 2022 12:52:23 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=MoWVBq/Srp3PM5Qk/nZzvo63HOw5jDODOMMJjoSaqDU=; b=k9zJ/qkjZOgTtBFs1O/pu9LE+iz1Ud9FdAsFjTcb2t2VocMHlJINKjWR6c3DbI+JDK Gf7iG243UdIHpNlmoI7ecNBv2IDOIgg2yDuRPsqViLxYBRpOqD0pD55xmudAovWXmSo8 //iJWfitrbh5GX+9XzKMf7X0Zns11M7KcTzH3/EIzkiGYlqIa/5iY1o+xQ9bcLR9FFnv zIrjCqpidzpvpvRWW4KS94w1yIBgrQPK8F+HxKwDGEjsLNtYLxXdT5pkR0K7SIDTfnPW 1OT9CJirbRzVRJgSgW3UxzVNjxjz2T3hii8hlxiWhA75hnt2Sx/msZHIfW4r4xDIkXoG rBWA== X-Gm-Message-State: AOAM5311xIXrP8pAKqbsemxAOxfGOUuGKpPOtq90ewTdUpd7dHjVg/XY b4h4qnt/cWTFFGHbxm8tY67fyhSmP6SNX/hPFzbvA66bi7bOr0wH0TomK0c+qRvbVWKV1Uz3gXi RjsR465GfPU8= X-Received: by 2002:a05:6602:29ce:b0:609:4f60:59cb with SMTP id z14-20020a05660229ce00b006094f6059cbmr15759282ioq.183.1653508343037; Wed, 25 May 2022 12:52:23 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy9bqdjvCpdaS834IY1vu+Cs+k6e6lxk4WTcV42PxlupTWCvf9TA9JPzqBYXGpZnofQU3rNkQ== X-Received: by 2002:a05:6602:29ce:b0:609:4f60:59cb with SMTP id z14-20020a05660229ce00b006094f6059cbmr15759276ioq.183.1653508342846; Wed, 25 May 2022 12:52:22 -0700 (PDT) Received: from localhost.localdomain (cpec09435e3e0ee-cmc09435e3e0ec.cpe.net.cable.rogers.com. [99.241.198.116]) by smtp.gmail.com with ESMTPSA id n25-20020a02a199000000b0032e31eeebc1sm4352021jah.170.2022.05.25.12.52.21 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Wed, 25 May 2022 12:52:22 -0700 (PDT) From: Peter Xu To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: Andrew Morton , peterx@redhat.com, Mike Kravetz Subject: [PATCH] mm/x86: Remove dead code for hugetlbpage.c Date: Wed, 25 May 2022 15:52:20 -0400 Message-Id: <20220525195220.10241-1-peterx@redhat.com> X-Mailer: git-send-email 2.32.0 MIME-Version: 1.0 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-type: text/plain Authentication-Results: imf02.hostedemail.com; dkim=pass header.d=redhat.com header.s=mimecast20190719 header.b=XIogzBMR; dmarc=pass (policy=none) header.from=redhat.com; spf=none (imf02.hostedemail.com: domain of peterx@redhat.com has no SPF policy when checking 170.10.133.124) smtp.mailfrom=peterx@redhat.com X-Rspam-User: X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: 9705980020 X-Stat-Signature: xeetqh4eqo7jw8yjq7kny1whseyyxhr3 X-HE-Tag: 1653508342-195604 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: It seems to exist since the old times and never used once. Remove them. Signed-off-by: Peter Xu Acked-by: Mike Kravetz Acked-by: Muchun Song --- arch/x86/mm/hugetlbpage.c | 39 --------------------------------------- 1 file changed, 39 deletions(-) diff --git a/arch/x86/mm/hugetlbpage.c b/arch/x86/mm/hugetlbpage.c index a0d023cb4292..509408da0da1 100644 --- a/arch/x86/mm/hugetlbpage.c +++ b/arch/x86/mm/hugetlbpage.c @@ -19,44 +19,6 @@ #include #include -#if 0 /* This is just for testing */ -struct page * -follow_huge_addr(struct mm_struct *mm, unsigned long address, int write) -{ - unsigned long start = address; - int length = 1; - int nr; - struct page *page; - struct vm_area_struct *vma; - - vma = find_vma(mm, addr); - if (!vma || !is_vm_hugetlb_page(vma)) - return ERR_PTR(-EINVAL); - - pte = huge_pte_offset(mm, address, vma_mmu_pagesize(vma)); - - /* hugetlb should be locked, and hence, prefaulted */ - WARN_ON(!pte || pte_none(*pte)); - - page = &pte_page(*pte)[vpfn % (HPAGE_SIZE/PAGE_SIZE)]; - - WARN_ON(!PageHead(page)); - - return page; -} - -int pmd_huge(pmd_t pmd) -{ - return 0; -} - -int pud_huge(pud_t pud) -{ - return 0; -} - -#else - /* * pmd_huge() returns 1 if @pmd is hugetlb related entry, that is normal * hugetlb entry or non-present (migration or hwpoisoned) hugetlb entry. @@ -72,7 +34,6 @@ int pud_huge(pud_t pud) { return !!(pud_val(pud) & _PAGE_PSE); } -#endif #ifdef CONFIG_HUGETLB_PAGE static unsigned long hugetlb_get_unmapped_area_bottomup(struct file *file,