]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - kernel/softirq.c
ARM: imx: armadillo5x0: Fix illegal register access
[karo-tx-linux.git] / kernel / softirq.c
index 671f9594e3681e028c18b3e7456b1e58de2930c2..b73e681df09ea23e951b04672ca41227e9e0787f 100644 (file)
@@ -210,6 +210,14 @@ asmlinkage void __do_softirq(void)
        __u32 pending;
        int max_restart = MAX_SOFTIRQ_RESTART;
        int cpu;
+       unsigned long old_flags = current->flags;
+
+       /*
+        * Mask out PF_MEMALLOC s current task context is borrowed for the
+        * softirq. A softirq handled such as network RX might set PF_MEMALLOC
+        * again if the socket is related to swap
+        */
+       current->flags &= ~PF_MEMALLOC;
 
        pending = local_softirq_pending();
        account_system_vtime(current);
@@ -265,6 +273,7 @@ restart:
 
        account_system_vtime(current);
        __local_bh_enable(SOFTIRQ_OFFSET);
+       tsk_restore_flags(current, old_flags, PF_MEMALLOC);
 }
 
 #ifndef __ARCH_HAS_DO_SOFTIRQ