Re: [PATCH] net/9p/trans_virtio.c: replace mutex_lock with spin_lock to protect 'virtio_chan_list'

From: Dominique Martinet
Date: Wed Jul 18 2018 - 05:54:40 EST


piaojun wrote on Wed, Jul 18, 2018:
> spin_lock is more effective for short time protection than mutex_lock, as
> mutex lock may cause process sleep and wake up which consume much cpu
> time.

That's not a fast path operation, I don't mind changing things but I'd
like to understand why - these functions are only ever called at unmount
time or when something happens on the virtio bus (probe will happen on
probing on the pci bus and I'm not too sure on remove but probably pci
removal i.e. basically never?)

I don't see why this wouldn't work, but I won't take this without a
(good?) reason.

--
Dominique Martinet