Re: [PATCH v2] mm: vmscan: fix the page state calculation in too_many_isolated

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Fri, 16 Jan 2015, Michal Hocko wrote:

> __round_jiffies_relative can easily make timeout 2HZ from 1HZ. Now we
> have vmstat_shepherd which waits to be queued and then wait to run. When
> it runs finally it only queues per-cpu vmstat_work which can also end
> up being 2HZ for some CPUs. So we can indeed have 4 seconds spent just
> for queuing. Not even mentioning work item latencies. Especially when
> workers are overloaded e.g. by fs work items and no additional workers
> cannot be created e.g. due to memory pressure so they are processed only
> by the workqueue rescuer. And latencies would grow a lot.

Here is a small fix to ensure that the 4 seconds interval does not happen:




Subject: vmstat: Reduce time interval to stat update on idle cpu

It was noted that the vm stat shepherd runs every 2 seconds and
that the vmstat update is then scheduled 2 seconds in the future.

This yields an interval of double the time interval which is not
desired.

Change the shepherd so that it does not delay the vmstat update
on the other cpu. We stil have to use schedule_delayed_work since
we are using a delayed_work_struct but we can set the delay to 0.

Signed-off-by: Christoph Lameter <cl@xxxxxxxxx>

Index: linux/mm/vmstat.c
===================================================================
--- linux.orig/mm/vmstat.c
+++ linux/mm/vmstat.c
@@ -1435,8 +1435,8 @@ static void vmstat_shepherd(struct work_
 		if (need_update(cpu) &&
 			cpumask_test_and_clear_cpu(cpu, cpu_stat_off))

-			schedule_delayed_work_on(cpu, &per_cpu(vmstat_work, cpu),
-				__round_jiffies_relative(sysctl_stat_interval, cpu));
+			schedule_delayed_work_on(cpu,
+				&per_cpu(vmstat_work, cpu), 0);

 	put_online_cpus();

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]