linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Hugh Dickins <hughd@google.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Michal Hocko <mhocko@kernel.org>, Arnd Bergmann <arnd@arndb.de>,
	Hugh Dickins <hughd@google.com>, Vlastimil Babka <vbabka@suse.cz>,
	Christoph Lameter <cl@linux.com>,
	Mel Gorman <mgorman@techsingularity.net>,
	Joonsoo Kim <iamjoonsoo.kim@lge.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mm: unhide vmstat_text definition for CONFIG_SMP
Date: Tue, 17 May 2016 18:02:01 -0700 (PDT)	[thread overview]
Message-ID: <alpine.LSU.2.11.1605171750010.24624@eggly.anvils> (raw)
In-Reply-To: <20160517070555.GA14453@dhcp22.suse.cz>

On Tue, 17 May 2016, Michal Hocko wrote:
> On Mon 16-05-16 15:36:56, Andrew Morton wrote:
> > On Mon, 16 May 2016 16:23:33 +0200 Michal Hocko <mhocko@kernel.org> wrote:
> > 
> > > Andrew, I think that the following is more straightforward fix and
> > > should be folded in to the patch which has introduced vmstat_refresh.
> > > ---
> > > >From b8dd18fb7df040e1bfe61aadde1d903589de15e4 Mon Sep 17 00:00:00 2001
> > > From: Michal Hocko <mhocko@suse.com>
> > > Date: Mon, 16 May 2016 16:19:53 +0200
> > > Subject: [PATCH] mmotm: mm-proc-sys-vm-stat_refresh-to-force-vmstat-update-fix
> > > 
> > > Arnd has reported:
> > > 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'
> > > 
> > > vmstat_refresh is proc_fs specific so there is no reason to define it
> > > when !CONFIG_PROC_FS.
> > 
> > I already had this:
> > 
> > From: Christoph Lameter <cl@linux.com>
> > Subject: Do not build vmstat_refresh if there is no procfs support
> > 
> > It makes no sense to build functionality into the kernel that
> > cannot be used and causes build issues.
> > 
> > Link: http://lkml.kernel.org/r/alpine.DEB.2.20.1605111011260.9351@east.gentwo.org
> > Signed-off-by: Christoph Lameter <cl@linux.com>
> > Reported-by: Arnd Bergmann <arnd@arndb.de>
> > Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
> 
> But this is broken:
> http://lkml.kernel.org/r/20160516073144.GA23146@dhcp22.suse.cz and
> kbuild robot agrees
> http://lkml.kernel.org/r/201605171333.ANqJcwpy%fengguang.wu@intel.com

Sorry for my noise, sorry for my silence, thanks to Arnd and everyone
for chipping in.  But now I try it, I find that even Michal's is not
quite right: if you build without CONFIG_PROC_FS, then it gives you
mm/vmstat.c:1381:13: warning: `refresh_vm_stats' defined but not used [-Wunused-function]
(well, that was on a tree with different line numbering).
So here's my attempt...

Signed-off-by: Hugh Dickins <hughd@google.com>
---
Fix to merge into mm-proc-sys-vm-stat_refresh-to-force-vmstat-update.patch

 mm/vmstat.c |    2 ++
 1 file changed, 2 insertions(+)

--- 4.6-rc7-mm1/mm/vmstat.c	2016-05-14 08:29:10.609386264 -0700
+++ linux/mm/vmstat.c	2016-05-17 17:43:02.861862648 -0700
@@ -1365,6 +1365,7 @@ static struct workqueue_struct *vmstat_w
 static DEFINE_PER_CPU(struct delayed_work, vmstat_work);
 int sysctl_stat_interval __read_mostly = HZ;
 
+#ifdef CONFIG_PROC_FS
 static void refresh_vm_stats(struct work_struct *work)
 {
 	refresh_cpu_vm_stats(true);
@@ -1422,6 +1423,7 @@ int vmstat_refresh(struct ctl_table *tab
 		*lenp = 0;
 	return 0;
 }
+#endif /* CONFIG_PROC_FS */
 
 static void vmstat_update(struct work_struct *w)
 {

      reply	other threads:[~2016-05-18  1:02 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-11 14:54 [PATCH] mm: unhide vmstat_text definition for CONFIG_SMP Arnd Bergmann
2016-05-11 15:32 ` Christoph Lameter
2016-05-16  7:31   ` Michal Hocko
2016-05-17  5:31   ` Do not build vmstat_refresh if there is no procfs support kbuild test robot
2016-05-16  7:37 ` [PATCH] mm: unhide vmstat_text definition for CONFIG_SMP Michal Hocko
2016-05-16 13:54   ` Christoph Lameter
2016-05-16 14:23 ` Michal Hocko
2016-05-16 22:36   ` Andrew Morton
2016-05-17  7:05     ` Michal Hocko
2016-05-18  1:02       ` Hugh Dickins [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=alpine.LSU.2.11.1605171750010.24624@eggly.anvils \
    --to=hughd@google.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=cl@linux.com \
    --cc=iamjoonsoo.kim@lge.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@techsingularity.net \
    --cc=mhocko@kernel.org \
    --cc=vbabka@suse.cz \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).