Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1b2Qiv-0005sm-2v for pgsql-hackers@arkaria.postgresql.org; Mon, 16 May 2016 22:10:49 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1b2Qiu-0004Id-LH for pgsql-hackers@arkaria.postgresql.org; Mon, 16 May 2016 22:10:48 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b2QhX-00029y-P5 for pgsql-hackers@postgresql.org; Mon, 16 May 2016 22:09:23 +0000 Received: from hook.sigaev.ru ([93.180.27.50]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1b2QhU-0004dI-Ff for pgsql-hackers@postgresql.org; Mon, 16 May 2016 22:09:23 +0000 Received: from xor.sai.msu.ru (unknown [24.114.252.229]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: teodor) by hook.sigaev.ru (Postfix) with ESMTPSA id 01314B19192; Tue, 17 May 2016 01:09:18 +0300 (MSK) Subject: Re: [COMMITTERS] pgsql: Correctly align page's images in generic wal API To: Michael Paquier Cc: PostgreSQL mailing lists References: From: Teodor Sigaev Message-ID: <573A450D.6090607@sigaev.ru> Date: Tue, 17 May 2016 01:09:17 +0300 User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:42.0) Gecko/20100101 Firefox/42.0 SeaMonkey/2.39 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=KOI8-R; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -3.3 (---) 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 > Instead of allocating this memory unconditionally for each buffer, > wouldn't it be better to set all the page pointers to NULL in > GenericXLogStart and allocate memory only once a buffer is registered > in GenericXLogRegisterBuffer when finding a free slot? This patch is > wasting many cycles. GenericXLogRegisterBuffer() could be called in another MemoryContext what can be a reason for strange bugs. Right now only a few pages could be involved in one round of GenericWal. I don't believe that such allocation could be a reason of noticable performance degradation. Although I didn't check that. -- Teodor Sigaev E-mail: teodor@sigaev.ru WWW: http://www.sigaev.ru/ -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers