Re: task->mm remains null in 'context_switch()'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I have checked by setting conditional breakpoints that task->mm is
always NULL in those locations. I have also found that task remains
NULL many times, but surprisingly the trace_mark() successfully puts
the task->pid in the trace file.

I am confused as to what is happening ...


> On Mon, May 11, 2009 at 8:16 PM, Mulyadi Santosa
> <mulyadi.santosa@xxxxxxxxx> wrote:
>> Always? hmm strange. sure you did the deferencing to task_struct correctly?

look at the following parts of the diff:
---------------------------------
diff --git a/kernel/sched.c b/kernel/sched.c
index ad1962d..00731d4 100644
--- a/kernel/sched.c
+++ b/kernel/sched.c
@@ -2283,8 +2283,8 @@ out_activate:

 out_running:
 	trace_mark(kernel_sched_wakeup,
-		"pid %d state %ld ## rq %p task %p rq->curr %p",
-		p->pid, p->state, rq, p, rq->curr);
+		"pid %d state %ld ## rq %p task %p rq->curr %p rq_load %lu
page_flt_rate %llu",
+		p->pid, p->state, rq, p, rq->curr, rq->load.weight, p->mm->page_flt_rate);
 	check_preempt_curr(rq, p);

 	p->state = TASK_RUNNING;
@@ -2418,8 +2418,8 @@ void wake_up_new_task(struct task_struct *p,
unsigned long clone_flags)
 		inc_nr_running(rq);
 	}
 	trace_mark(kernel_sched_wakeup_new,
-		"pid %d state %ld ## rq %p task %p rq->curr %p",
-		p->pid, p->state, rq, p, rq->curr);
+		"pid %d state %ld ## rq %p task %p rq->curr %p rq_load %lu
page_flt_rate %llu",
+		p->pid, p->state, rq, p, rq->curr, rq->load.weight, p->mm->page_flt_rate);
 	check_preempt_curr(rq, p);
 #ifdef CONFIG_SMP
 	if (p->sched_class->task_wake_up)
@@ -2594,9 +2594,9 @@ context_switch(struct rq *rq, struct task_struct *prev,
 	prepare_task_switch(rq, prev, next);
 	trace_mark(kernel_sched_schedule,
 		"prev_pid %d next_pid %d prev_state %ld "
-		"## rq %p prev %p next %p",
+		"## rq %p prev %p next %p rq_load %lu page_flt_rate %llu",
 		prev->pid, next->pid, prev->state,
-		rq, prev, next);
+		rq, prev, next, rq->load.weight, next->mm->page_flt_rate);
 	mm = next->mm;
 	oldmm = prev->active_mm;
 	/*
---------------------------------



-- 
Regards,
Sukanto Ghosh

--
To unsubscribe from this list: send an email with
"unsubscribe kernelnewbies" to ecartis@xxxxxxxxxxxx
Please read the FAQ at http://kernelnewbies.org/FAQ


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux