> rml and I coordinated to put together a small patch (combining both
> our own) for properly locking the static variables in out_of_memory().
> There's not any evidence things are going wrong here now, but it at
> least addresses the visible lack of locking in out_of_memory().
Thank you for posting this, wli.
> - first = now;
> + /*
> + * We dropped the lock above, so check to be sure the variable
> + * first only ever increases to prevent false OOM's.
> + */
> + if (time_after(now, first))
> + first = now;
Just thinking... this little bit is actually a bug even on UP sans
kernel preemption, too, since oom_kill() can sleep. If it sleeps, and
another process enters out_of_memory(), 'now' and 'first' will be out of
sync.
So I think this patch is a Good Thing in more ways than the obvious SMP
or kernel preemption issue.
Robert Love
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/