From: Christoph Lameter <cl@linux.com>
To: akpm@linux-foundation.org
Cc: Michal Hocko <mhocko@kernel.org>, Tejun Heo <htejun@gmail.com>,
Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
torvalds@linux-foundation.org, hannes@cmpxchg.org,
mgorman@suse.de
Subject: [patch 3/3] vmstat: Create our own workqueue
Date: Tue, 27 Oct 2015 21:41:17 -0500 [thread overview]
Message-ID: <20151028024131.719968999@linux.com> (raw)
In-Reply-To: 20151028024114.370693277@linux.com
[-- Attachment #1: vmstat_add_workqueue --]
[-- Type: text/plain, Size: 1997 bytes --]
Seems that vmstat needs its own workqueue now since the general
workqueue mechanism has been *enhanced* which means that the
vmstat_updates cannot run reliably but are being blocked by
work requests doing memory allocation. Which causes vmstat
to be unable to keep the counters up to date.
Bad. Fix this by creating our own workqueue.
Signed-off-by: Christoph Lameter <cl@linux.com>
Index: linux/mm/vmstat.c
===================================================================
--- linux.orig/mm/vmstat.c
+++ linux/mm/vmstat.c
@@ -1359,6 +1359,8 @@ static const struct file_operations proc
#endif /* CONFIG_PROC_FS */
#ifdef CONFIG_SMP
+static struct workqueue_struct *vmstat_wq;
+
static DEFINE_PER_CPU(struct delayed_work, vmstat_work);
int sysctl_stat_interval __read_mostly = HZ;
static cpumask_var_t cpu_stat_off;
@@ -1371,7 +1373,7 @@ static void vmstat_update(struct work_st
* to occur in the future. Keep on running the
* update worker thread.
*/
- schedule_delayed_work_on(smp_processor_id(),
+ queue_delayed_work_on(smp_processor_id(), vmstat_wq,
this_cpu_ptr(&vmstat_work),
round_jiffies_relative(sysctl_stat_interval));
} else {
@@ -1454,7 +1456,7 @@ static void vmstat_shepherd(struct work_
if (need_update(cpu) &&
cpumask_test_and_clear_cpu(cpu, cpu_stat_off))
- schedule_delayed_work_on(cpu,
+ queue_delayed_work_on(cpu, vmstat_wq,
&per_cpu(vmstat_work, cpu), 0);
put_online_cpus();
@@ -1543,6 +1545,10 @@ static int __init setup_vmstat(void)
start_shepherd_timer();
cpu_notifier_register_done();
+ vmstat_wq = alloc_workqueue("vmstat",
+ WQ_FREEZABLE|
+ WQ_SYSFS|
+ WQ_MEM_RECLAIM, 0);
#endif
#ifdef CONFIG_PROC_FS
proc_create("buddyinfo", S_IRUGO, NULL, &fragmentation_file_operations);
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2015-10-28 2:41 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-28 2:41 [patch 0/3] vmstat: Various enhancements Christoph Lameter
2015-10-28 2:41 ` [patch 1/3] vmstat: Make pageset processing optional in refresh_cpu_vm_stats Christoph Lameter
2015-10-28 2:41 ` [patch 2/3] vmstat: make vmstat_updater deferrable again and shut down on idle Christoph Lameter
2015-10-28 2:41 ` Christoph Lameter [this message]
2015-10-28 2:43 ` [patch 3/3] vmstat: Create our own workqueue Tejun Heo
2015-10-28 3:04 ` Christoph Lameter
2015-10-28 11:57 ` Tetsuo Handa
2015-10-28 22:32 ` Christoph Lameter
2015-10-29 2:24 ` Tejun Heo
2015-10-29 3:08 ` Tejun Heo
2015-10-30 1:01 ` Christoph Lameter
2015-10-31 1:15 ` Tejun Heo
2015-10-31 2:43 ` Tetsuo Handa
2015-11-02 16:12 ` Christoph Lameter
2015-11-02 16:52 ` Tetsuo Handa
2015-11-02 18:10 ` Christoph Lameter
2015-11-02 19:11 ` Tejun Heo
2015-11-06 11:28 ` Tetsuo Handa
2015-11-06 12:56 ` Christoph Lameter
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=20151028024131.719968999@linux.com \
--to=cl@linux.com \
--cc=akpm@linux-foundation.org \
--cc=hannes@cmpxchg.org \
--cc=htejun@gmail.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mgorman@suse.de \
--cc=mhocko@kernel.org \
--cc=penguin-kernel@I-love.SAKURA.ne.jp \
--cc=torvalds@linux-foundation.org \
/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).