Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id E465017B105D for ; Fri, 11 May 2012 11:14:49 -0300 (ADT) Received: from exprod7og115.obsmtp.com ([64.18.2.217]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SSqcG-0007Sq-1U for pgsql-bugs@postgresql.org; Fri, 11 May 2012 14:14:49 +0000 Received: from mail-lpp01m010-f52.google.com ([209.85.215.52]) (using TLSv1) by exprod7ob115.postini.com ([64.18.6.12]) with SMTP ID DSNKT60exUH1LPeM9WUodX6IG6mKafxVQYeR@postini.com; Fri, 11 May 2012 07:14:43 PDT Received: by lahj13 with SMTP id j13so1746754lah.25 for ; Fri, 11 May 2012 07:14:28 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=message-id:date:from:user-agent:mime-version:to:cc:subject :references:in-reply-to:content-type:content-transfer-encoding :x-gm-message-state; bh=EWl5+0GCs7EFy33yLhbiLHZBrOLtCodXcSLkFtghyhk=; b=QxtI3UPh4ACQap751YE5eqedMiYIyLqRnkyu2n3zoeH1FPJoCEQ2WWltu06EkPNriR HNG5E+v3+JzyXMvHx40YNQHeR8BbZdQ3xm/HY0L0frE05XIwsXq55yDZ58Ass87gFfNU mopMmVO/6MEV8UFtsXS3dKY/vMSVMFoUG02/4Y7vVgjY7TAG4NfiyppM9eEUFXiR/mx3 Hn51mBvOGCwz78EnsqWcM7iyWPCdDQ9mGkG6ljJNmCDa/k/JK3FgwGfjE6w6hyonLEqz c0wIJjCYlLKMeUlmtw9mw6VxDLMzZ0E4/0YTUKy4AeaQqh3PTWKoKGdiYvGXjFS9xzWG rmnA== Received: by 10.112.46.101 with SMTP id u5mr3849974lbm.21.1336745668103; Fri, 11 May 2012 07:14:28 -0700 (PDT) Received: from [192.168.1.102] (dsl-hkibrasgw2-ff6cc300-200.dhcp.inet.fi. [88.195.108.200]) by mx.google.com with ESMTPS id tc2sm9546994lab.15.2012.05.11.07.14.26 (version=TLSv1/SSLv3 cipher=OTHER); Fri, 11 May 2012 07:14:27 -0700 (PDT) Message-ID: <4FAD1EC1.2000502@enterprisedb.com> Date: Fri, 11 May 2012 17:14:25 +0300 From: Heikki Linnakangas User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:10.0.3) Gecko/20120329 Icedove/10.0.3 MIME-Version: 1.0 To: Simon Riggs CC: Ryan Kelly , tom Tom , pgsql-bugs@postgresql.org Subject: Re: BUG #6629: Creating a gist index fails with "too many LWLocks taken" References: <4FA7EC37.5070703@enterprisedb.com> <20120508011540.GA28140@llserver.lakeliving.com> <4FACE4C7.6070306@enterprisedb.com> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQkGFiDB2zAEAkSv+ww5PBVDjTifEI9IiU+XWVga1kJj8Ub+7i5wlESUDgpaKvs00PmiWyG4 X-Pg-Spam-Score: -4.2 (----) X-Archive-Number: 201205/63 X-Sequence-Number: 33034 On 11.05.2012 16:56, Simon Riggs wrote: > On 11 May 2012 11:07, Heikki Linnakangas > wrote: > >> I wonder if we should reserve a few of the lwlock "slots" for critical >> sections, to make this less likely to happen. Not only in this case, but in >> general. We haven't seen this problem often, but it would be quite trivial >> to reserve a few slots. > > Why reserve them solely for critical sections? Because if you run out of lwlocks in a critical section, you get a PANIC. > What is the downside from having>100 slots for general use. > > ISTM we should have 250 slots and log a warning if we ever hit 50 or more. Then we would be back to square one, if a piece of code acquires 250 locks, then enters a critical section, and tries to acquire one more lock -> PANIC. -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com