OSDN Git Service

sunrpc: expiry_time should be seconds not timeval
[sagit-ice-cold/kernel_xiaomi_msm8998.git] / ipc / msgutil.c
index ed81aaf..9467307 100644 (file)
@@ -18,6 +18,7 @@
 #include <linux/utsname.h>
 #include <linux/proc_ns.h>
 #include <linux/uaccess.h>
+#include <linux/sched.h>
 
 #include "util.h"
 
@@ -66,6 +67,9 @@ static struct msg_msg *alloc_msg(size_t len)
        pseg = &msg->next;
        while (len > 0) {
                struct msg_msgseg *seg;
+
+               cond_resched();
+
                alen = min(len, DATALEN_SEG);
                seg = kmalloc(sizeof(*seg) + alen, GFP_KERNEL);
                if (seg == NULL)
@@ -178,6 +182,8 @@ void free_msg(struct msg_msg *msg)
        kfree(msg);
        while (seg != NULL) {
                struct msg_msgseg *tmp = seg->next;
+
+               cond_resched();
                kfree(seg);
                seg = tmp;
        }