Re: [PATCH v2 1/2] mm: make vmstat_update periodic run conditional

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

 



On Wed, 19 Jun 2013, Gilad Ben-Yossef wrote:

> +static void vmstat_update(struct work_struct *w)
> +{
> +	int cpu, this_cpu = smp_processor_id();
> +
> +	if (unlikely(this_cpu == vmstat_monitor_cpu))
> +		for_each_cpu_not(cpu, &vmstat_cpus)
> +			if (need_vmstat(cpu))
> +				start_cpu_timer(cpu);
> +
> +	if (likely(refresh_cpu_vm_stats(this_cpu) || (this_cpu == vmstat_monitor_cpu)))
> +		schedule_delayed_work(&__get_cpu_var(vmstat_work),
> +				round_jiffies_relative(sysctl_stat_interval));
> +	else
> +		cpumask_clear_cpu(this_cpu, &vmstat_cpus);

The clearing of vmstat_cpus could be avoided if this processor is not
running tickless. Frequent updates to vmstat_cpus could become an issue.

>  	case CPU_DOWN_PREPARE_FROZEN:
> -		cancel_delayed_work_sync(&per_cpu(vmstat_work, cpu));
> -		per_cpu(vmstat_work, cpu).work.func = NULL;
> +		if (cpumask_test_cpu(cpu, &vmstat_cpus)) {
> +			cancel_delayed_work_sync(&per_cpu(vmstat_work, cpu));
> +			per_cpu(vmstat_work, cpu).work.func = NULL;
> +			if(cpu == vmstat_monitor_cpu) {
> +				int this_cpu = smp_processor_id();
> +				vmstat_monitor_cpu = this_cpu;
> +				if (!cpumask_test_cpu(this_cpu, &vmstat_cpus))
> +					start_cpu_timer(this_cpu);
> +			}
> +		}
>  		break;

If the disabling of vmstat is tied into the nohz logic then these portions
are no longer necessary.

> @@ -1237,8 +1299,10 @@ static int __init setup_vmstat(void)
>
>  	register_cpu_notifier(&vmstat_notifier);
>
> +	vmstat_monitor_cpu = smp_processor_id();
> +

Drop the vmstat_monitor_cpu and use the dynticks processor.

--
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]