From: Conor Dooley <conor@kernel.org>
To: Andrew Jones <ajones@ventanamicro.com>
Cc: panqinglin2020@iscas.ac.cn, palmer@dabbelt.com,
linux-riscv@lists.infradead.org, jeff@riscv.org,
xuyinan@ict.ac.cn
Subject: Re: [PATCH v11 1/3] riscv: mm: modify pte format for Svnapot
Date: Mon, 26 Dec 2022 18:40:23 +0000 [thread overview]
Message-ID: <Y6nql5IUhFnHv9sr@spud> (raw)
In-Reply-To: <20221226152213.crknhcpysonhq63c@orel>
[-- Attachment #1.1: Type: text/plain, Size: 3005 bytes --]
On Mon, Dec 26, 2022 at 05:01:29PM +0100, Andrew Jones wrote:
> On Mon, Dec 19, 2022 at 09:51:29PM +0000, Conor Dooley wrote:
> > On Fri, Dec 16, 2022 at 02:21:07PM +0800, panqinglin2020@iscas.ac.cn wrote:
> > > From: Qinglin Pan <panqinglin2020@iscas.ac.cn>
> > >
> > > Add one alternative to enable/disable svnapot support, enable this static
> > > key when "svnapot" is in the "riscv,isa" field of fdt and SVNAPOT compile
> > > option is set. It will influence the behavior of has_svnapot. All code
> > > dependent on svnapot should make sure that has_svnapot return true firstly.
> > >
> > > Modify PTE definition for Svnapot, and creates some functions in pgtable.h
> > > to mark a PTE as napot and check if it is a Svnapot PTE. Until now, only
> > > 64KB napot size is supported in spec, so some macros has only 64KB version.
> > >
> > > Signed-off-by: Qinglin Pan <panqinglin2020@iscas.ac.cn>
> > > Reviewed-by: Andrew Jones <ajones@ventanamicro.com>
> > >
> > > diff --git a/arch/riscv/Kconfig b/arch/riscv/Kconfig
> > > index e1a9fa47f012..25c230e3bf61 100644
> > > --- a/arch/riscv/Kconfig
> > > +++ b/arch/riscv/Kconfig
> > > @@ -397,6 +397,25 @@ config RISCV_ISA_C
> > >
> > > If you don't know what to do here, say Y.
> > >
> > > +config RISCV_ISA_SVNAPOT
> > > + bool "SVNAPOT extension support"
> > > + depends on 64BIT && MMU
> > > + select RISCV_ALTERNATIVE
> > > + default y
> > > + help
> > > + Allow kernel to detect the SVNAPOT ISA-extension dynamically at boot
> > > + time and enable its usage.
> > > +
> > > + The SVNAPOT extension is used to mark contiguous PTEs as a range
> > > + of contiguous virtual-to-physical translations for a naturally
> > > + aligned power-of-2 (NAPOT) granularity larger than the base 4KB page
> > > + size. When HUGETLBFS is also selected this option unconditionally
> > > + allocates some memory for each NAPOT page size supported by the kernel.
> > > + When optimizing for low memory consumption and for platforms without
> >
> > nit: Does this make more sense as "When optimising for low memory
> > consumption on platforms without the SVNAPOT extension"...?
> > Or does disabling Svnapot save memory on Svnapot capable systems too?
>
> Depends on how we define "save". Disabling RISCV_ISA_SVNAPOT on HUGETLBFS
> enabled systems will reduce memory consumption whether the svnapot
> extension is present or not. When the extension is present, the memory
> consumed may serve a purpose, whereas, on systems without svnapot, the
> memory consumed cannot serve a purpose.
Right, thanks for the explanation. I'm sorry to be a bore here, but should
it be reworded then to "When optimising for low memory consumption on
platforms without SVNAPOT, or if HUGETLBFS is enabled, say N here"?
I don't really care either way to be perfectly honest, so as I said in
my other reply "don't bother resubmitting unless someone else asks for
meaningful changes" ;)
Conor.
[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
[-- Attachment #2: Type: text/plain, Size: 161 bytes --]
_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv
next prev parent reply other threads:[~2022-12-26 18:40 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-16 6:21 [PATCH v11 0/3] riscv, mm: detect svnapot cpu support at runtime panqinglin2020
2022-12-16 6:21 ` [PATCH v11 1/3] riscv: mm: modify pte format for Svnapot panqinglin2020
2022-12-19 21:51 ` Conor Dooley
2022-12-26 16:01 ` Andrew Jones
2022-12-26 18:40 ` Conor Dooley [this message]
2022-12-26 19:19 ` Andrew Jones
2023-01-08 6:21 ` Qinglin Pan
2022-12-16 6:21 ` [PATCH v11 2/3] riscv: mm: support Svnapot in hugetlb page panqinglin2020
2022-12-16 6:21 ` [PATCH v11 3/3] riscv: mm: support Svnapot in huge vmap panqinglin2020
2022-12-19 21:48 ` [PATCH v11 0/3] riscv, mm: detect svnapot cpu support at runtime Conor Dooley
2023-01-14 4:54 ` Qinglin Pan
2023-02-01 11:58 ` Qinglin Pan
2023-02-15 0:02 ` Palmer Dabbelt
2023-02-15 2:47 ` Qinglin Pan
2023-02-16 22:04 ` Conor Dooley
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=Y6nql5IUhFnHv9sr@spud \
--to=conor@kernel.org \
--cc=ajones@ventanamicro.com \
--cc=jeff@riscv.org \
--cc=linux-riscv@lists.infradead.org \
--cc=palmer@dabbelt.com \
--cc=panqinglin2020@iscas.ac.cn \
--cc=xuyinan@ict.ac.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox