public inbox for linux-riscv@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] riscv: access_ok() optimization
@ 2024-03-27 14:38 Samuel Holland
  2024-03-27 14:38 ` [PATCH v2 1/2] riscv: Remove PGDIR_SIZE_L3 and TASK_SIZE_MIN Samuel Holland
                   ` (2 more replies)
  0 siblings, 3 replies; 8+ messages in thread
From: Samuel Holland @ 2024-03-27 14:38 UTC (permalink / raw)
  To: Palmer Dabbelt, linux-riscv
  Cc: Mark Rutland, David Laight, Arnd Bergmann, Alexandre Ghiti,
	Samuel Holland


This series optimizes access_ok() by defining TASK_SIZE_MAX. At Alex's
suggestion, I also tried making TASK_SIZE constant (specifically by
making PGDIR_SHIFT a variable instead of a ternary expression, then
replacing the load with an immediate using ALTERNATIVE). This appeared
to slightly improve performance on some implementations (C906) but
regressed it on others (FU740). So I am leaving further optimizations to
a later series.

Changes in v2:
 - Add a patch removing PGDIR_SIZE_L3 and TASK_SIZE_MIN
 - Set TASK_SIZE_MAX to LONG_MAX to optimize the comparison
 - Reword the commit message

Samuel Holland (2):
  riscv: Remove PGDIR_SIZE_L3 and TASK_SIZE_MIN
  riscv: Define TASK_SIZE_MAX for __access_ok()

 arch/riscv/include/asm/pgtable-64.h | 2 --
 arch/riscv/include/asm/pgtable.h    | 3 +--
 2 files changed, 1 insertion(+), 4 deletions(-)

-- 
2.43.1


_______________________________________________
linux-riscv mailing list
linux-riscv@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-riscv

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-05-22 14:10 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-03-27 14:38 [PATCH v2 0/2] riscv: access_ok() optimization Samuel Holland
2024-03-27 14:38 ` [PATCH v2 1/2] riscv: Remove PGDIR_SIZE_L3 and TASK_SIZE_MIN Samuel Holland
2024-03-27 16:24   ` Arnd Bergmann
2024-04-04  7:33   ` Alexandre Ghiti
2024-03-27 14:38 ` [PATCH v2 2/2] riscv: Define TASK_SIZE_MAX for __access_ok() Samuel Holland
2024-03-27 16:24   ` Arnd Bergmann
2024-04-04  7:38   ` Alexandre Ghiti
2024-05-22 14:10 ` [PATCH v2 0/2] riscv: access_ok() optimization patchwork-bot+linux-riscv

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox