X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=mm%2Fpdflush.c;h=c4b6d0afd73605cdc446a1cd9fc75aca8afb3693;hb=6a878184c202395ea17212f111ab9ec4b5f6d6ee;hp=d6781951267eb654a522529658aaa06199d1772f;hpb=62778ba1aa2589dc78c36a32edc6f5a6ccaf50c6;p=pandora-kernel.git diff --git a/mm/pdflush.c b/mm/pdflush.c index d6781951267e..c4b6d0afd736 100644 --- a/mm/pdflush.c +++ b/mm/pdflush.c @@ -20,6 +20,7 @@ #include // Needed by writeback.h #include // Prototypes pdflush_operation() #include +#include /* @@ -89,7 +90,7 @@ struct pdflush_work { static int __pdflush(struct pdflush_work *my_work) { - current->flags |= PF_FLUSHER; + current->flags |= PF_FLUSHER | PF_SWAPWRITE; my_work->fn = NULL; my_work->who = current; INIT_LIST_HEAD(&my_work->list); @@ -170,12 +171,24 @@ static int __pdflush(struct pdflush_work *my_work) static int pdflush(void *dummy) { struct pdflush_work my_work; + cpumask_t cpus_allowed; /* * pdflush can spend a lot of time doing encryption via dm-crypt. We * don't want to do that at keventd's priority. */ set_user_nice(current, 0); + + /* + * Some configs put our parent kthread in a limited cpuset, + * which kthread() overrides, forcing cpus_allowed == CPU_MASK_ALL. + * Our needs are more modest - cut back to our cpusets cpus_allowed. + * This is needed as pdflush's are dynamically created and destroyed. + * The boottime pdflush's are easily placed w/o these 2 lines. + */ + cpus_allowed = cpuset_cpus_allowed(current); + set_cpus_allowed(current, cpus_allowed); + return __pdflush(&my_work); }