#include <linux/ptrace.h>
 #include <linux/freezer.h>
 #include <linux/ftrace.h>
+#include <linux/ratelimit.h>
 
 #define CREATE_TRACE_POINTS
 #include <trace/events/oom.h>
        struct task_struct *t = p;
        struct mm_struct *mm;
        unsigned int victim_points = 0;
+       static DEFINE_RATELIMIT_STATE(oom_rs, DEFAULT_RATELIMIT_INTERVAL,
+                                             DEFAULT_RATELIMIT_BURST);
 
        /*
         * If the task is already exiting, don't alarm the sysadmin or kill
                return;
        }
 
-       if (printk_ratelimit())
+       if (__ratelimit(&oom_rs))
                dump_header(p, gfp_mask, order, memcg, nodemask);
 
        task_lock(p);