From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 700FAC433F5 for ; Mon, 27 Sep 2021 04:38:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 50C0B60FC2 for ; Mon, 27 Sep 2021 04:38:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232598AbhI0Ejx (ORCPT ); Mon, 27 Sep 2021 00:39:53 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35672 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229674AbhI0Eju (ORCPT ); Mon, 27 Sep 2021 00:39:50 -0400 Received: from mail-ed1-x530.google.com (mail-ed1-x530.google.com [IPv6:2a00:1450:4864:20::530]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AC4BEC061570; Sun, 26 Sep 2021 21:38:12 -0700 (PDT) Received: by mail-ed1-x530.google.com with SMTP id x7so49127644edd.6; Sun, 26 Sep 2021 21:38:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=83Uhs6ZL7h4cnl4M9YaZp+1cwFpz7hwB6M99EqA8Pek=; b=Wt/NNiCekc3wV4M98bGP4We81eFo45oWPb9JUhIjjHarMxCZFloPFPqM3DGq5qR2Xz DiH9zbth9nKe+0QEEfefJ/kMmqbGgvB+Sit1HZTEZ2STfJBRbzi9Gtgrar94Ub83TfcL OtESJn/asGAfl6CM5gNlX6ZvpceDUYsE0fcNIqqbxtAKsmmcNJSHNbqdOIHkYj2iDWD6 qROIZ3bonVnvPWKldxMTuI3J/GjNVUAu6DQj+pYPZYX18QD8Z2BY5wAvEvF9jHAxzf9/ RAGiDk3jrMST55boE5BE+by7r07xBkm0EcWwIJWr0GRPHv3xPfUT9H9x2x6mlh6i3vdR J//A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=83Uhs6ZL7h4cnl4M9YaZp+1cwFpz7hwB6M99EqA8Pek=; b=5BVkkWqOJD1apY8MVJTRVETX0PhnYH+BTnyxKnMWs+naSy0kHhVxCu7Vq9aGy7POfc hL+6Q9mYlaOZwT2E/uajz9gfG03OodYOqnByH+FBlk7Z6pO6c1EZm28NLyuT7eGixizz 9dKxZTMI7tXfaXN6xdhqKsPvs0MggJ6VcySQrCQ5JDbSyMiND63x9yXT2ezxvdroo4vw qA7T1JmBLNEaaN3GFdawfQjCEXXD7pwliZcZeEe2t8BHfIEM8YYbbibaxvfwy0Z/NEun B61fJqMKbnWSLb6sve1z2idOTvRYrVpnmGicPpCrW4PAunWN9/9HJPuubYSQKyhO82Ty MTGw== X-Gm-Message-State: AOAM533zWcWFmMgzfbRlIcikfHJeA18HbZ+blcN7gcS6lGaEbuQYxl/S VD7szq2f43JW5A5GKrSUFnIaf7DILsccn2pKhMAkF+RT X-Google-Smtp-Source: ABdhPJy5YQteHdDUUQsfgrI8dnM7kpupflvC9srOtrZxF9O4v+93VplTgdbMJbiiGuPOl+oXENK/QY6x2Fnt98C7qIk= X-Received: by 2002:a05:6402:c96:: with SMTP id cm22mr21115283edb.314.1632717491292; Sun, 26 Sep 2021 21:38:11 -0700 (PDT) MIME-Version: 1.0 References: <20210926031339.40043-1-songmuchun@bytedance.com> <20210926031339.40043-6-songmuchun@bytedance.com> In-Reply-To: <20210926031339.40043-6-songmuchun@bytedance.com> From: Barry Song <21cnbao@gmail.com> Date: Mon, 27 Sep 2021 17:38:00 +1300 Message-ID: Subject: Re: [PATCH v4 5/5] mm: sparsemem: move vmemmap related to HugeTLB to CONFIG_HUGETLB_PAGE_FREE_VMEMMAP To: Muchun Song Cc: Mike Kravetz , Andrew Morton , Oscar Salvador , Michal Hocko , Barry Song , David Hildenbrand , Chen Huang , "Bodeddula, Balasubramaniam" , Jonathan Corbet , Matthew Wilcox , Xiongchun duan , fam.zheng@bytedance.com, Muchun Song , Qi Zheng , linux-doc@vger.kernel.org, LKML , Linux-MM Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sun, Sep 26, 2021 at 4:15 PM Muchun Song wrote: > > 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 00bb2d938df4..a706e7ffda94 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -3182,10 +3182,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 d486a7a48512..3c7dd41c3164 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 > * > @@ -423,6 +424,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 > From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7BABBC433F5 for ; Mon, 27 Sep 2021 04:38:14 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id F305960F92 for ; Mon, 27 Sep 2021 04:38:13 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org F305960F92 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 1FD0B6B0071; Mon, 27 Sep 2021 00:38:13 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1ACD26B0072; Mon, 27 Sep 2021 00:38:13 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 09C21900002; Mon, 27 Sep 2021 00:38:13 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0184.hostedemail.com [216.40.44.184]) by kanga.kvack.org (Postfix) with ESMTP id F11596B0071 for ; Mon, 27 Sep 2021 00:38:12 -0400 (EDT) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id AB34B8249980 for ; Mon, 27 Sep 2021 04:38:12 +0000 (UTC) X-FDA: 78632096424.23.8970545 Received: from mail-ed1-f45.google.com (mail-ed1-f45.google.com [209.85.208.45]) by imf22.hostedemail.com (Postfix) with ESMTP id 6E0251903 for ; Mon, 27 Sep 2021 04:38:12 +0000 (UTC) Received: by mail-ed1-f45.google.com with SMTP id bd28so2325547edb.9 for ; Sun, 26 Sep 2021 21:38:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=83Uhs6ZL7h4cnl4M9YaZp+1cwFpz7hwB6M99EqA8Pek=; b=Wt/NNiCekc3wV4M98bGP4We81eFo45oWPb9JUhIjjHarMxCZFloPFPqM3DGq5qR2Xz DiH9zbth9nKe+0QEEfefJ/kMmqbGgvB+Sit1HZTEZ2STfJBRbzi9Gtgrar94Ub83TfcL OtESJn/asGAfl6CM5gNlX6ZvpceDUYsE0fcNIqqbxtAKsmmcNJSHNbqdOIHkYj2iDWD6 qROIZ3bonVnvPWKldxMTuI3J/GjNVUAu6DQj+pYPZYX18QD8Z2BY5wAvEvF9jHAxzf9/ RAGiDk3jrMST55boE5BE+by7r07xBkm0EcWwIJWr0GRPHv3xPfUT9H9x2x6mlh6i3vdR J//A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=83Uhs6ZL7h4cnl4M9YaZp+1cwFpz7hwB6M99EqA8Pek=; b=B1DWBClMDUUVuMECcgiQktPEEqVIPaU/acqN4eE457wnZgHfStKq++5GQr2fOdQtmZ 9CejCl+KBNW3m8OFYSFZutaKGa351nzbpEAK2HyAHJuZLAQOwb5J/BFc+jPwgRh4vTJu WchIAXJd0BaMdQ3QpZy1u71NKpn9b4s0b2q//7KeIWe/1WSSezrGgLK+2NKCuEWqY8uO 03KyhZXimMqLxSwzaCoH/02E7qGzHaasyPTdJvKmgibMVWaO31bCVI58BLUwFDeyhipl Bcxl2VArjvY2lJUi4MkrbtHT+hGx0RJgIqobh9vcJL599+DdK2TyWs6QGcW6viAAkYHn RZGw== X-Gm-Message-State: AOAM532qVJuhVX9Jxq5owEWdL9p3r+fW/DNYpzB1eftoNS4rXj27b82Q 92Wp/RRgv86jp11yNnZbS+bHMKqFjI4WCXZwmLw= X-Google-Smtp-Source: ABdhPJy5YQteHdDUUQsfgrI8dnM7kpupflvC9srOtrZxF9O4v+93VplTgdbMJbiiGuPOl+oXENK/QY6x2Fnt98C7qIk= X-Received: by 2002:a05:6402:c96:: with SMTP id cm22mr21115283edb.314.1632717491292; Sun, 26 Sep 2021 21:38:11 -0700 (PDT) MIME-Version: 1.0 References: <20210926031339.40043-1-songmuchun@bytedance.com> <20210926031339.40043-6-songmuchun@bytedance.com> In-Reply-To: <20210926031339.40043-6-songmuchun@bytedance.com> From: Barry Song <21cnbao@gmail.com> Date: Mon, 27 Sep 2021 17:38:00 +1300 Message-ID: Subject: Re: [PATCH v4 5/5] mm: sparsemem: move vmemmap related to HugeTLB to CONFIG_HUGETLB_PAGE_FREE_VMEMMAP To: Muchun Song Cc: Mike Kravetz , Andrew Morton , Oscar Salvador , Michal Hocko , Barry Song , David Hildenbrand , Chen Huang , "Bodeddula, Balasubramaniam" , Jonathan Corbet , Matthew Wilcox , Xiongchun duan , fam.zheng@bytedance.com, Muchun Song , Qi Zheng , linux-doc@vger.kernel.org, LKML , Linux-MM Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam05 X-Rspamd-Queue-Id: 6E0251903 X-Stat-Signature: u9fzp5ytknk6wpn8kkqfpcb7gm5r5z9h Authentication-Results: imf22.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b="Wt/NNiCe"; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf22.hostedemail.com: domain of 21cnbao@gmail.com designates 209.85.208.45 as permitted sender) smtp.mailfrom=21cnbao@gmail.com X-HE-Tag: 1632717492-296600 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: On Sun, Sep 26, 2021 at 4:15 PM Muchun Song wrote: > > 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 00bb2d938df4..a706e7ffda94 100644 > --- a/include/linux/mm.h > +++ b/include/linux/mm.h > @@ -3182,10 +3182,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 d486a7a48512..3c7dd41c3164 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 > * > @@ -423,6 +424,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 >