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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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/9161665.bUqNH3lxUD@xxxxxxxxxxxxxx/
[2] https://lore.kernel.org/lkml/20210901092149.994791-1-oleksandr@xxxxxxxxxxxxxx/

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(-)

-- 
2.33.0





[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux