Skip to contentSkip to conversation

Garbage on current->state - linux 2.2

DISCUSSION Luciano Porto Barreto 1 participant 1 message Feb 20, 2002

lore
Share & tools
lore
#0 lore raw

Hi,

We are developing a package (named Bossa) to allow developers to safely and easily program their own schedulers.
This package will be available as soon as we get a stable version and we plan to port it to more recent versions (2.4, 2.5).

Schedulers react to events that are generated by the kernel at specific parts (eg, when a process blocks or unblocks). We have instrumented the kernel (2.2.16 non SMP) to notify such events.

We added a field (pointer to a struct) at the end of task_struct (the usual approach).

We also replaced schedule() by the following skeleton.

schedule()

{         int s_state;
          event_struct *e;
          ...
          // bottom half processing 
          ...
          while ((e = bossa_get_next_event()) != NULL) 
            {
             need_to_switch = handle_event(e);
            }
         if (need_to_switch)
           { // selects the new process
	   	get_mmu_context(new);
		switch_to(old,new,old);
           }
}

However, sometimes I get garbage when reading current->state (eg, in wake_up_process() ). Such garbage appears after the switch_to.

Any hints of what may be causing that ?

Thanks,

Luciano