From: Zhenhua Huang <quic_zhenhuah@quicinc.com>
To: Alexander Potapenko <glider@google.com>
Cc: Marco Elver <elver@google.com>, <catalin.marinas@arm.com>,
<will@kernel.org>, <akpm@linux-foundation.org>,
<linux-arm-kernel@lists.infradead.org>, <linux-mm@kvack.org>,
Mark Rutland <mark.rutland@arm.com>
Subject: Re: [PATCH] mm: kfence: export kfence_enabled as global variables
Date: Tue, 7 Feb 2023 18:42:44 +0800 [thread overview]
Message-ID: <d85e096a-f389-2e90-446e-6275594a57f7@quicinc.com> (raw)
In-Reply-To: <CAG_fn=VqXtMB_ekGAEOowTwEyTBOsVzG+qPOTGghtBvpdTQYtQ@mail.gmail.com>
On 2023/2/7 18:28, Alexander Potapenko wrote:
>>>
>>> What is the problem you have encountered? Is the page-granular direct
>>> map causing issues?
>> We're working on a low memory target, page-granular mapping costed more
>> (2M per 1GB) memory. Due to GKI constraints, it is not easy to disable
>> CONFIG_KFENCE. So my intention was to move the judgement to runtime
>> configurable w/ CONFIG_KFENCE on...
>>
>> Do you have any further suggestion/proposal on this? Many Thanks!
>
> Right now CONFIG_KFENCE allocates 512Kb for the GKI kernel (only 63
> objects instead of the default 255):
> https://cs.android.com/android/kernel/superproject/+/common-android-mainline:common/arch/arm64/configs/gki_defconfig;l=686?q=CONFIG_KFENCE_NUM_OBJECTS
> Where do 2M come from?
Hi Alexander,
It is not from KFENCE cost itself, but from the requirement it needs
page-granular mapping.
2M per 1GB cost is from linear mapping for page granularity. You can see
can_set_direct_map() is used for whether allowing section mapping or not.
_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
next prev parent reply other threads:[~2023-02-07 10:43 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-02-07 6:15 [PATCH] mm: kfence: export kfence_enabled as global variables Zhenhua Huang
2023-02-07 7:19 ` Marco Elver
2023-02-07 7:46 ` Zhenhua Huang
2023-02-07 10:28 ` Alexander Potapenko
2023-02-07 10:42 ` Zhenhua Huang [this message]
2023-02-07 10:48 ` Mark Rutland
2023-02-07 12:35 ` Zhenhua Huang
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=d85e096a-f389-2e90-446e-6275594a57f7@quicinc.com \
--to=quic_zhenhuah@quicinc.com \
--cc=akpm@linux-foundation.org \
--cc=catalin.marinas@arm.com \
--cc=elver@google.com \
--cc=glider@google.com \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-mm@kvack.org \
--cc=mark.rutland@arm.com \
--cc=will@kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).