From: Conor Dooley <conor@kernel.org>
To: Andrew Jones <ajones@ventanamicro.com>,
Qinglin Pan <panqinglin2020@iscas.ac.cn>
Cc: linux-riscv@lists.infradead.org, palmer@dabbelt.com, jeff@riscv.org
Subject: Re: [PATCH v9 1/3] riscv: mm: modify pte format for Svnapot
Date: Fri, 09 Dec 2022 15:33:25 +0100 [thread overview]
Message-ID: <CD44ACE9-43EC-4865-8604-1C7876D5EEAE@kernel.org> (raw)
In-Reply-To: <20221209074229.iexrvp5hkuq3qz2l@kamzik>
On 9 December 2022 08:42:29 GMT+01:00, Andrew Jones <ajones@ventanamicro.com> wrote:
>On Fri, Dec 09, 2022 at 01:34:42AM +0800, Qinglin Pan wrote:
>...
>> > > > +#ifdef CONFIG_RISCV_ISA_SVNAPOT
>> > > > +#define HUGE_MAX_HSTATE (2 + (NAPOT_ORDER_MAX -
>> > > > NAPOT_CONT_ORDER_BASE))
>> > > > +#else
>> > > > +#define HUGE_MAX_HSTATE 2
>> > > > +#endif
>> > >
>> > > This is coming from a place of *complete* ignorance:
>> > > If CONFIG_RISCV_ISA_SVNAPOT is enabled in the kernel but there is no
>> > > support for it on a platform is it okay to change the value of
>> > > HUGE_MAX_HSTATE? Apologies if I've missed something obvious.
>> >
>> > :(
>> > You are right. If CONFIG_RISCV_ISA_SVNAPOT is enabled, HUGE_MAX_HSTATE
>> > will always be 3 whether has_svnapot() is true or false. I will try to
>> > fix this.
>>
>> I am really expecting that HUGE_MAX_HSTATE can change according to the
>> platform situation when CONFIG_RISCV_ISA_SVNAPOT is enabled. But it
>> seems impossible to achive this with a minor patch. Because this value
>> is used as some static allocated arrays' length (for example, hstates in
>> mm/hugetlb.c:52) in arch-independent code :(
>>
>> This immuture HUGE_MAX_HSTATE value will cause no functional error but
>> it really makes some objects used only partially when
>> CONFIG_RISCV_ISA_SVNAPOT is enabled but the platform has no svnapot
>> support :( I am not sure whether this patch can be accepted with this
>> feature? Or any other helpful idea to fix this problem?
>>
>> Please let me know if I ignore any information about it.
>
>I agree that the only problem appears to a waste of memory, particularly
Caveat about ignorance still applies, how much of a waste of memory are we talking?
>if cgroups are enabled. I don't see any easy solution either. Maybe a
>warning in the Kconfig text would be sufficient?
I think that entirely depends on how wasteful it is.
If it's minor, sure?
Thanks,
Conor.
_______________________________________________
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-09 14:33 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-12-04 14:11 [PATCH v9 0/3] riscv, mm: detect svnapot cpu support at runtime panqinglin2020
2022-12-04 14:11 ` [PATCH v9 1/3] riscv: mm: modify pte format for Svnapot panqinglin2020
2022-12-06 19:56 ` Conor Dooley
2022-12-07 18:46 ` Conor Dooley
2022-12-08 4:51 ` Qinglin Pan
2022-12-08 4:59 ` Conor.Dooley
2022-12-08 17:34 ` Qinglin Pan
2022-12-09 7:42 ` Andrew Jones
2022-12-09 14:33 ` Conor Dooley [this message]
2022-12-09 15:36 ` Qinglin Pan
2022-12-09 17:04 ` Andrew Jones
2022-12-08 14:55 ` Andrew Jones
2022-12-04 14:11 ` [PATCH v9 2/3] riscv: mm: support Svnapot in hugetlb page panqinglin2020
2022-12-07 18:55 ` Conor Dooley
2022-12-08 4:54 ` Qinglin Pan
2022-12-08 15:17 ` Andrew Jones
2022-12-08 17:43 ` Qinglin Pan
2022-12-04 14:11 ` [PATCH v9 3/3] riscv: mm: support Svnapot in huge vmap panqinglin2020
2022-12-07 18:59 ` Conor Dooley
2022-12-08 4:57 ` Qinglin Pan
2022-12-08 15:22 ` Andrew Jones
2022-12-08 17:39 ` Qinglin Pan
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=CD44ACE9-43EC-4865-8604-1C7876D5EEAE@kernel.org \
--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 \
/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