Subject: Re: how to avoid re-ordering?
To: None <>
From: YAMAMOTO Takashi <>
List: tech-kern
Date: 12/05/2001 14:12:36

From: Luke Mewburn <>
> wouldn't it be better to mark the ocpl and ncpl arguments as
> `volatile' instead? does that solve the problem?

it also avoid producing bad codes.(I've tested.)

but i wonder if it is enough.
the code I know which can produce bad code is
free_lock in ufs/ffs/ffs_softdep.c .
the problem is re-ordering "lk->lkt_held = -1"
and "cpl = ncpl" in splx.
since cpl is already volatile,
i'm not sure why marking ncpl as volatile suppress re-ordering
in this case...

YAMAMOTO Takashi<>