From owner-freebsd-current Fri Feb 1 17: 3: 9 2002 Delivered-To: freebsd-current@freebsd.org Received: from snipe.prod.itd.earthlink.net (snipe.mail.pas.earthlink.net [207.217.120.62]) by hub.freebsd.org (Postfix) with ESMTP id F1FAE37B422; Fri, 1 Feb 2002 17:02:24 -0800 (PST) Received: from pool0542.cvx40-bradley.dialup.earthlink.net ([216.244.44.32] helo=mindspring.com) by snipe.prod.itd.earthlink.net with esmtp (Exim 3.33 #1) id 16WoZN-0001M8-00; Fri, 01 Feb 2002 17:02:17 -0800 Message-ID: <3C5B3A94.6B12B9D0@mindspring.com> Date: Fri, 01 Feb 2002 17:02:12 -0800 From: Terry Lambert X-Mailer: Mozilla 4.7 [en]C-CCK-MCD {Sony} (Win98; U) X-Accept-Language: en MIME-Version: 1.0 To: Bruce Evans Cc: Alfred Perlstein , current@freebsd.org Subject: Re: lock reversal in fdalloc() References: <20020202072516.J290-100000@gamplex.bde.org> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Sender: owner-freebsd-current@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Bruce Evans wrote: > > basically it seems to get pissy if it doesn't get the file slot it asks > > for, so if another thread wins the race here, we'll panic. this problem > > seems to also exist for 4.x and previous versions of freebsd. > > > > I'd like to get this fixed. Any suggestions? I think simply > > removing the assertion should remove this hazzard, correct? I think if you delayed the allocation, it'd be OK, but I don't see a clean way to do it without a bit of work. > Something like that. This was apparently missed when the retry loop was > added. Lite2 has the panic but not the retry loop. > > BTW, the retry loop also picks up changes to the limit on descriptors. > In fdalloc(), the corresponding limit is treated as a loop invariant, > but it is not invariant. I think the process's rlimit can't change, > but maxfilesperproc can change even if the process doesn't block, since > it is not protected by FILEDESC_LOCK() :-(. Fortunately, the > maxfilesperproc limit isn't very important. I think this is a requirement. The problem is the case where the maxfilesperproc has *not* changed, and some other thread wins the race to the last one, you have to honor that, and fail the current attempt. Retries are fugly. 8-(. -- Terry To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-current" in the body of the message