mbox series

[0/3] Make PMD_ORDER generically available

Message ID 20210715134612.809280-1-willy@infradead.org (mailing list archive)
Headers show
Series Make PMD_ORDER generically available | expand

Message

Matthew Wilcox July 15, 2021, 1:46 p.m. UTC
These three architectures each define PMD_ORDER to mean "the order of
an allocation for a PMD table", but logically PMD_ORDER should be the
order of a PMD allocation, ie (PMD_SHIFT - PAGE_SHIFT) as DAX defines it.

Could each architecture maintainer please apply the appropriate patch
to their respective trees?

Matthew Wilcox (Oracle) (3):
  arm: Rename PMD_ORDER to PMD_TABLE_ORDER
  mips: Rename PMD_ORDER to PMD_TABLE_ORDER
  parisc: Rename PMD_ORDER to PMD_TABLE_ORDER

 arch/arm/kernel/head.S             | 34 +++++++++++++++---------------
 arch/mips/include/asm/pgalloc.h    |  2 +-
 arch/mips/include/asm/pgtable-32.h |  2 +-
 arch/mips/include/asm/pgtable-64.h | 18 ++++++++--------
 arch/mips/kernel/asm-offsets.c     |  2 +-
 arch/parisc/include/asm/pgalloc.h  |  6 +++---
 arch/parisc/include/asm/pgtable.h  |  4 ++--
 arch/parisc/mm/init.c              |  4 ++--
 8 files changed, 36 insertions(+), 36 deletions(-)

Comments

Helge Deller July 15, 2021, 4:28 p.m. UTC | #1
On 7/15/21 3:46 PM, Matthew Wilcox (Oracle) wrote:
> These three architectures each define PMD_ORDER to mean "the order of
> an allocation for a PMD table", but logically PMD_ORDER should be the
> order of a PMD allocation, ie (PMD_SHIFT - PAGE_SHIFT) as DAX defines it.

Some architectures do have PGD_ORDER, PUD_ORDER and PTE_ORDER as well.
If you rename PMD_ORDER, IMHO the others should be renamed too.

Why not simply rename "PMD_ORDER" in fs/dax.c to e.g.
#define DAX_PMD_SHIFT   (PMD_SHIFT - PAGE_SHIFT)
and use that inside the dax filesystem code?

Helge

> Could each architecture maintainer please apply the appropriate patch
> to their respective trees?
>
> Matthew Wilcox (Oracle) (3):
>    arm: Rename PMD_ORDER to PMD_TABLE_ORDER
>    mips: Rename PMD_ORDER to PMD_TABLE_ORDER
>    parisc: Rename PMD_ORDER to PMD_TABLE_ORDER
>
>   arch/arm/kernel/head.S             | 34 +++++++++++++++---------------
>   arch/mips/include/asm/pgalloc.h    |  2 +-
>   arch/mips/include/asm/pgtable-32.h |  2 +-
>   arch/mips/include/asm/pgtable-64.h | 18 ++++++++--------
>   arch/mips/kernel/asm-offsets.c     |  2 +-
>   arch/parisc/include/asm/pgalloc.h  |  6 +++---
>   arch/parisc/include/asm/pgtable.h  |  4 ++--
>   arch/parisc/mm/init.c              |  4 ++--
>   8 files changed, 36 insertions(+), 36 deletions(-)
>
Matthew Wilcox July 15, 2021, 4:38 p.m. UTC | #2
On Thu, Jul 15, 2021 at 06:28:42PM +0200, Helge Deller wrote:
> On 7/15/21 3:46 PM, Matthew Wilcox (Oracle) wrote:
> > These three architectures each define PMD_ORDER to mean "the order of
> > an allocation for a PMD table", but logically PMD_ORDER should be the
> > order of a PMD allocation, ie (PMD_SHIFT - PAGE_SHIFT) as DAX defines it.
> 
> Some architectures do have PGD_ORDER, PUD_ORDER and PTE_ORDER as well.
> If you rename PMD_ORDER, IMHO the others should be renamed too.
> 
> Why not simply rename "PMD_ORDER" in fs/dax.c to e.g.
> #define DAX_PMD_SHIFT   (PMD_SHIFT - PAGE_SHIFT)
> and use that inside the dax filesystem code?

Because that's wrong.  PMD order is clearly the order of a PMD page,
not the order of a PMD table.

I'm sure the others should also be renamed, but this is the one which
is causing me pain today.