Message ID | 20230127050421.1920048-1-guoren@kernel.org |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp658881wrn; Thu, 26 Jan 2023 21:26:14 -0800 (PST) X-Google-Smtp-Source: AMrXdXtWEN8g4IH5DK+FUiDywDbTDfPt9sNsl9Wgbw4TLc7xoOGUKe3g75IJ9ycib6ux0cccMxDF X-Received: by 2002:a17:906:f907:b0:7c1:e78:11ed with SMTP id lc7-20020a170906f90700b007c10e7811edmr41909366ejb.0.1674797174318; Thu, 26 Jan 2023 21:26:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1674797174; cv=none; d=google.com; s=arc-20160816; b=LH+Q7rCUp2+q/+yukg62zF5d5+asA04vl6ANkHt2M50p7pFK4KTsrA+Yc9AiNfPiUf OQIj3OG82HzJbc87fbkeU3+vfemlqY+bWSyfq0LRmfK3Ni+VRPLTA7QQMm6X8s0/soZl NpOTGAmE2jQmh0s567aEcaOHZXPZJyhl6byfjoOJZ0ADYp477pUIkq7p+cL+FXOukK0f 0tz3PKecxs88IBVncmad1axAjNZhX4f8EcHCj/eyKiFp2VJUoNhkAEzjnunq2vHVlAsZ kfD/ItNmE0XWuZ68otPGkjs/qKOqkO+oGvHVCbHXtpmuuwVW19ViSOuBHjHLAKnnDwiX IQ7Q== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=LQ06gnndpK/GjlVhCm5okbtApoCl2dziNtUoqUcbAqQ=; b=qN/TMHUK8u/hjUTG50iCU6Hw92qzOg38oYe3RM9p5o7LNKgKFTu3Q5dUuDQEmul88j T5q1RKHUj5quYaUFtUZMu3XoTZ/Z0UcV+HB1vLC+iuwk8EukxDS49j8wOE5WxCeGS0/k Hk2WiH9/m9MhrOvnj5w4M6YHzl2+7lvYOJKrlKw3wATviwcGTCkP3drPCd777YSrOnNn ueSvvIXlY/tksVbEd9oXc07/a9H8HfwUfCDHYab3WhSrezNQs/aNRnI0ZfL6cZmuPfpp swyIsysFOL52TkfSI3RvOLqw9+UkzOVvgkzwEQZUgaJBWPFHf5+S98/s+RplwQXcuTqa Q7wQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Mp/rTFaZ"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n18-20020a17090673d200b00879ec1afce0si2003350ejl.537.2023.01.26.21.25.51; Thu, 26 Jan 2023 21:26:14 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="Mp/rTFaZ"; 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=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230410AbjA0FE5 (ORCPT <rfc822;lekhanya01809@gmail.com> + 99 others); Fri, 27 Jan 2023 00:04:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42458 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229448AbjA0FE4 (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Fri, 27 Jan 2023 00:04:56 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5D315CE74 for <linux-kernel@vger.kernel.org>; Thu, 26 Jan 2023 21:04:55 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 4AD5FB81F87 for <linux-kernel@vger.kernel.org>; Fri, 27 Jan 2023 05:04:54 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id A6801C433EF; Fri, 27 Jan 2023 05:04:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1674795893; bh=/HLKprgFCkbwfasw3ymLCwPg8rX60Yypp+3lYT3FCJ4=; h=From:To:Cc:Subject:Date:From; b=Mp/rTFaZrIswP/zPyxJsexO6HD1kJWsmPpq+Dl17E8g8+5vNo28eKn/wnbal/dq+9 ue1W8sWQZARzTxdJxD6tWGlMycrf0stBW/c7G7KK/kcP6+66EeJei/Z9Zi4wMHLoM6 nbjjXIAZo0T+MSGYbJ24kPTSIRpWwwZ3lqEhgQvQfLV9n3Je9q25UJf2/w8NXrWgJz ec7ljPaw+1OEHlYYuOawmSCkTUEeJ8MbV1+hZQmJMBXMrlUqZN0/9hHe7xJMt1/vqP hYlq3slKHiZe3SDP9+qiaDFB969ICKH9rAnBhfUQ+nYmjrK6Up8PxAvs9+9CW+ZgkA VvNYgMm89j8TA== From: guoren@kernel.org To: tongtiangen@huawei.com, alexandre.ghiti@canonical.com, muchun.song@linux.dev, palmer@rivosinc.com, guoren@kernel.org Cc: linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org, Guo Ren <guoren@linux.alibaba.com>, Muchun Song <songmuchun@bytedance.com> Subject: [PATCH -next V2] riscv: mm: hugetlb: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP Date: Fri, 27 Jan 2023 00:04:21 -0500 Message-Id: <20230127050421.1920048-1-guoren@kernel.org> X-Mailer: git-send-email 2.36.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756152122219970371?= X-GMAIL-MSGID: =?utf-8?q?1756152122219970371?= |
Series |
[-next,V2] riscv: mm: hugetlb: Enable ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP
|
|
Commit Message
Guo Ren
Jan. 27, 2023, 5:04 a.m. UTC
From: Guo Ren <guoren@linux.alibaba.com> Add HVO support for RISC-V; see commit 6be24bed9da3 ("mm: hugetlb: introduce a new config HUGETLB_PAGE_FREE_VMEMMAP"). This patch is similar to commit 1e63ac088f20 ("arm64: mm: hugetlb: enable HUGETLB_PAGE_FREE_VMEMMAP for arm64"), and riscv's motivation is the same as arm64. The current riscv was ready to enable HVO after fixup, ref commit d33deda095d3 ("riscv/mm: hugepage's PG_dcache_clean flag is only set in head page"). The HugeTLB VmemmapvOptimization (HVO) defaults to off in Kconfig. Here is the riscv test log: cat /proc/sys/vm/hugetlb_optimize_vmemmap echo 8 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages mount -t hugetlbfs none test/ -o pagesize=2048k <Try some simple hugetlb test in test dir, no problem found.> Signed-off-by: Guo Ren <guoren@linux.alibaba.com> Signed-off-by: Guo Ren <guoren@kernel.org> Link: https://lore.kernel.org/linux-riscv/1F5AF29D-708A-483B-A29F-CAEE6F554866@linux.dev/ Acked-by: Muchun Song <songmuchun@bytedance.com> --- Changelog: V2: - Optimize the commit log - Remove riscv page compound_head fixup which has been merged. - Rebase on riscv for-next (20230127) - Add HVO author's acked-by V1: https://lore.kernel.org/linux-riscv/20221023133205.3493564-1-guoren@kernel.org/ --- arch/riscv/Kconfig | 1 + 1 file changed, 1 insertion(+)
Comments
On Fri, Jan 27, 2023 at 12:04:21AM -0500, guoren@kernel.org wrote: > From: Guo Ren <guoren@linux.alibaba.com> > > Add HVO support for RISC-V; see commit 6be24bed9da3 ("mm: hugetlb: > introduce a new config HUGETLB_PAGE_FREE_VMEMMAP"). I found Documentation/mm/vmemmap_dedup.rst even more enlightening about HVO than the commit message of 6be24bed9da3. > This patch is > similar to commit 1e63ac088f20 ("arm64: mm: hugetlb: enable > HUGETLB_PAGE_FREE_VMEMMAP for arm64"), and riscv's motivation is the > same as arm64. The current riscv was ready to enable HVO after fixup, > ref commit d33deda095d3 ("riscv/mm: hugepage's PG_dcache_clean flag > is only set in head page"). > > The HugeTLB VmemmapvOptimization (HVO) defaults to off in Kconfig. > > Here is the riscv test log: > cat /proc/sys/vm/hugetlb_optimize_vmemmap > echo 8 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages > mount -t hugetlbfs none test/ -o pagesize=2048k > <Try some simple hugetlb test in test dir, no problem found.> > > Signed-off-by: Guo Ren <guoren@linux.alibaba.com> > Signed-off-by: Guo Ren <guoren@kernel.org> > Link: https://lore.kernel.org/linux-riscv/1F5AF29D-708A-483B-A29F-CAEE6F554866@linux.dev/ > Acked-by: Muchun Song <songmuchun@bytedance.com> > --- > Changelog: > V2: > - Optimize the commit log > - Remove riscv page compound_head fixup which has been merged. > - Rebase on riscv for-next (20230127) > - Add HVO author's acked-by > > V1: > https://lore.kernel.org/linux-riscv/20221023133205.3493564-1-guoren@kernel.org/ > --- > arch/riscv/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index e2b656043abf..949974a38a41 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -46,6 +46,7 @@ config RISCV > select ARCH_WANT_FRAME_POINTERS > select ARCH_WANT_GENERAL_HUGETLB > select ARCH_WANT_HUGE_PMD_SHARE if 64BIT > + select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP > select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE > select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU > select BUILDTIME_TABLE_SORT if MMU > -- > 2.36.1 > Reviewed-by: Andrew Jones <ajones@ventanamicro.com> Thanks, drew
On Fri, Jan 27, 2023 at 12:04:21AM -0500, guoren@kernel.org wrote: > From: Guo Ren <guoren@linux.alibaba.com> > > Add HVO support for RISC-V; see commit 6be24bed9da3 ("mm: hugetlb: > introduce a new config HUGETLB_PAGE_FREE_VMEMMAP"). This patch is > similar to commit 1e63ac088f20 ("arm64: mm: hugetlb: enable > HUGETLB_PAGE_FREE_VMEMMAP for arm64"), and riscv's motivation is the > same as arm64. The current riscv was ready to enable HVO after fixup, > ref commit d33deda095d3 ("riscv/mm: hugepage's PG_dcache_clean flag > is only set in head page"). > > The HugeTLB VmemmapvOptimization (HVO) defaults to off in Kconfig. > > Here is the riscv test log: > cat /proc/sys/vm/hugetlb_optimize_vmemmap > echo 8 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages > mount -t hugetlbfs none test/ -o pagesize=2048k > <Try some simple hugetlb test in test dir, no problem found.> > > Signed-off-by: Guo Ren <guoren@linux.alibaba.com> > Signed-off-by: Guo Ren <guoren@kernel.org> > Link: https://lore.kernel.org/linux-riscv/1F5AF29D-708A-483B-A29F-CAEE6F554866@linux.dev/ > Acked-by: Muchun Song <songmuchun@bytedance.com> > --- > Changelog: > V2: > - Optimize the commit log > - Remove riscv page compound_head fixup which has been merged. > - Rebase on riscv for-next (20230127) > - Add HVO author's acked-by > > V1: > https://lore.kernel.org/linux-riscv/20221023133205.3493564-1-guoren@kernel.org/ > --- > arch/riscv/Kconfig | 1 + > 1 file changed, 1 insertion(+) > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > index e2b656043abf..949974a38a41 100644 > --- a/arch/riscv/Kconfig > +++ b/arch/riscv/Kconfig > @@ -46,6 +46,7 @@ config RISCV > select ARCH_WANT_FRAME_POINTERS > select ARCH_WANT_GENERAL_HUGETLB > select ARCH_WANT_HUGE_PMD_SHARE if 64BIT > + select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP CI is telling me that this is added out of order. I suppose that means that T is before _ in the "alphabet", and this should be moved up one line. Perhaps it can be fixed on application! > select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE > select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU > select BUILDTIME_TABLE_SORT if MMU > -- > 2.36.1 >
On Fri, Jan 27, 2023 at 7:57 PM Andrew Jones <ajones@ventanamicro.com> wrote: > > On Fri, Jan 27, 2023 at 12:04:21AM -0500, guoren@kernel.org wrote: > > From: Guo Ren <guoren@linux.alibaba.com> > > > > Add HVO support for RISC-V; see commit 6be24bed9da3 ("mm: hugetlb: > > introduce a new config HUGETLB_PAGE_FREE_VMEMMAP"). > > I found Documentation/mm/vmemmap_dedup.rst even more enlightening > about HVO than the commit message of 6be24bed9da3. I've put that in v3 commit log. > > > This patch is > > similar to commit 1e63ac088f20 ("arm64: mm: hugetlb: enable > > HUGETLB_PAGE_FREE_VMEMMAP for arm64"), and riscv's motivation is the > > same as arm64. The current riscv was ready to enable HVO after fixup, > > ref commit d33deda095d3 ("riscv/mm: hugepage's PG_dcache_clean flag > > is only set in head page"). > > > > The HugeTLB VmemmapvOptimization (HVO) defaults to off in Kconfig. > > > > Here is the riscv test log: > > cat /proc/sys/vm/hugetlb_optimize_vmemmap > > echo 8 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages > > mount -t hugetlbfs none test/ -o pagesize=2048k > > <Try some simple hugetlb test in test dir, no problem found.> > > > > Signed-off-by: Guo Ren <guoren@linux.alibaba.com> > > Signed-off-by: Guo Ren <guoren@kernel.org> > > Link: https://lore.kernel.org/linux-riscv/1F5AF29D-708A-483B-A29F-CAEE6F554866@linux.dev/ > > Acked-by: Muchun Song <songmuchun@bytedance.com> > > --- > > Changelog: > > V2: > > - Optimize the commit log > > - Remove riscv page compound_head fixup which has been merged. > > - Rebase on riscv for-next (20230127) > > - Add HVO author's acked-by > > > > V1: > > https://lore.kernel.org/linux-riscv/20221023133205.3493564-1-guoren@kernel.org/ > > --- > > arch/riscv/Kconfig | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > > index e2b656043abf..949974a38a41 100644 > > --- a/arch/riscv/Kconfig > > +++ b/arch/riscv/Kconfig > > @@ -46,6 +46,7 @@ config RISCV > > select ARCH_WANT_FRAME_POINTERS > > select ARCH_WANT_GENERAL_HUGETLB > > select ARCH_WANT_HUGE_PMD_SHARE if 64BIT > > + select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP > > select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE > > select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU > > select BUILDTIME_TABLE_SORT if MMU > > -- > > 2.36.1 > > > > Reviewed-by: Andrew Jones <ajones@ventanamicro.com> > > Thanks, > drew
On Wed, Feb 1, 2023 at 2:23 AM Conor Dooley <conor@kernel.org> wrote: > > On Fri, Jan 27, 2023 at 12:04:21AM -0500, guoren@kernel.org wrote: > > From: Guo Ren <guoren@linux.alibaba.com> > > > > Add HVO support for RISC-V; see commit 6be24bed9da3 ("mm: hugetlb: > > introduce a new config HUGETLB_PAGE_FREE_VMEMMAP"). This patch is > > similar to commit 1e63ac088f20 ("arm64: mm: hugetlb: enable > > HUGETLB_PAGE_FREE_VMEMMAP for arm64"), and riscv's motivation is the > > same as arm64. The current riscv was ready to enable HVO after fixup, > > ref commit d33deda095d3 ("riscv/mm: hugepage's PG_dcache_clean flag > > is only set in head page"). > > > > The HugeTLB VmemmapvOptimization (HVO) defaults to off in Kconfig. > > > > Here is the riscv test log: > > cat /proc/sys/vm/hugetlb_optimize_vmemmap > > echo 8 > /sys/kernel/mm/hugepages/hugepages-2048kB/nr_hugepages > > mount -t hugetlbfs none test/ -o pagesize=2048k > > <Try some simple hugetlb test in test dir, no problem found.> > > > > Signed-off-by: Guo Ren <guoren@linux.alibaba.com> > > Signed-off-by: Guo Ren <guoren@kernel.org> > > Link: https://lore.kernel.org/linux-riscv/1F5AF29D-708A-483B-A29F-CAEE6F554866@linux.dev/ > > Acked-by: Muchun Song <songmuchun@bytedance.com> > > --- > > Changelog: > > V2: > > - Optimize the commit log > > - Remove riscv page compound_head fixup which has been merged. > > - Rebase on riscv for-next (20230127) > > - Add HVO author's acked-by > > > > V1: > > https://lore.kernel.org/linux-riscv/20221023133205.3493564-1-guoren@kernel.org/ > > --- > > arch/riscv/Kconfig | 1 + > > 1 file changed, 1 insertion(+) > > > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig > > index e2b656043abf..949974a38a41 100644 > > --- a/arch/riscv/Kconfig > > +++ b/arch/riscv/Kconfig > > @@ -46,6 +46,7 @@ config RISCV > > select ARCH_WANT_FRAME_POINTERS > > select ARCH_WANT_GENERAL_HUGETLB > > select ARCH_WANT_HUGE_PMD_SHARE if 64BIT > > + select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP > > CI is telling me that this is added out of order. I suppose that means > that T is before _ in the "alphabet", and this should be moved up one > line. > Perhaps it can be fixed on application! okay > > > select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE > > select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU > > select BUILDTIME_TABLE_SORT if MMU > > -- > > 2.36.1 > >
diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig index e2b656043abf..949974a38a41 100644 --- a/arch/riscv/Kconfig +++ b/arch/riscv/Kconfig @@ -46,6 +46,7 @@ config RISCV select ARCH_WANT_FRAME_POINTERS select ARCH_WANT_GENERAL_HUGETLB select ARCH_WANT_HUGE_PMD_SHARE if 64BIT + select ARCH_WANT_HUGETLB_PAGE_OPTIMIZE_VMEMMAP select ARCH_WANTS_THP_SWAP if HAVE_ARCH_TRANSPARENT_HUGEPAGE select BINFMT_FLAT_NO_DATA_START_OFFSET if !MMU select BUILDTIME_TABLE_SORT if MMU