RE: vmstat: use our own timer events

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

 



 

>-----Original Message-----
>From: [email protected] 
>[mailto:[email protected]] On Behalf Of 
>Christoph Lameter
>Sent: Saturday, April 28, 2007 10:09 PM
>To: [email protected]
>Cc: [email protected]; Arjan van de Ven
>Subject: vmstat: use our own timer events
>
>
>We could implement an alternate approach that runs the first processor
>on each node at the second and then each of the other processor on a
>node on a subsequent tick. That may be useful to keep a large amount
>of the second free of timer activity. Maybe the timer folks will have
>some feedback on this one?
>

Can this use 'deferrable timer' along with round_jiffies. That
will eliminate the issue of too frequent interrupt when CPU is idle.


>CC: Arjan van de Ven <[email protected]>
>Signed-off-by: Christoph Lameter <[email protected]>
>
>Index: slub/mm/vmstat.c
>===================================================================
>--- slub.orig/mm/vmstat.c	2007-04-28 19:30:01.000000000 -0700
>+++ slub/mm/vmstat.c	2007-04-28 19:36:38.000000000 -0700
>@@ -640,6 +640,22 @@ const struct seq_operations vmstat_op = 
> #endif /* CONFIG_PROC_FS */
> 
> #ifdef CONFIG_SMP
>+static DEFINE_PER_CPU(struct delayed_work, vmstat_work);
>+
>+static void vmstat_update(struct work_struct *w)
>+{
>+	refresh_cpu_vm_stats(smp_processor_id());
>+	schedule_delayed_work(&__get_cpu_var(vmstat_work), HZ);
>+}
>+
>+static void __devinit start_cpu_timer(int cpu)
>+{
>+	struct delayed_work *vmstat_work = &per_cpu(vmstat_work, cpu);
>+
>+	INIT_DELAYED_WORK(vmstat_work, vmstat_update);

This change alone should help.
	INIT_DELAYED_WORK_DEFERRABLE(vmstat_work, vmstat_update);


>+	schedule_delayed_work_on(cpu, vmstat_work, HZ + cpu);
>+}
>+


Thanks,
Venki

Thanks,
Venki
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux