* [PATCH] procfs: consolidate arch_report_meminfo declaration
@ 2023-05-16 19:57 Arnd Bergmann
2023-05-16 20:46 ` Dave Hansen
` (3 more replies)
0 siblings, 4 replies; 5+ messages in thread
From: Arnd Bergmann @ 2023-05-16 19:57 UTC (permalink / raw)
To: viro, brauner
Cc: Dave Hansen, James E.J. Bottomley, H. Peter Anvin,
Alexander Gordeev, linux-s390, Arnd Bergmann, Helge Deller, x86,
Ingo Molnar, Gerald Schaefer, Christian Borntraeger,
Vasily Gorbik, Heiko Carstens, Nicholas Piggin, Borislav Petkov,
Thomas Gleixner, linux-parisc, linux-kernel, Sven Schnelle,
linux-fsdevel, linuxppc-dev
From: Arnd Bergmann <arnd@arndb.de>
The arch_report_meminfo() function is provided by four architectures,
with a __weak fallback in procfs itself. On architectures that don't
have a custom version, the __weak version causes a warning because
of the missing prototype.
Remove the architecture specific prototypes and instead add one
in linux/proc_fs.h.
Signed-off-by: Arnd Bergmann <arnd@arndb.de>
---
arch/parisc/include/asm/pgtable.h | 3 ---
arch/powerpc/include/asm/pgtable.h | 3 ---
arch/s390/include/asm/pgtable.h | 3 ---
arch/s390/mm/pageattr.c | 1 +
arch/x86/include/asm/pgtable.h | 1 +
arch/x86/include/asm/pgtable_types.h | 3 ---
arch/x86/mm/pat/set_memory.c | 1 +
include/linux/proc_fs.h | 2 ++
8 files changed, 5 insertions(+), 12 deletions(-)
diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h
index e715df5385d6..5656395c95ee 100644
--- a/arch/parisc/include/asm/pgtable.h
+++ b/arch/parisc/include/asm/pgtable.h
@@ -472,9 +472,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
#define pte_same(A,B) (pte_val(A) == pte_val(B))
-struct seq_file;
-extern void arch_report_meminfo(struct seq_file *m);
-
#endif /* !__ASSEMBLY__ */
diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
index 9972626ddaf6..6a88bfdaa69b 100644
--- a/arch/powerpc/include/asm/pgtable.h
+++ b/arch/powerpc/include/asm/pgtable.h
@@ -165,9 +165,6 @@ static inline bool is_ioremap_addr(const void *x)
return addr >= IOREMAP_BASE && addr < IOREMAP_END;
}
-
-struct seq_file;
-void arch_report_meminfo(struct seq_file *m);
#endif /* CONFIG_PPC64 */
#endif /* __ASSEMBLY__ */
diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
index 6822a11c2c8a..c55f3c3365af 100644
--- a/arch/s390/include/asm/pgtable.h
+++ b/arch/s390/include/asm/pgtable.h
@@ -42,9 +42,6 @@ static inline void update_page_count(int level, long count)
atomic_long_add(count, &direct_pages_count[level]);
}
-struct seq_file;
-void arch_report_meminfo(struct seq_file *m);
-
/*
* The S390 doesn't have any external MMU info: the kernel page
* tables contain all the necessary information.
diff --git a/arch/s390/mm/pageattr.c b/arch/s390/mm/pageattr.c
index 5ba3bd8a7b12..ca5a418c58a8 100644
--- a/arch/s390/mm/pageattr.c
+++ b/arch/s390/mm/pageattr.c
@@ -4,6 +4,7 @@
* Author(s): Jan Glauber <jang@linux.vnet.ibm.com>
*/
#include <linux/hugetlb.h>
+#include <linux/proc_fs.h>
#include <linux/vmalloc.h>
#include <linux/mm.h>
#include <asm/cacheflush.h>
diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
index 15ae4d6ba476..5700bb337987 100644
--- a/arch/x86/include/asm/pgtable.h
+++ b/arch/x86/include/asm/pgtable.h
@@ -27,6 +27,7 @@
extern pgd_t early_top_pgt[PTRS_PER_PGD];
bool __init __early_make_pgtable(unsigned long address, pmdval_t pmd);
+struct seq_file;
void ptdump_walk_pgd_level(struct seq_file *m, struct mm_struct *mm);
void ptdump_walk_pgd_level_debugfs(struct seq_file *m, struct mm_struct *mm,
bool user);
diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
index 447d4bee25c4..ba3e2554799a 100644
--- a/arch/x86/include/asm/pgtable_types.h
+++ b/arch/x86/include/asm/pgtable_types.h
@@ -513,9 +513,6 @@ extern void native_pagetable_init(void);
#define native_pagetable_init paging_init
#endif
-struct seq_file;
-extern void arch_report_meminfo(struct seq_file *m);
-
enum pg_level {
PG_LEVEL_NONE,
PG_LEVEL_4K,
diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c
index 7159cf787613..d1515756e369 100644
--- a/arch/x86/mm/pat/set_memory.c
+++ b/arch/x86/mm/pat/set_memory.c
@@ -9,6 +9,7 @@
#include <linux/mm.h>
#include <linux/interrupt.h>
#include <linux/seq_file.h>
+#include <linux/proc_fs.h>
#include <linux/debugfs.h>
#include <linux/pfn.h>
#include <linux/percpu.h>
diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
index 0260f5ea98fe..e981ef830252 100644
--- a/include/linux/proc_fs.h
+++ b/include/linux/proc_fs.h
@@ -158,6 +158,8 @@ int proc_pid_arch_status(struct seq_file *m, struct pid_namespace *ns,
struct pid *pid, struct task_struct *task);
#endif /* CONFIG_PROC_PID_ARCH_STATUS */
+extern void arch_report_meminfo(struct seq_file *m);
+
#else /* CONFIG_PROC_FS */
static inline void proc_root_init(void)
--
2.39.2
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] procfs: consolidate arch_report_meminfo declaration
2023-05-16 19:57 [PATCH] procfs: consolidate arch_report_meminfo declaration Arnd Bergmann
@ 2023-05-16 20:46 ` Dave Hansen
2023-05-17 7:26 ` Christian Brauner
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Dave Hansen @ 2023-05-16 20:46 UTC (permalink / raw)
To: Arnd Bergmann, viro, brauner
Cc: Dave Hansen, James E.J. Bottomley, H. Peter Anvin,
Alexander Gordeev, linux-s390, Arnd Bergmann, Helge Deller, x86,
Ingo Molnar, Gerald Schaefer, Christian Borntraeger,
Vasily Gorbik, Heiko Carstens, Nicholas Piggin, Borislav Petkov,
Thomas Gleixner, linux-parisc, linux-kernel, Sven Schnelle,
linux-fsdevel, linuxppc-dev
On 5/16/23 12:57, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The arch_report_meminfo() function is provided by four architectures,
> with a __weak fallback in procfs itself. On architectures that don't
> have a custom version, the __weak version causes a warning because
> of the missing prototype.
>
> Remove the architecture specific prototypes and instead add one
> in linux/proc_fs.h.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> arch/parisc/include/asm/pgtable.h | 3 ---
> arch/powerpc/include/asm/pgtable.h | 3 ---
> arch/s390/include/asm/pgtable.h | 3 ---
> arch/s390/mm/pageattr.c | 1 +
> arch/x86/include/asm/pgtable.h | 1 +
> arch/x86/include/asm/pgtable_types.h | 3 ---
Looks sane. Thanks Arnd!
Acked-by: Dave Hansen <dave.hansen@linux.intel.com> # for arch/x86
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] procfs: consolidate arch_report_meminfo declaration
2023-05-16 19:57 [PATCH] procfs: consolidate arch_report_meminfo declaration Arnd Bergmann
2023-05-16 20:46 ` Dave Hansen
@ 2023-05-17 7:26 ` Christian Brauner
2023-05-17 13:15 ` Alexander Gordeev
2023-05-17 13:30 ` Helge Deller
3 siblings, 0 replies; 5+ messages in thread
From: Christian Brauner @ 2023-05-17 7:26 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Dave Hansen, James E.J. Bottomley, H. Peter Anvin,
Alexander Gordeev, linux-s390, Arnd Bergmann, Helge Deller, x86,
Ingo Molnar, Gerald Schaefer, Christian Borntraeger,
Vasily Gorbik, Heiko Carstens, Nicholas Piggin, Borislav Petkov,
viro, Thomas Gleixner, Christian Brauner, linux-parisc,
linux-kernel, Sven Schnelle, linux-fsdevel, linuxppc-dev
On Tue, 16 May 2023 21:57:29 +0200, Arnd Bergmann wrote:
> The arch_report_meminfo() function is provided by four architectures,
> with a __weak fallback in procfs itself. On architectures that don't
> have a custom version, the __weak version causes a warning because
> of the missing prototype.
>
> Remove the architecture specific prototypes and instead add one
> in linux/proc_fs.h.
>
> [...]
Applied to the vfs.misc branch of the vfs/vfs.git tree.
Patches in the vfs.misc branch should appear in linux-next soon.
Please report any outstanding bugs that were missed during review in a
new review to the original patch series allowing us to drop it.
It's encouraged to provide Acked-bys and Reviewed-bys even though the
patch has now been applied. If possible patch trailers will be updated.
tree: https://git.kernel.org/pub/scm/linux/kernel/git/vfs/vfs.git
branch: vfs.misc
[1/1] procfs: consolidate arch_report_meminfo declaration
https://git.kernel.org/vfs/vfs/c/edb0469aa6e8
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] procfs: consolidate arch_report_meminfo declaration
2023-05-16 19:57 [PATCH] procfs: consolidate arch_report_meminfo declaration Arnd Bergmann
2023-05-16 20:46 ` Dave Hansen
2023-05-17 7:26 ` Christian Brauner
@ 2023-05-17 13:15 ` Alexander Gordeev
2023-05-17 13:30 ` Helge Deller
3 siblings, 0 replies; 5+ messages in thread
From: Alexander Gordeev @ 2023-05-17 13:15 UTC (permalink / raw)
To: Arnd Bergmann
Cc: Dave Hansen, James E.J. Bottomley, H. Peter Anvin, linux-s390,
Arnd Bergmann, Helge Deller, x86, Ingo Molnar, Gerald Schaefer,
Christian Borntraeger, Vasily Gorbik, Heiko Carstens,
Nicholas Piggin, Borislav Petkov, viro, Thomas Gleixner, brauner,
linux-parisc, linux-kernel, Sven Schnelle, linux-fsdevel,
linuxppc-dev
On Tue, May 16, 2023 at 09:57:29PM +0200, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The arch_report_meminfo() function is provided by four architectures,
> with a __weak fallback in procfs itself. On architectures that don't
> have a custom version, the __weak version causes a warning because
> of the missing prototype.
>
> Remove the architecture specific prototypes and instead add one
> in linux/proc_fs.h.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> arch/parisc/include/asm/pgtable.h | 3 ---
> arch/powerpc/include/asm/pgtable.h | 3 ---
> arch/s390/include/asm/pgtable.h | 3 ---
> arch/s390/mm/pageattr.c | 1 +
> arch/x86/include/asm/pgtable.h | 1 +
> arch/x86/include/asm/pgtable_types.h | 3 ---
> arch/x86/mm/pat/set_memory.c | 1 +
> include/linux/proc_fs.h | 2 ++
> 8 files changed, 5 insertions(+), 12 deletions(-)
...
> diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
> index 6822a11c2c8a..c55f3c3365af 100644
> --- a/arch/s390/include/asm/pgtable.h
> +++ b/arch/s390/include/asm/pgtable.h
> @@ -42,9 +42,6 @@ static inline void update_page_count(int level, long count)
> atomic_long_add(count, &direct_pages_count[level]);
> }
>
> -struct seq_file;
> -void arch_report_meminfo(struct seq_file *m);
> -
> /*
> * The S390 doesn't have any external MMU info: the kernel page
> * tables contain all the necessary information.
> diff --git a/arch/s390/mm/pageattr.c b/arch/s390/mm/pageattr.c
> index 5ba3bd8a7b12..ca5a418c58a8 100644
> --- a/arch/s390/mm/pageattr.c
> +++ b/arch/s390/mm/pageattr.c
> @@ -4,6 +4,7 @@
> * Author(s): Jan Glauber <jang@linux.vnet.ibm.com>
> */
> #include <linux/hugetlb.h>
> +#include <linux/proc_fs.h>
> #include <linux/vmalloc.h>
> #include <linux/mm.h>
> #include <asm/cacheflush.h>
For s390:
Reviewed-by: Alexander Gordeev <agordeev@linux.ibm.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] procfs: consolidate arch_report_meminfo declaration
2023-05-16 19:57 [PATCH] procfs: consolidate arch_report_meminfo declaration Arnd Bergmann
` (2 preceding siblings ...)
2023-05-17 13:15 ` Alexander Gordeev
@ 2023-05-17 13:30 ` Helge Deller
3 siblings, 0 replies; 5+ messages in thread
From: Helge Deller @ 2023-05-17 13:30 UTC (permalink / raw)
To: Arnd Bergmann, viro, brauner
Cc: Dave Hansen, James E.J. Bottomley, H. Peter Anvin,
Alexander Gordeev, linux-s390, Arnd Bergmann, x86, Ingo Molnar,
Gerald Schaefer, Christian Borntraeger, Vasily Gorbik,
Heiko Carstens, Nicholas Piggin, Borislav Petkov, Thomas Gleixner,
linux-parisc, linux-kernel, Sven Schnelle, linux-fsdevel,
linuxppc-dev
On 5/16/23 21:57, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> The arch_report_meminfo() function is provided by four architectures,
> with a __weak fallback in procfs itself. On architectures that don't
> have a custom version, the __weak version causes a warning because
> of the missing prototype.
>
> Remove the architecture specific prototypes and instead add one
> in linux/proc_fs.h.
>
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
> arch/parisc/include/asm/pgtable.h | 3 ---
Acked-by: Helge Deller <deller@gmx.de> # parisc
Thanks!
Helge
> arch/powerpc/include/asm/pgtable.h | 3 ---
> arch/s390/include/asm/pgtable.h | 3 ---
> arch/s390/mm/pageattr.c | 1 +
> arch/x86/include/asm/pgtable.h | 1 +
> arch/x86/include/asm/pgtable_types.h | 3 ---
> arch/x86/mm/pat/set_memory.c | 1 +
> include/linux/proc_fs.h | 2 ++
> 8 files changed, 5 insertions(+), 12 deletions(-)
>
> diff --git a/arch/parisc/include/asm/pgtable.h b/arch/parisc/include/asm/pgtable.h
> index e715df5385d6..5656395c95ee 100644
> --- a/arch/parisc/include/asm/pgtable.h
> +++ b/arch/parisc/include/asm/pgtable.h
> @@ -472,9 +472,6 @@ static inline void ptep_set_wrprotect(struct mm_struct *mm, unsigned long addr,
>
> #define pte_same(A,B) (pte_val(A) == pte_val(B))
>
> -struct seq_file;
> -extern void arch_report_meminfo(struct seq_file *m);
> -
> #endif /* !__ASSEMBLY__ */
>
>
> diff --git a/arch/powerpc/include/asm/pgtable.h b/arch/powerpc/include/asm/pgtable.h
> index 9972626ddaf6..6a88bfdaa69b 100644
> --- a/arch/powerpc/include/asm/pgtable.h
> +++ b/arch/powerpc/include/asm/pgtable.h
> @@ -165,9 +165,6 @@ static inline bool is_ioremap_addr(const void *x)
>
> return addr >= IOREMAP_BASE && addr < IOREMAP_END;
> }
> -
> -struct seq_file;
> -void arch_report_meminfo(struct seq_file *m);
> #endif /* CONFIG_PPC64 */
>
> #endif /* __ASSEMBLY__ */
> diff --git a/arch/s390/include/asm/pgtable.h b/arch/s390/include/asm/pgtable.h
> index 6822a11c2c8a..c55f3c3365af 100644
> --- a/arch/s390/include/asm/pgtable.h
> +++ b/arch/s390/include/asm/pgtable.h
> @@ -42,9 +42,6 @@ static inline void update_page_count(int level, long count)
> atomic_long_add(count, &direct_pages_count[level]);
> }
>
> -struct seq_file;
> -void arch_report_meminfo(struct seq_file *m);
> -
> /*
> * The S390 doesn't have any external MMU info: the kernel page
> * tables contain all the necessary information.
> diff --git a/arch/s390/mm/pageattr.c b/arch/s390/mm/pageattr.c
> index 5ba3bd8a7b12..ca5a418c58a8 100644
> --- a/arch/s390/mm/pageattr.c
> +++ b/arch/s390/mm/pageattr.c
> @@ -4,6 +4,7 @@
> * Author(s): Jan Glauber <jang@linux.vnet.ibm.com>
> */
> #include <linux/hugetlb.h>
> +#include <linux/proc_fs.h>
> #include <linux/vmalloc.h>
> #include <linux/mm.h>
> #include <asm/cacheflush.h>
> diff --git a/arch/x86/include/asm/pgtable.h b/arch/x86/include/asm/pgtable.h
> index 15ae4d6ba476..5700bb337987 100644
> --- a/arch/x86/include/asm/pgtable.h
> +++ b/arch/x86/include/asm/pgtable.h
> @@ -27,6 +27,7 @@
> extern pgd_t early_top_pgt[PTRS_PER_PGD];
> bool __init __early_make_pgtable(unsigned long address, pmdval_t pmd);
>
> +struct seq_file;
> void ptdump_walk_pgd_level(struct seq_file *m, struct mm_struct *mm);
> void ptdump_walk_pgd_level_debugfs(struct seq_file *m, struct mm_struct *mm,
> bool user);
> diff --git a/arch/x86/include/asm/pgtable_types.h b/arch/x86/include/asm/pgtable_types.h
> index 447d4bee25c4..ba3e2554799a 100644
> --- a/arch/x86/include/asm/pgtable_types.h
> +++ b/arch/x86/include/asm/pgtable_types.h
> @@ -513,9 +513,6 @@ extern void native_pagetable_init(void);
> #define native_pagetable_init paging_init
> #endif
>
> -struct seq_file;
> -extern void arch_report_meminfo(struct seq_file *m);
> -
> enum pg_level {
> PG_LEVEL_NONE,
> PG_LEVEL_4K,
> diff --git a/arch/x86/mm/pat/set_memory.c b/arch/x86/mm/pat/set_memory.c
> index 7159cf787613..d1515756e369 100644
> --- a/arch/x86/mm/pat/set_memory.c
> +++ b/arch/x86/mm/pat/set_memory.c
> @@ -9,6 +9,7 @@
> #include <linux/mm.h>
> #include <linux/interrupt.h>
> #include <linux/seq_file.h>
> +#include <linux/proc_fs.h>
> #include <linux/debugfs.h>
> #include <linux/pfn.h>
> #include <linux/percpu.h>
> diff --git a/include/linux/proc_fs.h b/include/linux/proc_fs.h
> index 0260f5ea98fe..e981ef830252 100644
> --- a/include/linux/proc_fs.h
> +++ b/include/linux/proc_fs.h
> @@ -158,6 +158,8 @@ int proc_pid_arch_status(struct seq_file *m, struct pid_namespace *ns,
> struct pid *pid, struct task_struct *task);
> #endif /* CONFIG_PROC_PID_ARCH_STATUS */
>
> +extern void arch_report_meminfo(struct seq_file *m);
> +
> #else /* CONFIG_PROC_FS */
>
> static inline void proc_root_init(void)
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2023-05-17 13:32 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-16 19:57 [PATCH] procfs: consolidate arch_report_meminfo declaration Arnd Bergmann
2023-05-16 20:46 ` Dave Hansen
2023-05-17 7:26 ` Christian Brauner
2023-05-17 13:15 ` Alexander Gordeev
2023-05-17 13:30 ` Helge Deller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox