Skip to contentSkip to conversation

protect migration/%d etc from sched_setaffinity

PATCH Andi Kleen 2 participants 2 messages Jul 31, 2003 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Andi Kleen

author
#1 lore raw

include/linux/sched.h line 491

Quoted 9 lines · Joe Korty

diff -Nura linux-2.6.0-test2/include/linux/sched.h.orig linux-2.6.0-test2/include/linux/sched.h

include/linux/sched.h renamed from include/linux/sched.h.orig +1 -0
@@ -488,6 +488,7 @@
 #define PF_LESS_THROTTLE 0x01000000	/* Throttle me less: I clena memory */
 #define PF_SYNCWRITE	0x00200000	/* I am doing a sync write */
 #define PF_READAHEAD	0x00400000	/* I am doing read-ahead */
+#define PF_CPULOCK	0x00800000	/* lock users out from changing cpus_allowed */

It would be probably better to just check for ->mm == NULL

This should catch all kernel threads that use daemonize

-Andi

#2 lore raw
Quoted 13 lines · Andi Kleen

include/linux/sched.h line 491

Quoted 9 lines · Joe Korty

diff -Nura linux-2.6.0-test2/include/linux/sched.h.orig linux-2.6.0-test2/include/linux/sched.h

include/linux/sched.h renamed from include/linux/sched.h.orig +1 -0
@@ -488,6 +488,7 @@
 #define PF_LESS_THROTTLE 0x01000000	/* Throttle me less: I clena memory */
 #define PF_SYNCWRITE	0x00200000	/* I am doing a sync write */
 #define PF_READAHEAD	0x00400000	/* I am doing read-ahead */
+#define PF_CPULOCK	0x00800000	/* lock users out from changing cpus_allowed */

It would be probably better to just check for ->mm == NULL

Quoted 3 lines

This should catch all kernel threads that use daemonize

-Andi

That is what Robert suggested and it is acceptable to me, though suboptimal..it blocks every daemon, not just the ones that have to be blocked for system survivability. Joe