2020-07-23 23:16:15

by Arvind Sankar

[permalink] [raw]
Subject: [PATCH 0/3] Drop unused MAX_PHYSADDR_BITS

This #define is not used anywhere, and has the wrong value on x86_64.

I tried digging into the history a bit, but it seems to have been unused
even in the initial merge of sparsemem in v2.6.13, when it was first
defined.

Arvind Sankar (3):
x86/mm: Drop unused MAX_PHYSADDR_BITS
sh/mm: Drop unused MAX_PHYSADDR_BITS
sparc: Drop unused MAX_PHYSADDR_BITS

arch/sh/include/asm/sparsemem.h | 4 +---
arch/sparc/include/asm/sparsemem.h | 1 -
arch/x86/include/asm/sparsemem.h | 6 +-----
3 files changed, 2 insertions(+), 9 deletions(-)

--
2.26.2


2020-07-23 23:16:22

by Arvind Sankar

[permalink] [raw]
Subject: [PATCH 2/3] sh/mm: Drop unused MAX_PHYSADDR_BITS

The macro is not used anywhere, so remove the definition.

Signed-off-by: Arvind Sankar <[email protected]>
---
arch/sh/include/asm/sparsemem.h | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/arch/sh/include/asm/sparsemem.h b/arch/sh/include/asm/sparsemem.h
index 4eb899751e45..084706bb8cca 100644
--- a/arch/sh/include/asm/sparsemem.h
+++ b/arch/sh/include/asm/sparsemem.h
@@ -5,11 +5,9 @@
#ifdef __KERNEL__
/*
* SECTION_SIZE_BITS 2^N: how big each section will be
- * MAX_PHYSADDR_BITS 2^N: how much physical address space we have
- * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space
+ * MAX_PHYSMEM_BITS 2^N: how much physical address space we have
*/
#define SECTION_SIZE_BITS 26
-#define MAX_PHYSADDR_BITS 32
#define MAX_PHYSMEM_BITS 32

#endif
--
2.26.2

2020-07-23 23:16:26

by Arvind Sankar

[permalink] [raw]
Subject: [PATCH 1/3] x86/mm: Drop unused MAX_PHYSADDR_BITS

The macro is not used anywhere, and has an incorrect value (going by the
comment) on x86_64 since commit
c898faf91b3e ("x86: 46 bit physical address support on 64 bits")

To avoid confusion, just remove the definition.

Signed-off-by: Arvind Sankar <[email protected]>
---
arch/x86/include/asm/sparsemem.h | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/sparsemem.h b/arch/x86/include/asm/sparsemem.h
index 199218719a86..6bfc878f6771 100644
--- a/arch/x86/include/asm/sparsemem.h
+++ b/arch/x86/include/asm/sparsemem.h
@@ -10,24 +10,20 @@
* field of the struct page
*
* SECTION_SIZE_BITS 2^n: size of each section
- * MAX_PHYSADDR_BITS 2^n: max size of physical address space
- * MAX_PHYSMEM_BITS 2^n: how much memory we can have in that space
+ * MAX_PHYSMEM_BITS 2^n: max size of physical address space
*
*/

#ifdef CONFIG_X86_32
# ifdef CONFIG_X86_PAE
# define SECTION_SIZE_BITS 29
-# define MAX_PHYSADDR_BITS 36
# define MAX_PHYSMEM_BITS 36
# else
# define SECTION_SIZE_BITS 26
-# define MAX_PHYSADDR_BITS 32
# define MAX_PHYSMEM_BITS 32
# endif
#else /* CONFIG_X86_32 */
# define SECTION_SIZE_BITS 27 /* matt - 128 is convenient right now */
-# define MAX_PHYSADDR_BITS (pgtable_l5_enabled() ? 52 : 44)
# define MAX_PHYSMEM_BITS (pgtable_l5_enabled() ? 52 : 46)
#endif

--
2.26.2

2020-07-23 23:18:22

by Arvind Sankar

[permalink] [raw]
Subject: [PATCH 3/3] sparc: Drop unused MAX_PHYSADDR_BITS

The macro is not used anywhere, so remove the definition.

Signed-off-by: Arvind Sankar <[email protected]>
---
arch/sparc/include/asm/sparsemem.h | 1 -
1 file changed, 1 deletion(-)

diff --git a/arch/sparc/include/asm/sparsemem.h b/arch/sparc/include/asm/sparsemem.h
index 1dd1b61432db..aa9a676bc341 100644
--- a/arch/sparc/include/asm/sparsemem.h
+++ b/arch/sparc/include/asm/sparsemem.h
@@ -7,7 +7,6 @@
#include <asm/page.h>

#define SECTION_SIZE_BITS 30
-#define MAX_PHYSADDR_BITS MAX_PHYS_ADDRESS_BITS
#define MAX_PHYSMEM_BITS MAX_PHYS_ADDRESS_BITS

#endif /* !(__KERNEL__) */
--
2.26.2

Subject: [tip: x86/cleanups] x86/mm: Drop unused MAX_PHYSADDR_BITS

The following commit has been merged into the x86/cleanups branch of tip:

Commit-ID: 0a787b28b7a375ad9d5c77bc3922ae1a8305239e
Gitweb: https://git.kernel.org/tip/0a787b28b7a375ad9d5c77bc3922ae1a8305239e
Author: Arvind Sankar <[email protected]>
AuthorDate: Thu, 23 Jul 2020 19:15:42 -04:00
Committer: Thomas Gleixner <[email protected]>
CommitterDate: Fri, 24 Jul 2020 09:53:06 +02:00

x86/mm: Drop unused MAX_PHYSADDR_BITS

The macro is not used anywhere, and has an incorrect value (going by the
comment) on x86_64 since commit c898faf91b3e ("x86: 46 bit physical address
support on 64 bits")

To avoid confusion, just remove the definition.

Signed-off-by: Arvind Sankar <[email protected]>
Signed-off-by: Thomas Gleixner <[email protected]>
Link: https://lkml.kernel.org/r/[email protected]

---
arch/x86/include/asm/sparsemem.h | 6 +-----
1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/arch/x86/include/asm/sparsemem.h b/arch/x86/include/asm/sparsemem.h
index 1992187..6bfc878 100644
--- a/arch/x86/include/asm/sparsemem.h
+++ b/arch/x86/include/asm/sparsemem.h
@@ -10,24 +10,20 @@
* field of the struct page
*
* SECTION_SIZE_BITS 2^n: size of each section
- * MAX_PHYSADDR_BITS 2^n: max size of physical address space
- * MAX_PHYSMEM_BITS 2^n: how much memory we can have in that space
+ * MAX_PHYSMEM_BITS 2^n: max size of physical address space
*
*/

#ifdef CONFIG_X86_32
# ifdef CONFIG_X86_PAE
# define SECTION_SIZE_BITS 29
-# define MAX_PHYSADDR_BITS 36
# define MAX_PHYSMEM_BITS 36
# else
# define SECTION_SIZE_BITS 26
-# define MAX_PHYSADDR_BITS 32
# define MAX_PHYSMEM_BITS 32
# endif
#else /* CONFIG_X86_32 */
# define SECTION_SIZE_BITS 27 /* matt - 128 is convenient right now */
-# define MAX_PHYSADDR_BITS (pgtable_l5_enabled() ? 52 : 44)
# define MAX_PHYSMEM_BITS (pgtable_l5_enabled() ? 52 : 46)
#endif

2020-07-24 08:23:22

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH 1/3] x86/mm: Drop unused MAX_PHYSADDR_BITS

On 24.07.20 01:15, Arvind Sankar wrote:
> The macro is not used anywhere, and has an incorrect value (going by the
> comment) on x86_64 since commit
> c898faf91b3e ("x86: 46 bit physical address support on 64 bits")
>
> To avoid confusion, just remove the definition.
>
> Signed-off-by: Arvind Sankar <[email protected]>
> ---
> arch/x86/include/asm/sparsemem.h | 6 +-----
> 1 file changed, 1 insertion(+), 5 deletions(-)
>
> diff --git a/arch/x86/include/asm/sparsemem.h b/arch/x86/include/asm/sparsemem.h
> index 199218719a86..6bfc878f6771 100644
> --- a/arch/x86/include/asm/sparsemem.h
> +++ b/arch/x86/include/asm/sparsemem.h
> @@ -10,24 +10,20 @@
> * field of the struct page
> *
> * SECTION_SIZE_BITS 2^n: size of each section
> - * MAX_PHYSADDR_BITS 2^n: max size of physical address space
> - * MAX_PHYSMEM_BITS 2^n: how much memory we can have in that space
> + * MAX_PHYSMEM_BITS 2^n: max size of physical address space
> *
> */
>
> #ifdef CONFIG_X86_32
> # ifdef CONFIG_X86_PAE
> # define SECTION_SIZE_BITS 29
> -# define MAX_PHYSADDR_BITS 36
> # define MAX_PHYSMEM_BITS 36
> # else
> # define SECTION_SIZE_BITS 26
> -# define MAX_PHYSADDR_BITS 32
> # define MAX_PHYSMEM_BITS 32
> # endif
> #else /* CONFIG_X86_32 */
> # define SECTION_SIZE_BITS 27 /* matt - 128 is convenient right now */
> -# define MAX_PHYSADDR_BITS (pgtable_l5_enabled() ? 52 : 44)
> # define MAX_PHYSMEM_BITS (pgtable_l5_enabled() ? 52 : 46)
> #endif
>
>

Reviewed-by: David Hildenbrand <[email protected]>

--
Thanks,

David / dhildenb

2020-07-24 08:23:26

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH 2/3] sh/mm: Drop unused MAX_PHYSADDR_BITS

On 24.07.20 01:15, Arvind Sankar wrote:
> The macro is not used anywhere, so remove the definition.
>
> Signed-off-by: Arvind Sankar <[email protected]>
> ---
> arch/sh/include/asm/sparsemem.h | 4 +---
> 1 file changed, 1 insertion(+), 3 deletions(-)
>
> diff --git a/arch/sh/include/asm/sparsemem.h b/arch/sh/include/asm/sparsemem.h
> index 4eb899751e45..084706bb8cca 100644
> --- a/arch/sh/include/asm/sparsemem.h
> +++ b/arch/sh/include/asm/sparsemem.h
> @@ -5,11 +5,9 @@
> #ifdef __KERNEL__
> /*
> * SECTION_SIZE_BITS 2^N: how big each section will be
> - * MAX_PHYSADDR_BITS 2^N: how much physical address space we have
> - * MAX_PHYSMEM_BITS 2^N: how much memory we can have in that space
> + * MAX_PHYSMEM_BITS 2^N: how much physical address space we have
> */
> #define SECTION_SIZE_BITS 26
> -#define MAX_PHYSADDR_BITS 32
> #define MAX_PHYSMEM_BITS 32
>
> #endif
>

Reviewed-by: David Hildenbrand <[email protected]>

--
Thanks,

David / dhildenb

2020-07-24 08:23:50

by David Hildenbrand

[permalink] [raw]
Subject: Re: [PATCH 3/3] sparc: Drop unused MAX_PHYSADDR_BITS

On 24.07.20 01:15, Arvind Sankar wrote:
> The macro is not used anywhere, so remove the definition.
>
> Signed-off-by: Arvind Sankar <[email protected]>
> ---
> arch/sparc/include/asm/sparsemem.h | 1 -
> 1 file changed, 1 deletion(-)
>
> diff --git a/arch/sparc/include/asm/sparsemem.h b/arch/sparc/include/asm/sparsemem.h
> index 1dd1b61432db..aa9a676bc341 100644
> --- a/arch/sparc/include/asm/sparsemem.h
> +++ b/arch/sparc/include/asm/sparsemem.h
> @@ -7,7 +7,6 @@
> #include <asm/page.h>
>
> #define SECTION_SIZE_BITS 30
> -#define MAX_PHYSADDR_BITS MAX_PHYS_ADDRESS_BITS
> #define MAX_PHYSMEM_BITS MAX_PHYS_ADDRESS_BITS
>
> #endif /* !(__KERNEL__) */
>

Reviewed-by: David Hildenbrand <[email protected]>

--
Thanks,

David / dhildenb

2020-07-24 15:08:03

by Dave Hansen

[permalink] [raw]
Subject: Re: [PATCH 0/3] Drop unused MAX_PHYSADDR_BITS

On 7/23/20 4:15 PM, Arvind Sankar wrote:
> This #define is not used anywhere, and has the wrong value on x86_64.

Yeah, it certainly is unused.

> I tried digging into the history a bit, but it seems to have been unused
> even in the initial merge of sparsemem in v2.6.13, when it was first
> defined.

Yep, I don't even remember why we thought we needed it back then. Feel
free to add my ack on these, or at least the x86 one.

2020-07-24 23:37:51

by David Miller

[permalink] [raw]
Subject: Re: [PATCH 3/3] sparc: Drop unused MAX_PHYSADDR_BITS

From: Arvind Sankar <[email protected]>
Date: Thu, 23 Jul 2020 19:15:44 -0400

> The macro is not used anywhere, so remove the definition.
>
> Signed-off-by: Arvind Sankar <[email protected]>

Acked-by: David S. Miller <[email protected]>

2020-07-26 06:49:44

by Mike Rapoport

[permalink] [raw]
Subject: Re: [PATCH 0/3] Drop unused MAX_PHYSADDR_BITS

On Thu, Jul 23, 2020 at 07:15:41PM -0400, Arvind Sankar wrote:
> This #define is not used anywhere, and has the wrong value on x86_64.
>
> I tried digging into the history a bit, but it seems to have been unused
> even in the initial merge of sparsemem in v2.6.13, when it was first
> defined.
>
> Arvind Sankar (3):
> x86/mm: Drop unused MAX_PHYSADDR_BITS
> sh/mm: Drop unused MAX_PHYSADDR_BITS
> sparc: Drop unused MAX_PHYSADDR_BITS

For the series

Acked-by: Mike Rapoport <[email protected]>


> arch/sh/include/asm/sparsemem.h | 4 +---
> arch/sparc/include/asm/sparsemem.h | 1 -
> arch/x86/include/asm/sparsemem.h | 6 +-----
> 3 files changed, 2 insertions(+), 9 deletions(-)
>
> --
> 2.26.2
>
>

--
Sincerely yours,
Mike.