Garbage collection code

Vikram Mehta vm6580 at hotmail.com
Mon Jul 21 15:28:30 EDT 2003


Hi folks,

Can someone tell me what is happening in this code copied below

Specifically what does schedule at the end of the code does.

Also kindly tell me a link where I can read abt these things in detail.

With regards
Vikram

for (;;) {
  spin_lock_irq(&current->sigmask_lock);
  siginitsetinv (&current->blocked, sigmask(SIGHUP) | sigmask(SIGKILL) |
sigmask(SIGSTOP) | sigmask(SIGCONT));
  recalc_sigpending(current);
  spin_unlock_irq(&current->sigmask_lock);

  if (!thread_should_wake(c)) {
                        set_current_state (TASK_INTERRUPTIBLE);
   D1(printk(KERN_EMERG "jffs2_garbage_collect_thread sleeping. ..\n"));
   /* Yes, there's a race here; we checked thread_should_wake() before
      setting current->state to TASK_INTERRUPTIBLE. But it doesn't
      matter - We don't care if we miss a wakeup, because the GC thread
      is only an optimisation anyway. */
   schedule();
}




More information about the linux-mtd mailing list