Skip to content

Commit 12cf29c

Browse files
Merge patch series "riscv: access_ok() optimization"
Samuel Holland <[email protected]> says: 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. * b4-shazam-merge: riscv: Define TASK_SIZE_MAX for __access_ok() riscv: Remove PGDIR_SIZE_L3 and TASK_SIZE_MIN Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Palmer Dabbelt <[email protected]>
2 parents 2aff5f9 + ad5643c commit 12cf29c

File tree

2 files changed

+1
-4
lines changed

2 files changed

+1
-4
lines changed

arch/riscv/include/asm/pgtable-64.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@ extern bool pgtable_l5_enabled;
1616
#define PGDIR_SHIFT_L3 30
1717
#define PGDIR_SHIFT_L4 39
1818
#define PGDIR_SHIFT_L5 48
19-
#define PGDIR_SIZE_L3 (_AC(1, UL) << PGDIR_SHIFT_L3)
20-
2119
#define PGDIR_SHIFT (pgtable_l5_enabled ? PGDIR_SHIFT_L5 : \
2220
(pgtable_l4_enabled ? PGDIR_SHIFT_L4 : PGDIR_SHIFT_L3))
2321
/* Size of region mapped by a page global directory */

arch/riscv/include/asm/pgtable.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -880,7 +880,7 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)
880880
*/
881881
#ifdef CONFIG_64BIT
882882
#define TASK_SIZE_64 (PGDIR_SIZE * PTRS_PER_PGD / 2)
883-
#define TASK_SIZE_MIN (PGDIR_SIZE_L3 * PTRS_PER_PGD / 2)
883+
#define TASK_SIZE_MAX LONG_MAX
884884

885885
#ifdef CONFIG_COMPAT
886886
#define TASK_SIZE_32 (_AC(0x80000000, UL) - PAGE_SIZE)
@@ -892,7 +892,6 @@ static inline pte_t pte_swp_clear_exclusive(pte_t pte)
892892

893893
#else
894894
#define TASK_SIZE FIXADDR_START
895-
#define TASK_SIZE_MIN TASK_SIZE
896895
#endif
897896

898897
#else /* CONFIG_MMU */

0 commit comments

Comments
 (0)