mm: add basic PTE const type-safety
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest6 patches 26 repliesIn review
- v15 patches 11 repliesSuperseded
Changes in v2 from the cover letter
- Small fixups on the arm64 side
- Re-order patches in a way such that bisection is preserved
- Pick up Helge's patch dropping parisc ptep_get()
- Constify s390's ptep_get() as well
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | mm/arm64: constify pte_get*() and contpte get logicarch/ arch/ | +13 | 3 replies | |
| 2/6 | parisc: Drop own implementations for ptep_get() and ptep_test_and_clear_young()arch/ | +0 | 5 replies | |
| 3/6 | mm/powerpc/8xx: constify ptep_get() argumentarch/ | +1 | 7 replies | |
| 4/6 | mm/s390: constify ptep_get() argumentarch/ | +1 | 1 reply | |
| 5/6 | mm: constify generic pte_get*()include/ | +3 | 2 replies | |
| 6/6 | mm: constify the pte_offset_map_ro_nolock() return valuearch/ include/ include/ +3 more | +8 | 4 replies |
Reviews trailers per patch
5 of 6 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.
| Patch | Muhammad Usama Anjum | Christophe Leroy (CS GROUP) | Lorenzo Stoakes (ARM) | David Hildenbrand (Arm) |
|---|---|---|---|---|
| Series | R-b | R-b | ||
| 1/6 | ||||
| 2/6 | R-b | |||
| 3/6 | R-b | |||
| 4/6 | R-b | |||
| 5/6 | R-b | A-b | ||
| 6/6 | R-b |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.
Cover letter [PATCH v2 0/6] mm: add basic PTE const type-safety
Since forever, MM code has thrown pte_t * around with no concern for const safety, or typesafety of any kind. This is confusing. Attempt to address it by:
1) Making sure pte_get*() helpers can cope with const pte_t * arguments
2) Constifying the pte_offset_map_ro_nolock() return type, which by definition already pledges that users will not write to it.
These two simple steps were already able to uncover code smell from khugepaged + do_swap_page().
Separate steps could include introducing pte_offset_map_ro_lock() for more widespread usage of this.
Benefits of this include less confusion and better type-safety. It could also futurely aid in efforts such as [0] which may want semantic annotation of these accesses.
Based on mm-unstable and compile-tested on a handful of architectures.
No functional changes intended.
[CC list editorially trimmed for brevity reasons; apologies if you're not on it]
v2:
- Small fixups on the arm64 side
- Re-order patches in a way such that bisection is preserved
- Pick up Helge's patch dropping parisc ptep_get()
- Constify s390's ptep_get() as well
Helge Deller (1):
parisc: Drop own implementations for ptep_get() and
ptep_test_and_clear_young()
Pedro Falcato (5):
mm/arm64: constify pte_get*() and contpte get logic mm/powerpc/8xx: constify ptep_get() argument mm/s390: constify ptep_get() argument
mm: constify generic pte_get*()
mm: constify the pte_offset_map_ro_nolock() return value
arch/arm64/include/asm/pgtable.h | 10 +++++----- arch/arm64/mm/contpte.c | 11 ++++++++--- arch/parisc/include/asm/pgtable.h | 20 -------------------- arch/powerpc/include/asm/nohash/32/pte-8xx.h | 2 +- arch/powerpc/mm/pgtable.c | 2 +- arch/s390/include/asm/pgtable.h | 2 +- include/linux/mm.h | 4 ++-- include/linux/pgtable.h | 8 ++++---- mm/filemap.c | 2 +- mm/khugepaged.c | 2 +- mm/pgtable-generic.c | 4 ++-- 11 files changed, 26 insertions(+), 41 deletions(-)
Signature · 1 line
2.55.0