Received: by 2002:a05:6a10:5bc5:0:0:0:0 with SMTP id os5csp2601288pxb; Sun, 31 Oct 2021 20:24:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXy/ZzW9OOY9PAYzs+tVDxmu/RUHcEO7Ov8bn28UlAO9JXaXwTBI/4wTyQRYZ7UDibA7KV X-Received: by 2002:a05:6638:40a:: with SMTP id q10mr6529241jap.94.1635737065034; Sun, 31 Oct 2021 20:24:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1635737065; cv=none; d=google.com; s=arc-20160816; b=DKhdWcM5dIpRZ8WKq3ZKukBnbrZfYO8Nauetvpt4SrMSwexUGIJU5q6LcebYxkOOYu RVJUfziKaC7tx5fZGQQAiWV31jNALVt7BnfiScUkovyfGWff7T2ilt7UjWPBnFB0Ulah DdD01iYQoU/XyZuws+oXlQNzDaurkHZ3Kr5vKdB7XBHjoe9Cnu6YGmkNJ8aaZKUbm3h+ 1zAv6pSxsD0wPcoG36dxRAVaZiGewnX5dgLxXyiEOHO/J7exSqhO+HC66EKdhJ/+MrTI DqAS8UJVh4ySo6wgpKa/UAU8koSaFrj1aXNFRza4HMRmlp/cmrJxTzfBMvl5E8+8k/Xj n2ZA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=2UoWjZzOHViEmzMC0Qv5p6Aol3nKS7az97fC7P92qe4=; b=u2PpAwYFQz0aH+F58rEXmW+29kwgYd+EIndAfobghCQDVMqaQybaz7qHgkUbJIM9WH fDCMgqNT+ApUhdsHF3FAx7mTBzidr3Tm/9C1d8oEvWgANbZsFzjC8kKhWMG66mMqemI4 SQEv1Sm+NzHIt6br54Au3vmtVyLsig1WmCfy6r18XY3oue8haXESFnuCk1G8DImVYqyr 5AbhCmHsvJcBO077m6lTQMJiDmTKXTco3VIjP+dBc5kPkcjy3dRxwUN0dtMmOYC997WS VKPcIrVVd6FZft3sg08cdpodTI+Zvf1jTV8ZDJI24O3CQTyhbeILCzi4U/5Y1qhaZ+nS Ex9g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=mKP0ohFb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id d1si6057387iow.29.2021.10.31.20.24.14; Sun, 31 Oct 2021 20:24:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=mKP0ohFb; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=bytedance.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231408AbhKADZd (ORCPT + 99 others); Sun, 31 Oct 2021 23:25:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48364 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231309AbhKADZN (ORCPT ); Sun, 31 Oct 2021 23:25:13 -0400 Received: from mail-pg1-x530.google.com (mail-pg1-x530.google.com [IPv6:2607:f8b0:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E62A9C061767 for ; Sun, 31 Oct 2021 20:22:40 -0700 (PDT) Received: by mail-pg1-x530.google.com with SMTP id b4so8933979pgh.10 for ; Sun, 31 Oct 2021 20:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=2UoWjZzOHViEmzMC0Qv5p6Aol3nKS7az97fC7P92qe4=; b=mKP0ohFbfVQvapDd1cxSSUQoOhILeQQNi04r/0XIuYy1v7A0lxlwD8CJhLGlYGDL+S GEwrDudJKGSatRGKbpSPvwuO7/uK/brOWGDHxw8QH4w8v4O6lRhWgzHlaJX0KHouSdXu u0u7n3nu9tzbLrbcfNOvYIlsXGBjzfbEjI0dcoW2RSktQMUfiFAecvgel+yiR4Eqo2Ih vQPvdA8EygpJ/SIYaQh53HxuObxRie7bqsspLrdsPsTCKPGrz6K5Mb1T3nAYB1Y7gRla z2cqsQzcfnRBPevYTo3Uwu6XH1ez9MDwMwA64GF7nlWljkoay9o9g20tENUSudsXTJ89 wQRw== 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:in-reply-to :references:mime-version:content-transfer-encoding; bh=2UoWjZzOHViEmzMC0Qv5p6Aol3nKS7az97fC7P92qe4=; b=u8DXyWD9pG9zpgeOjUi4wZTEiajPAhX+PB2Iub3nTDyY/kEZ9VcJH6U+Hc6yTuQGi3 AiRKM7cfBt76E/A4RYPu0nK06BuE7ZkSUgYzIKkjqrEbyg2FyIPOvvPffTisGKNnKqzz rMu5NSKIPDb8CuUdYDyNcnV2EEqCgWATchpVTaG/KUL02Ay3eSusjWk3rLAbDW81BIB9 5fz4f616rxyJrEbQwq3g76ZapLSYQGLK1nRBVrhHy7exCj9kwsZ4SynBGFvOJsBQl2ov BiuIdlP6WK6XTjKuTaGrYVn7qZtSXJ+mU+J38bDgqggNiMxS9eNHt9o+DseLgqutQaxx G5XQ== X-Gm-Message-State: AOAM530wbgifTaA7hamUCervjz+9RJ4x2qLxVwk0pDnP85LJJA15PUHz 7stn5CsciHxJ21AJTmK2AbHheg== X-Received: by 2002:aa7:8019:0:b0:44d:d761:6f79 with SMTP id j25-20020aa78019000000b0044dd7616f79mr26229514pfi.3.1635736960495; Sun, 31 Oct 2021 20:22:40 -0700 (PDT) Received: from localhost.localdomain ([139.177.225.242]) by smtp.gmail.com with ESMTPSA id f8sm11860963pjq.29.2021.10.31.20.22.33 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 31 Oct 2021 20:22:40 -0700 (PDT) From: Muchun Song To: mike.kravetz@oracle.com, akpm@linux-foundation.org, osalvador@suse.de, mhocko@suse.com, song.bao.hua@hisilicon.com, david@redhat.com, chenhuang5@huawei.com, bodeddub@amazon.com, corbet@lwn.net, willy@infradead.org, 21cnbao@gmail.com Cc: duanxiongchun@bytedance.com, fam.zheng@bytedance.com, smuchun@gmail.com, zhengqi.arch@bytedance.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, Muchun Song Subject: [PATCH v7 5/5] mm: sparsemem: move vmemmap related to HugeTLB to CONFIG_HUGETLB_PAGE_FREE_VMEMMAP Date: Mon, 1 Nov 2021 11:16:51 +0800 Message-Id: <20211101031651.75851-6-songmuchun@bytedance.com> X-Mailer: git-send-email 2.21.0 (Apple Git-122) In-Reply-To: <20211101031651.75851-1-songmuchun@bytedance.com> References: <20211101031651.75851-1-songmuchun@bytedance.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The vmemmap_remap_free/alloc are relevant to HugeTLB, so move those functiongs to the scope of CONFIG_HUGETLB_PAGE_FREE_VMEMMAP. Signed-off-by: Muchun Song Reviewed-by: Barry Song --- include/linux/mm.h | 2 ++ mm/sparse-vmemmap.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/include/linux/mm.h b/include/linux/mm.h index a7e4a9e7d807..8c85863a067c 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -3184,10 +3184,12 @@ static inline void print_vma_addr(char *prefix, unsigned long rip) } #endif +#ifdef CONFIG_HUGETLB_PAGE_FREE_VMEMMAP int vmemmap_remap_free(unsigned long start, unsigned long end, unsigned long reuse); int vmemmap_remap_alloc(unsigned long start, unsigned long end, unsigned long reuse, gfp_t gfp_mask); +#endif void *sparse_buffer_alloc(unsigned long size); struct page * __populate_section_memmap(unsigned long pfn, diff --git a/mm/sparse-vmemmap.c b/mm/sparse-vmemmap.c index c64d1aa3c4b5..8aecd6b3896c 100644 --- a/mm/sparse-vmemmap.c +++ b/mm/sparse-vmemmap.c @@ -34,6 +34,7 @@ #include #include +#ifdef CONFIG_HUGETLB_PAGE_FREE_VMEMMAP /** * struct vmemmap_remap_walk - walk vmemmap page table * @@ -419,6 +420,7 @@ int vmemmap_remap_alloc(unsigned long start, unsigned long end, return 0; } +#endif /* CONFIG_HUGETLB_PAGE_FREE_VMEMMAP */ /* * Allocate a block of memory to be used to back the virtual memory map -- 2.11.0