Date: Wed, 25 Mar 2015 13:05:33 +0000 (UTC) From: Andrew Rybchenko <arybchik@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r280584 - stable/10/sys/dev/sfxge/common Message-ID: <201503251305.t2PD5XTr064646@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
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)
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201503251305.t2PD5XTr064646>