[PATCH] Avoid use of uninitialised spinlock in EEH.

linas linas at austin.ibm.com
Thu Nov 17 10:04:05 EST 2005


On Wed, Nov 16, 2005 at 10:22:26PM +0000, David Woodhouse was heard to remark:
> 
> The problem is that eeh_init() is never called, because we're not
> running on a pSeries. But eeh_check_failure() is still called, and tries
> to lock a spinlock which was never initialised.

Ah. Well, its a nice simple patch that seems to not have been applied 
to 2.6.15-rc1-git2.  

So ... my only objection is that there is a teeny amount of
performance loss due to one more check, and the fact that the 
global will chew up yet another cacheline.

You can regain most of that performance hit by reordering, 
so that instead of 

> -#define EEH_POSSIBLE_ERROR(val, type)	((val) == (type)~0)
> +#define EEH_POSSIBLE_ERROR(val, type)	(eeh_subsystem_enabled && (val) == (type)~0)

one has

#define EEH_POSSIBLE_ERROR(val, type)	(((val) == (type)~0) && eeh_subsystem_enabled)

so that the cacheline containing eeh_subsystem_enabled is pulled in only
if val==all ff's.  (val will be in a register anyway, so less loss
there).

--linas



More information about the Linuxppc64-dev mailing list