Don't spin on cleanup_lock if we are not interrupt.

If somebody else holds that lock, it will likely do the work for us.
If it won't, then we return here later and retry.

Under heavy load it allows to avoid lock congestion between interrupt and
polling threads.

MFC after:	1 week
Sponsored by:	iXsystems, Inc.
This commit is contained in:
Alexander Motin 2019-12-31 04:16:52 +00:00
parent f23df31975
commit 8acd3f126a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=356216

View File

@ -789,7 +789,12 @@ ioat_process_events(struct ioat_softc *ioat, boolean_t intr)
uint32_t completed, chanerr;
int error;
mtx_lock(&ioat->cleanup_lock);
if (intr) {
mtx_lock(&ioat->cleanup_lock);
} else {
if (!mtx_trylock(&ioat->cleanup_lock))
return;
}
/*
* Don't run while the hardware is being reset. Reset is responsible