Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit34db06e

Browse files
committed
shm_mq: Reduce spinlock usage.
Previously, mq_bytes_read and mq_bytes_written were protected by thespinlock, but that turns out to cause pretty serious spinlockcontention on queries which send many tuples through a Gather orGather Merge node. This patches changes things so that we insteadread and write those values using 8-byte atomics. Since mq_bytes_readcan only be changed by the receiver and mq_bytes_written can only bechanged by the sender, the only purpose of the spinlock is to preventreads and writes of these values from being torn on platforms where8-byte memory access is not atomic, making the conversion fairlystraightforward.Testing shows that this produces some slowdown if we're using emulated64-bit atomics, but since they should be available on any platformwhere performance is a primary concern, that seems OK. It's faster,sometimes a lot faster, on platforms where such atomics are available.Patch by me, reviewed by Andres Freund, who also suggested thedesign. Also tested by Rafia Sabih.Discussion:http://postgr.es/m/CA+TgmoYuK0XXxmUNTFT9TSNiBtWnRwasBcHHRCOK9iYmDLQVPg@mail.gmail.com
1 parent2b8c94e commit34db06e

File tree

1 file changed

+129
-122
lines changed

1 file changed

+129
-122
lines changed

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp