> > > > 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?