Subject: Re: how to avoid re-ordering?
To: None <firstname.lastname@example.org>
From: YAMAMOTO Takashi <email@example.com>
Date: 12/05/2001 14:12:36
From: Luke Mewburn <firstname.lastname@example.org>
> 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...