Date: Sun, 2 Nov 2014 16:36:33 +0100 From: Attilio Rao <attilio@freebsd.org> To: Konstantin Belousov <kib@freebsd.org> Cc: "svn-src-head@freebsd.org" <svn-src-head@freebsd.org>, "svn-src-all@freebsd.org" <svn-src-all@freebsd.org>, "src-committers@freebsd.org" <src-committers@freebsd.org> Subject: Re: svn commit: r273966 - in head: share/man/man9 sys/kern sys/sys Message-ID: <CAJ-FndDog%2BxbWr=ZbE2AOV9tBo1Usrt0wi_FiC6sJ_7HcsfBZQ@mail.gmail.com> In-Reply-To: <201411021310.sA2DAWmD003298@svn.freebsd.org> References: <201411021310.sA2DAWmD003298@svn.freebsd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sun, Nov 2, 2014 at 2:10 PM, Konstantin Belousov <kib@freebsd.org> wrote: > Author: kib > Date: Sun Nov 2 13:10:31 2014 > New Revision: 273966 > URL: https://svnweb.freebsd.org/changeset/base/273966 > > Log: > Fix two issues with lockmgr(9) LK_CAN_SHARE() test, which determines > whether the shared request for already shared-locked lock could be > granted. Both problems result in the exclusive locker starvation. > > The concurrent exclusive request is indicated by either > LK_EXCLUSIVE_WAITERS or LK_EXCLUSIVE_SPINNERS flags. The reverse > condition, i.e. no exclusive waiters, must check that both flags are > cleared. > > Add a flag LK_NODDLKTREAT for shared lock request to indicate that > current thread guarantees that it does not own the lock in shared > mode. This turns back the exclusive lock starvation avoidance code; > see man page update for detailed description. > > Use LK_NODDLKTREAT when doing lookup(9). > > Reported and tested by: pho > No objections from: attilio Not true, I objected to the part of the patch that modifies the semantic for changing the writer starvation avoidance technique. As I said the td_lk_slocks must work for every consumer of lockmgr, it is not specific to any usage in the kernel, including namei() or lookups. This is an hinerent property of lockmgr, it has not strict relation with its callers. Now you can deadlock lockmgr if you use recursive shared acquisition in a path that has not been identified. This part of the patch should be reverted. Attilio -- Peace can only be achieved by understanding - A. Einstein
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAJ-FndDog%2BxbWr=ZbE2AOV9tBo1Usrt0wi_FiC6sJ_7HcsfBZQ>