Grant Grundler writes:

> Ok this is good example - I see what the problem is.
> You could use the following sequence too then:
>       pci_block_user_cfg_access
>               pci_save_state
>               block_ucfg_access = 1
>               mb()
>               while (spin_is_locked(&pci_lock))
>                       relax_cpu();
> 
> Think this is sufficient?

Maybe, but it seems like a bad idea to me.  It's longer, it's less
obvious what's happening, and it precludes the sorts of optimization
that we do on ppc64 where a cpu that is waiting for a lock can tell
give its time slice to the cpu that is holding the lock (on systems
where the hypervisor time-slices multiple virtual cpus on one physical
cpu).

What's wrong with just doing spin_lock/spin_unlock?

Paul.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Reply via email to