[PATCH v3] riscv: Fix icache flush being skipped for a second mm mapping an exec folio
Nickolai Zeldovich
nickolai at csail.mit.edu
Tue Oct 13 22:57:41 PDT 2026
On Wed, Oct 14, 2026 at 12:50 AM Jisheng Zhang <jszhang at kernel.org> wrote:
> Now the patch looks better. I only have one concern: RV32 doesn't have
> native atomic64, so falls back to generic atomic64 implementation which
> disables local irq, takes spin lock, then does the operation, unlock,
> restore local irq, so I'm not sure whether overhead for RV32 is too
> heavy or not. However, I have no other better solution for RV32.
One option would be to disable this optimization on RV32 (i.e., undo
01261e24cfab on RV32, by calling flush_icache_all() as before, and
keep the optimization with the icache_gen fix on RV64). This might be
a reasonable trade-off, if RV32 tend to be relatively small, and the
many-core machines that benefit from this optimization are RV64.
Nickolai.
More information about the linux-riscv
mailing list