svn commit: r280584 - stable/10/sys/dev/sfxge/common
Andrew Rybchenko
arybchik at FreeBSD.org
Wed Mar 25 13:05:34 UTC 2015
Author: arybchik
Date: Wed Mar 25 13:05:33 2015
New Revision: 280584
URL: https://svnweb.freebsd.org/changeset/base/280584
Log:
MFC: 279178
sfxge: do no allow EFSYS_MEM_ALLOC sleep
It solves locking problem when EFSYS_MEM_ALLOC is called in
the context holding a mutex (not allowed to sleep).
E.g. on interface bring up or multicast addresses addition.
Sponsored by: Solarflare Communications, Inc.
Approved by: gnn (mentor)
Modified:
stable/10/sys/dev/sfxge/common/efsys.h
Directory Properties:
stable/10/ (props changed)
Modified: stable/10/sys/dev/sfxge/common/efsys.h
==============================================================================
--- stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 13:05:17 2015 (r280583)
+++ stable/10/sys/dev/sfxge/common/efsys.h Wed Mar 25 13:05:33 2015 (r280584)
@@ -941,7 +941,11 @@ typedef clock_t efsys_timestamp_t;
#define EFSYS_KMEM_ALLOC(_esip, _size, _p) \
do { \
(_esip) = (_esip); \
- (_p) = malloc((_size), M_SFXGE, M_WAITOK|M_ZERO); \
+ /* \
+ * The macro is used in non-sleepable contexts, for \
+ * example, holding a mutex. \
+ */ \
+ (_p) = malloc((_size), M_SFXGE, M_NOWAIT|M_ZERO); \
_NOTE(CONSTANTCONDITION) \
} while (B_FALSE)
More information about the svn-src-all
mailing list