Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UuMwP-0002Sj-Ld for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jul 2013 13:17:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1UuMwP-0002Yv-11 for pgsql-hackers@arkaria.postgresql.org; Wed, 03 Jul 2013 13:17:49 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UuMwO-0002Yp-5Y for pgsql-hackers@postgresql.org; Wed, 03 Jul 2013 13:17:48 +0000 Received: from szxga02-in.huawei.com ([119.145.14.65]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1UuMwJ-0002HX-HR for pgsql-hackers@postgresql.org; Wed, 03 Jul 2013 13:17:47 +0000 Received: from 172.24.2.119 (EHLO szxeml209-edg.china.huawei.com) ([172.24.2.119]) by szxrg02-dlp.huawei.com (MOS 4.3.4-GA FastPath queued) with ESMTP id BED02860; Wed, 03 Jul 2013 21:11:33 +0800 (CST) Received: from SZXEML410-HUB.china.huawei.com (10.82.67.137) by szxeml209-edg.china.huawei.com (172.24.2.184) with Microsoft SMTP Server (TLS) id 14.1.323.7; Wed, 3 Jul 2013 21:11:31 +0800 Received: from blrprnc09ns (10.18.96.98) by szxeml410-hub.china.huawei.com (10.82.67.137) with Microsoft SMTP Server id 14.1.323.7; Wed, 3 Jul 2013 21:11:29 +0800 From: Amit Kapila To: "'Simon Riggs'" CC: "'Robert Haas'" , "'Andres Freund'" , "'Greg Smith'" , "'PostgreSQL-development'" References: <51928CDA.7030009@2ndQuadrant.com> <5194eb32.85d60e0a.1c17.2253SMTPIN_ADDED_BROKEN@mx.google.com> <519b1d5f.9025b40a.2d07.ffffed08SMTPIN_ADDED_BROKEN@mx.google.com> <519f060c.cade440a.493f.ffffb080SMTPIN_ADDED_BROKEN@mx.google.com> <51b033cf.25dc420a.1edd.ffff8fd9SMTPIN_ADDED_BROKEN@mx.google.com> <51cada34.c31b0f0a.2927.7bfbSMTPIN_ADDED_BROKEN@mx.google.com> <4174155236987592579@unknownmsgid> <1325109027881441764@unknownmsgid> In-Reply-To: Subject: Re: Move unused buffers to freelist Date: Wed, 3 Jul 2013 18:41:28 +0530 Message-ID: <004501ce77ee$d4e7dcd0$7eb79670$@kapila@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Office Outlook 12.0 Thread-Index: Ac536m58Gh68hB5ATPC8xI1WuHRgUQAA+8rQ Content-Language: en-us X-Originating-IP: [10.18.96.98] X-CFilter-Loop: Reflected X-Pg-Spam-Score: -1.6 (-) 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 On Wednesday, July 03, 2013 6:10 PM Simon Riggs wrote: On 3 July 2013 12:56, Amit Kapila wrote: =A0 >>>My perspectives here would be >>> * BufFreelistLock is a huge issue. Finding a next victim block needs to be an O(1) operation, yet it is currently much worse than that. Measuring >>> contention on that lock hides that problem, since having shared buffers lock up for 100ms or more but only occasionally is a huge problem, even if it >>> doesn't occur frequently enough for the averaged contention to show as an issue. =A0>> To optimize finding next victim buffer, I am planning to run the clock >> sweep in background. Apart from that do you have any idea to make it closer >> to O(1)? > Yes, I already posted patches to attentuate the search time. Please check back last few CFs of 9.3 Okay, I got it. I think you mean 9.2.=20 Patch: Reduce locking on StrategySyncStart()=20 https://commitfest.postgresql.org/action/patch_view?id=3D743=20 Patch: Reduce freelist locking during DROP TABLE/DROP DATABASE=20 https://commitfest.postgresql.org/action/patch_view?id=3D744 I shall pay attention to patches and the discussion during my work on enhancement of this patch. With Regards, Amit Kapila. --=20 Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers