Skip to content

RFC mm: common PAGE_SIZE shift macros

Oleksandr Natalenko linux-mm lkml oe-kbuild-all 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v2 RFC Latest3 patches 2 repliesIn review

Changes in v2 from the cover letter

* change name from K(x) to PG2KB(x)
* also provide KB2PG(x)
* replace open-coded variants
* do not use separate header file for macro definitions

[1] https://lore.kernel.org/linux-mm/[email protected]/
[2] https://lore.kernel.org/lkml/[email protected]/

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/3mm: add PG2KB/KB2PG helper macrosinclude/linux/mm.h+3 -02 replies
2/3mm: replace custom PG2KB/KB2PG macros with common onesarch/arc/include/asm/arcregs.h arch/powerpc/platforms/pseries/cmm.c arch/s390/appldata/appldata_mem.c +9 more+136 -1490 replies
3/3mm: replace open-coded PG2KB/KB2PG variants with macrosarch/alpha/kernel/setup.c arch/mips/mm/init.c arch/x86/kernel/cpu/mtrr/cleanup.c +23 more+58 -550 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [RFC v2 PATCH 0/3] mm: common PAGE_SIZE shift macros

There are various places where the K(x) macro (or its alternative and/or counterpart) is defined. This submission gets rid of multiple definitions and provides common ones.

Based on discussion with Miaohe Lin [1].

The patch is based on top of next-20210910 and is compile-tested using allyesconfig.

RFC v1: [2].

Changes since RFC v1:

* change name from K(x) to PG2KB(x)
* also provide KB2PG(x)
* replace open-coded variants
* do not use separate header file for macro definitions

[1] https://lore.kernel.org/linux-mm/[email protected]/
[2] https://lore.kernel.org/lkml/[email protected]/

Oleksandr Natalenko (3):
mm: add PG2KB/KB2PG helper macros
mm: replace custom PG2KB/KB2PG macros with common ones
mm: replace open-coded PG2KB/KB2PG variants with macros

 arch/alpha/kernel/setup.c                     |  3 +-
 arch/arc/include/asm/arcregs.h                |  4 +-
 arch/mips/mm/init.c                           |  2 +-
 arch/powerpc/platforms/pseries/cmm.c          | 17 ++--
 arch/s390/appldata/appldata_mem.c             | 19 ++--
 arch/x86/kernel/cpu/mtrr/cleanup.c            | 17 ++--
 block/blk-sysfs.c                             |  9 +-
 drivers/base/node.c                           | 69 ++++++++-------
 drivers/gpu/drm/v3d/v3d_debugfs.c             |  3 +-
 drivers/gpu/drm/vmwgfx/vmwgfx_gmrid_manager.c |  5 +-
 drivers/md/md-bitmap.c                        |  4 +-
 drivers/scsi/mpt3sas/mpt3sas_base.c           |  5 +-
 drivers/xen/xen-balloon.c                     | 11 ++-
 fs/ceph/addr.c                                |  2 +-
 fs/ceph/super.h                               |  3 +-
 fs/fs-writeback.c                             |  2 +-
 fs/nfs/write.c                                |  4 +-
 fs/nfsd/nfscache.c                            |  3 +-
 fs/proc/meminfo.c                             |  4 +-
 fs/proc/task_mmu.c                            |  3 +-
 include/linux/mm.h                            |  3 +
 include/trace/events/writeback.h              | 19 ++--
 kernel/debug/kdb/kdb_main.c                   |  3 +-
 kernel/events/core.c                          |  2 +-
 kernel/fork.c                                 |  2 +-
 mm/backing-dev.c                              | 22 +++--
 mm/hugetlb.c                                  |  2 +-
 mm/memcontrol.c                               | 18 ++--
 mm/mmap.c                                     |  6 +-
 mm/nommu.c                                    |  4 +-
 mm/oom_kill.c                                 | 16 ++--
 mm/page-writeback.c                           |  4 +-
 mm/page_alloc.c                               | 86 +++++++++----------
 mm/shmem.c                                    |  3 +-
 mm/swap_state.c                               |  5 +-
 mm/swapfile.c                                 | 11 ++-
 mm/util.c                                     |  6 +-
 37 files changed, 197 insertions(+), 204 deletions(-)
Signature · 1 line
2.33.0