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


Groups > linux.kernel > #1253076

Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable() checks

From Christoph Lameter <cl@linux.com>
Newsgroups linux.kernel
Subject Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable() checks
Date 2015-10-21 19:20 +0200
Message-ID <qm5dn-1aW-9@gated-at.bofh.it> (permalink)
References <qm0GK-2RY-1@gated-at.bofh.it> <qm2yU-5Ck-51@gated-at.bofh.it> <qm2Iy-5OI-15@gated-at.bofh.it> <qm2Se-606-31@gated-at.bofh.it> <qm31U-6dh-27@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Wed, 21 Oct 2015, Michal Hocko wrote:

> I am not sure how to achieve that. Requiring non-sleeping worker would
> work out but do we have enough users to add such an API?
>
> I would rather see vmstat using dedicated kernel thread(s) for this this
> purpose. We have discussed that in the past but it hasn't led anywhere.

How about this one? I really would like to have the vm statistics work as
designed and apparently they no longer work right with the existing
workqueue mechanism.


From: Christoph Lameter <cl@linux.com>
Subject: vmstat: Create our own workqueue

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
@@ -1357,6 +1357,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;
@@ -1369,7 +1371,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 {
@@ -1438,7 +1440,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();
@@ -1534,6 +1536,7 @@ static int __init setup_vmstat(void)
 	proc_create("vmstat", S_IRUGO, NULL, &proc_vmstat_file_operations);
 	proc_create("zoneinfo", S_IRUGO, NULL, &proc_zoneinfo_file_operations);
 #endif
+	vmstat_wq = alloc_workqueue("vmstat", WQ_FREEZABLE|WQ_MEM_RECLAIM, 0);
 	return 0;
 }
 module_init(setup_vmstat)
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

[PATCH] mm,vmscan: Use accurate values for zone_reclaimable() checks Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-21 14:30 +0200
  Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Michal Hocko <mhocko@kernel.org> - 2015-10-21 15:10 +0200
  Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Christoph Lameter <cl@linux.com> - 2015-10-21 16:30 +0200
    Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Michal Hocko <mhocko@kernel.org> - 2015-10-21 16:40 +0200
      Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Christoph Lameter <cl@linux.com> - 2015-10-21 16:50 +0200
        Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Michal Hocko <mhocko@kernel.org> - 2015-10-21 17:00 +0200
          Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable() checks Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-21 17:40 +0200
          Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Christoph Lameter <cl@linux.com> - 2015-10-21 19:20 +0200
            Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable() checks Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-22 13:40 +0200
              Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Christoph Lameter <cl@linux.com> - 2015-10-22 15:40 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Tejun Heo <htejun@gmail.com> - 2015-10-22 16:20 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Tejun Heo <htejun@gmail.com> - 2015-10-22 16:30 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Tejun Heo <htejun@gmail.com> - 2015-10-22 16:30 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Christoph Lameter <cl@linux.com> - 2015-10-22 16:30 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Tejun Heo <htejun@gmail.com> - 2015-10-22 16:40 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Christoph Lameter <cl@linux.com> - 2015-10-22 16:50 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Tejun Heo <htejun@gmail.com> - 2015-10-22 17:20 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Tejun Heo <htejun@gmail.com> - 2015-10-23 06:30 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Christoph Lameter <cl@linux.com> - 2015-10-22 16:30 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Christoph Lameter <cl@linux.com> - 2015-10-22 16:30 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Michal Hocko <mhocko@kernel.org> - 2015-10-22 17:10 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Tejun Heo <htejun@gmail.com> - 2015-10-22 17:20 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Christoph Lameter <cl@linux.com> - 2015-10-22 17:40 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Michal Hocko <mhocko@kernel.org> - 2015-10-23 10:40 +0200
                Make vmstat deferrable again (was Re: [PATCH] mm,vmscan: Use accurate  values for zone_reclaimable() checks) Christoph Lameter <cl@linux.com> - 2015-10-23 13:50 +0200
                Re: Make vmstat deferrable again (was Re: [PATCH] mm,vmscan: Use  accurate values for zone_reclaimable() checks) Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-10-23 14:10 +0200
                Re: Make vmstat deferrable again (was Re: [PATCH] mm,vmscan: Use  accurate values for zone_reclaimable() checks) Christoph Lameter <cl@linux.com> - 2015-10-23 16:20 +0200
                Re: Make vmstat deferrable again (was Re: [PATCH] mm,vmscan: Use  accurate values for zone_reclaimable() checks) Sergey Senozhatsky <sergey.senozhatsky@gmail.com> - 2015-10-23 17:00 +0200
                Re: Make vmstat deferrable again (was Re: [PATCH] mm,vmscan: Use  accurate values for zone_reclaimable() checks) Christoph Lameter <cl@linux.com> - 2015-10-23 18:20 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Tejun Heo <htejun@gmail.com> - 2015-10-22 17:40 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Michal Hocko <mhocko@kernel.org> - 2015-10-22 17:50 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Tejun Heo <htejun@gmail.com> - 2015-10-22 20:50 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()checks Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-22 23:50 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for  zone_reclaimable()checks Tejun Heo <htejun@gmail.com> - 2015-10-23 00:50 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for  zone_reclaimable()checks Michal Hocko <mhocko@kernel.org> - 2015-10-23 10:40 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for  zone_reclaimable()checks Tejun Heo <htejun@gmail.com> - 2015-10-23 12:40 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Michal Hocko <mhocko@kernel.org> - 2015-10-23 10:40 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Tejun Heo <htejun@gmail.com> - 2015-10-23 12:40 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Michal Hocko <mhocko@kernel.org> - 2015-10-23 13:20 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable() checks Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-23 14:30 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Tejun Heo <htejun@gmail.com> - 2015-10-23 20:30 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable() checks Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-25 12:00 +0100
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Tejun Heo <htejun@gmail.com> - 2015-10-25 23:50 +0100
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Michal Hocko <mhocko@kernel.org> - 2015-10-27 10:30 +0100
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Tejun Heo <htejun@gmail.com> - 2015-10-27 12:00 +0100
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Michal Hocko <mhocko@kernel.org> - 2015-10-27 13:10 +0100
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Tejun Heo <htejun@gmail.com> - 2015-10-23 20:30 +0200
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Michal Hocko <mhocko@kernel.org> - 2015-10-27 10:20 +0100
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Tejun Heo <htejun@gmail.com> - 2015-10-27 12:00 +0100
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()checks Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2015-10-27 12:10 +0100
                Re: [PATCH] mm,vmscan: Use accurate values for  zone_reclaimable()checks Tejun Heo <htejun@gmail.com> - 2015-10-27 12:40 +0100
                Re: [PATCH] mm,vmscan: Use accurate values for zone_reclaimable()  checks Michal Hocko <mhocko@kernel.org> - 2015-10-22 17:40 +0200

csiph-web