Re: [REVIEW] Re: Compression of full-page-writes - Mailing list pgsql-hackers

From Abhijit Menon-Sen
Subject Re: [REVIEW] Re: Compression of full-page-writes
Date
Msg-id 20140618125534.GA18575@toroid.org
Whole thread Raw
In response to Re: [REVIEW] Re: Compression of full-page-writes  (Rahila Syed <rahilasyed90@gmail.com>)
Responses Re: [REVIEW] Re: Compression of full-page-writes  (Abhijit Menon-Sen <ams@2ndquadrant.com>)
Re: [REVIEW] Re: Compression of full-page-writes  (Pavan Deolasee <pavan.deolasee@gmail.com>)
List pgsql-hackers
At 2014-06-18 18:10:34 +0530, rahilasyed90@gmail.com wrote:
>
> palloc() is disallowed in critical sections and we are already in CS
> while executing this code. So we use malloc().

Are these allocations actually inside a critical section? It seems to me
that the critical section starts further down, but perhaps I am missing
something.

Second, as Andres says, you shouldn't malloc() inside a critical section
either; and anyway, certainly not without checking the return value.

> I am not sure if the change will be a significant improvement from
> performance point of view except it will save few condition checks.

Moving that allocation out of the outer for loop it's currently in is
*nothing* to do with performance, but about making the code easier to
read.

-- Abhijit



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: [REVIEW] Re: Compression of full-page-writes
Next
From: Abhijit Menon-Sen
Date:
Subject: Re: [REVIEW] Re: Compression of full-page-writes