Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1401338 > unrolled thread

Re: [PATCH] mm: unhide vmstat_text definition for CONFIG_SMP

Started byMichal Hocko <mhocko@kernel.org>
First post2016-05-16 09:40 +0200
Last post2016-05-16 16:00 +0200
Articles 2 — 2 participants

Back to article view | Back to linux.kernel

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

  Re: [PATCH] mm: unhide vmstat_text definition for CONFIG_SMP Michal Hocko <mhocko@kernel.org> - 2016-05-16 09:40 +0200
    Re: [PATCH] mm: unhide vmstat_text definition for CONFIG_SMP Christoph Lameter <cl@linux.com> - 2016-05-16 16:00 +0200

#1401338 — Re: [PATCH] mm: unhide vmstat_text definition for CONFIG_SMP

FromMichal Hocko <mhocko@kernel.org>
Date2016-05-16 09:40 +0200
SubjectRe: [PATCH] mm: unhide vmstat_text definition for CONFIG_SMP
Message-ID<rzli9-42X-1@gated-at.bofh.it>
On Wed 11-05-16 16:54:55, Arnd Bergmann wrote:
> In randconfig builds with sysfs, procfs and numa all disabled,
> but SMP enabled, we now get a link error in the newly introduced
> vmstat_refresh function:
> 
> mm/built-in.o: In function `vmstat_refresh':
> :(.text+0x15c78): undefined reference to `vmstat_text'
> 
> This modifes the already elaborate #ifdef to also cover that
> configuration.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> Fixes: mmotm ("mm: /proc/sys/vm/stat_refresh to force vmstat update")

I agree with Christoph that vmstat_refresh is PROC_FS only so we should
fix it there. It is not like this would be generally reusable helper...
Why don't we just do:
---
diff --git a/mm/vmstat.c b/mm/vmstat.c
index 57a24e919907..c759b526287b 100644
--- a/mm/vmstat.c
+++ b/mm/vmstat.c
@@ -1370,6 +1370,7 @@ static void refresh_vm_stats(struct work_struct *work)
 	refresh_cpu_vm_stats(true);
 }
 
+#ifdef CONFIG_PROC_FS
 int vmstat_refresh(struct ctl_table *table, int write,
 		   void __user *buffer, size_t *lenp, loff_t *ppos)
 {
@@ -1422,6 +1423,7 @@ int vmstat_refresh(struct ctl_table *table, int write,
 		*lenp = 0;
 	return 0;
 }
+#endif
 
 static void vmstat_update(struct work_struct *w)
 {
-- 
Michal Hocko
SUSE Labs

[toc] | [next] | [standalone]


#1401513

FromChristoph Lameter <cl@linux.com>
Date2016-05-16 16:00 +0200
Message-ID<rzrdU-7Kg-43@gated-at.bofh.it>
In reply to#1401338
On Mon, 16 May 2016, Michal Hocko wrote:

> I agree with Christoph that vmstat_refresh is PROC_FS only so we should
> fix it there. It is not like this would be generally reusable helper...
> Why don't we just do:

Looks good.

Acked-by: Christoph Lameter <cl@linux.com>

> ---
> diff --git a/mm/vmstat.c b/mm/vmstat.c
> index 57a24e919907..c759b526287b 100644
> --- a/mm/vmstat.c
> +++ b/mm/vmstat.c
> @@ -1370,6 +1370,7 @@ static void refresh_vm_stats(struct work_struct *work)
>  	refresh_cpu_vm_stats(true);
>  }
>
> +#ifdef CONFIG_PROC_FS
>  int vmstat_refresh(struct ctl_table *table, int write,
>  		   void __user *buffer, size_t *lenp, loff_t *ppos)
>  {
> @@ -1422,6 +1423,7 @@ int vmstat_refresh(struct ctl_table *table, int write,
>  		*lenp = 0;
>  	return 0;
>  }
> +#endif
>
>  static void vmstat_update(struct work_struct *w)
>  {
>

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web