Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZcFqA-0004t3-2H for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Sep 2015 16:45:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZcFq9-0004ev-K8 for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Sep 2015 16:45:49 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZcFoo-000325-U4 for pgsql-hackers@postgresql.org; Wed, 16 Sep 2015 16:44:27 +0000 Received: from mx1.redhat.com ([209.132.183.28]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZcFol-0001vT-Qp for pgsql-hackers@postgresql.org; Wed, 16 Sep 2015 16:44:25 +0000 Received: from int-mx14.intmail.prod.int.phx2.redhat.com (int-mx14.intmail.prod.int.phx2.redhat.com [10.5.11.27]) by mx1.redhat.com (Postfix) with ESMTPS id 1F62C2F90DB; Wed, 16 Sep 2015 16:44:22 +0000 (UTC) Received: from localhost.localdomain (vpn-53-52.rdu2.redhat.com [10.10.53.52]) by int-mx14.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t8GGiLHA012292 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 Sep 2015 12:44:21 -0400 Subject: Re: Additional LWLOCK_STATS statistics To: Andres Freund References: <55F82AE1.3010407@redhat.com> <55F871BA.4060404@redhat.com> <55F876CA.8020702@redhat.com> <55F97909.3010101@redhat.com> <55F97BF0.70503@redhat.com> <55F97EB7.8080308@redhat.com> <20150916162627.GF2086@alap3.anarazel.de> Cc: "pgsql-hackers@postgresql.org" From: Jesper Pedersen Organization: JBoss, by Red Hat Message-ID: <55F99C65.4070209@redhat.com> Date: Wed, 16 Sep 2015 12:44:21 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <20150916162627.GF2086@alap3.anarazel.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Pg-Spam-Score: -6.9 (------) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org Hi, On 09/16/2015 12:26 PM, Andres Freund wrote: > On 2015-09-16 10:37:43 -0400, Jesper Pedersen wrote: >> #ifdef LWLOCK_STATS >> lwstats->spin_delay_count += SpinLockAcquire(&lock->mutex); >> + >> + /* >> + * We scan the list of waiters from the back in order to find >> + * out how many of the same lock type are waiting for a lock. >> + * Similar types have the potential to be groupped together. >> + * > > Except for LW_WAIT_UNTIL_FREE there shouldn't be much in terms of > grouping? Can't you instead iterate and count > counter[waiter->lwWaitMode]++ or so? > The sample report (-c/-j 80) shows in the exclusive report that CLogControlLock has 79 in series, XidGenLock has 80 and ProcArrayLock only 7. For shared CLogControlLock has 63 and ProcArrayLock has 74 (which is also its max queue size). So, I think there is some value in keeping this information separate. Best regards, Jesper -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers