[lkml]   [2007]   [Aug]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH] Fix preemptible lazy mode bug
Jeremy Fitzhardinge wrote:
> Hm. Doing any kind of lazy-state operation with preemption enabled is
> fundamentally meaningless. How does it get into a preemptable state

Agree 100%. It is the lazy mode flush that might happen when preempt is
enabled, but lazy mode is disabled. In that case, the code relies on
per-cpu variables, which is a bad thing to do in preemtible code. This
can happen in the current code path.

Thinking slightly deeper about it, it might be the case that there is no
bug, because the local lazy mode variables are only _modified_ in the
preemptible state, and guaranteed to be zero in the non-preemtible
state; but it was not clear to me that this is always the case, and I
got very nervous about reading per-cpu variables with preempt enabled.
It would, in any case, fire a BUG_ON in the Xen code, which I did fix.

Do you agree it is better to be safe than sorry in this case? The kind
of bugs introduced by getting this wrong are really hard to find, and I
would rather err on the side of an extra increment and decrement of
preempt_count that causing a regression.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2007-08-24 09:09    [W:0.074 / U:9.344 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site