lkml.org 
[lkml]   [2012]   [Jun]   [1]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 3/5] vmevent: Refresh vmstats before sampling
    Date
    On SMP, kernel updates vmstats only once per second, which makes vmevent
    unusable. Let's fix it by updating vmstats before sampling.

    Reported-by: KOSAKI Motohiro <kosaki.motohiro@gmail.com>
    Signed-off-by: Anton Vorontsov <anton.vorontsov@linaro.org>
    ---
    mm/vmevent.c | 4 ++++
    1 file changed, 4 insertions(+)

    diff --git a/mm/vmevent.c b/mm/vmevent.c
    index 4ca2a04..35fd0d5 100644
    --- a/mm/vmevent.c
    +++ b/mm/vmevent.c
    @@ -2,6 +2,7 @@
    #include <linux/atomic.h>
    #include <linux/compiler.h>
    #include <linux/vmevent.h>
    +#include <linux/mm.h>
    #include <linux/syscalls.h>
    #include <linux/workqueue.h>
    #include <linux/file.h>
    @@ -163,6 +164,9 @@ static void vmevent_sample(struct vmevent_watch *watch)

    if (atomic_read(&watch->pending))
    return;
    +
    + refresh_vm_stats();
    +
    if (!vmevent_match(watch))
    return;

    --
    1.7.9.2


    \
     
     \ /
      Last update: 2012-06-01 14:41    [W:4.294 / U:0.028 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site