Skip to contentSkip to conversation

oom support function

PATCH In review Con Kolivas 1 participant 1 message Oct 30, 2004

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 15/28 oom support function

oom support function

__oom_kill_task sets a specific time_slice; modify it to have it's time_slice adjusted in a cpu-scheduler dependant fashion.

include/linux/sched.h +1 -0
Index: linux-2.6.10-rc1-mm2-plugsched1/include/linux/sched.h
===================================================================
@@ -741,6 +741,7 @@ extern int task_prio(const task_t *p);
 extern int task_nice(const task_t *p);
 extern int task_curr(const task_t *p);
 extern int idle_cpu(int cpu);
+extern void set_oom_timeslice(task_t *p);
 
 void yield(void);
 
mm/oom_kill.c +1 -1
Index: linux-2.6.10-rc1-mm2-plugsched1/mm/oom_kill.c
===================================================================
@@ -156,7 +156,7 @@ static void __oom_kill_task(task_t *p)
 	 * all the memory it needs. That way it should be able to
 	 * exit() and clear out its resources quickly...
 	 */
-	p->time_slice = HZ;
+	set_oom_timeslice(p);
 	p->flags |= PF_MEMALLOC | PF_MEMDIE;
 
 	/* This process has hardware access, be more careful. */