pg.ddx.io pgsql-committers@postgresql.org mailing list archive
help / color / mirror / Atom feedpgsql: Correctly align page's images in generic wal API
4+ messages / 3 participants
[nested] [flat]
* pgsql: Correctly align page's images in generic wal API
@ 2016-05-16 21:01 Teodor Sigaev <teodor@sigaev.ru>
2016-05-16 21:47 ` Re: [COMMITTERS] pgsql: Correctly align page's images in generic wal API Michael Paquier <michael.paquier@gmail.com>
0 siblings, 1 reply; 4+ messages in thread
From: Teodor Sigaev @ 2016-05-16 21:01 UTC (permalink / raw)
To: pgsql-committers
Correctly align page's images in generic wal API
Page image should be MAXALIGN'ed because existing code could directly align
pointers in page instead of align offset from beginning of page.
Found during play with indexes as extenstion, Alexander Korotkov and me
Branch
------
master
Details
-------
http://git.postgresql.org/pg/commitdiff/7c8345f67f3008a394adccae262f2a2162b6f5c7
Modified Files
--------------
src/backend/access/transam/generic_xlog.c | 14 +++++++++++++-
1 file changed, 13 insertions(+), 1 deletion(-)
--
Sent via pgsql-committers mailing list (pgsql-committers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-committers
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [COMMITTERS] pgsql: Correctly align page's images in generic wal API
2016-05-16 21:01 pgsql: Correctly align page's images in generic wal API Teodor Sigaev <teodor@sigaev.ru>
@ 2016-05-16 21:47 ` Michael Paquier <michael.paquier@gmail.com>
2016-05-16 22:09 ` Re: [COMMITTERS] pgsql: Correctly align page's images in generic wal API Teodor Sigaev <teodor@sigaev.ru>
0 siblings, 1 reply; 4+ messages in thread
From: Michael Paquier @ 2016-05-16 21:47 UTC (permalink / raw)
To: Teodor Sigaev <teodor@sigaev.ru>; +Cc: PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
On Tue, May 17, 2016 at 6:01 AM, Teodor Sigaev <teodor@sigaev.ru> wrote:
> Correctly align page's images in generic wal API
>
> Page image should be MAXALIGN'ed because existing code could directly align
> pointers in page instead of align offset from beginning of page.
>
> Found during play with indexes as extenstion, Alexander Korotkov and me
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.
--
Michael
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: [COMMITTERS] pgsql: Correctly align page's images in generic wal API
2016-05-16 21:01 pgsql: Correctly align page's images in generic wal API Teodor Sigaev <teodor@sigaev.ru>
2016-05-16 21:47 ` Re: [COMMITTERS] pgsql: Correctly align page's images in generic wal API Michael Paquier <michael.paquier@gmail.com>
@ 2016-05-16 22:09 ` Teodor Sigaev <teodor@sigaev.ru>
2016-05-17 15:35 ` Re: Re: [COMMITTERS] pgsql: Correctly align page's images in generic wal API Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 1 reply; 4+ messages in thread
From: Teodor Sigaev @ 2016-05-16 22:09 UTC (permalink / raw)
To: Michael Paquier <michael.paquier@gmail.com>; +Cc: PostgreSQL mailing lists <pgsql-hackers@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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: Re: [COMMITTERS] pgsql: Correctly align page's images in generic wal API
2016-05-16 21:01 pgsql: Correctly align page's images in generic wal API Teodor Sigaev <teodor@sigaev.ru>
2016-05-16 21:47 ` Re: [COMMITTERS] pgsql: Correctly align page's images in generic wal API Michael Paquier <michael.paquier@gmail.com>
2016-05-16 22:09 ` Re: [COMMITTERS] pgsql: Correctly align page's images in generic wal API Teodor Sigaev <teodor@sigaev.ru>
@ 2016-05-17 15:35 ` Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 0 replies; 4+ messages in thread
From: Tom Lane @ 2016-05-17 15:35 UTC (permalink / raw)
To: Teodor Sigaev <teodor@sigaev.ru>; +Cc: Michael Paquier <michael.paquier@gmail.com>; PostgreSQL mailing lists <pgsql-hackers@postgresql.org>
Teodor Sigaev <teodor@sigaev.ru> writes:
>> 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.
You could allocate all the pages in one palloc, though, and then just
set the pointers via address arithmetic.
regards, tom lane
--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2016-05-17 15:35 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2016-05-16 21:01 pgsql: Correctly align page's images in generic wal API Teodor Sigaev <teodor@sigaev.ru>
2016-05-16 21:47 ` Michael Paquier <michael.paquier@gmail.com>
2016-05-16 22:09 ` Teodor Sigaev <teodor@sigaev.ru>
2016-05-17 15:35 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox