PostgreSQL10.0preview效能增強-支援64bitatomic
標籤
PostgreSQL , 10.0 , atomic , spinlock
背景
起源
Add a basic atomic ops API abstracting away platform/architecture details.
author Andres Freund <andres@anarazel.de>
Fri, 26 Sep 2014 05:49:05 +0800 (23:49 +0200)
committer Andres Freund <andres@anarazel.de>
Fri, 26 Sep 2014 05:49:05 +0800 (23:49 +0200)
commit b64d92f1a5602c55ee8b27a7ac474f03b7aee340
tree 2ac33fb70d31585297ae8baeb674ef757544a1d7 tree | snapshot
parent 9111d46351e8c3d82452a7454e43ccbf1991b3dc commit | diff
Add a basic atomic ops API abstracting away platform/architecture details.
Several upcoming performance/scalability improvements require atomic
operations. This new API avoids the need to splatter compiler and
architecture dependent code over all the locations employing atomic
ops.
For several of the potential usages it`d be problematic to maintain
both, a atomics using implementation and one using spinlocks or
similar. In all likelihood one of the implementations would not get
tested regularly under concurrency. To avoid that scenario the new API
provides a automatic fallback of atomic operations to spinlocks. All
properties of atomic operations are maintained. This fallback -
obviously - isn`t as fast as just using atomic ops, but it`s not bad
either. For one of the future users the atomics ontop spinlocks
implementation was actually slightly faster than the old purely
spinlock using implementation. That`s important because it reduces the
fear of regressing older platforms when improving the scalability for
new ones.
The API, loosely modeled after the C11 atomics support, currently
provides `atomic flags` and 32 bit unsigned integers. If the platform
efficiently supports atomic 64 bit unsigned integers those are also
provided.
To implement atomics support for a platform/architecture/compiler for
a type of atomics 32bit compare and exchange needs to be
implemented. If available and more efficient native support for flags,
32 bit atomic addition, and corresponding 64 bit operations may also
be provided. Additional useful atomic operations are implemented
generically ontop of these.
The implementation for various versions of gcc, msvc and sun studio have
been tested. Additional existing stub implementations for
* Intel icc
* HUPX acc
* IBM xlc
are included but have never been tested. These will likely require
fixes based on buildfarm and user feedback.
As atomic operations also require barriers for some operations the
existing barrier support has been moved into the atomics code.
Author: Andres Freund with contributions from Oskari Saarenmaa
Reviewed-By: Amit Kapila, Robert Haas, Heikki Linnakangas and Álvaro Herrera
Discussion: CA+TgmoYBW+ux5-8Ja=Mcyuy8=VXAnVRHp3Kess6Pn3DMXAPAEA@mail.gmail.com,
20131015123303.GH5300@awork2.anarazel.de,
20131028205522.GI20248@awork2.anarazel.de
10.0 新增64bit atomic支援
Improve 64bit atomics support.
author Andres Freund <andres@anarazel.de>
Sat, 8 Apr 2017 05:44:47 +0800 (14:44 -0700)
committer Andres Freund <andres@anarazel.de>
Sat, 8 Apr 2017 05:48:11 +0800 (14:48 -0700)
commit e8fdbd58fe564a29977f4331cd26f9697d76fc40
tree 7ac78010b4ad51730fe948a79e7c5d7e5f461981 tree | snapshot
parent 28afad5c85b436f19d9f2c0e3197c7db960fef6f commit | diff
Improve 64bit atomics support.
When adding atomics back in b64d92f1a, I added 64bit support as
optional; there wasn`t yet a direct user in sight. That turned out to
be a bit short-sighted, it`d already have been useful a number of times.
Add a fallback implementation of 64bit atomics, just like the one we
have for 32bit atomics.
Additionally optimize reads/writes to 64bit on a number of platforms
where aligned writes of that size are atomic. This can now be tested
with PG_HAVE_8BYTE_SINGLE_COPY_ATOMICITY.
Author: Andres Freund
Reviewed-By: Amit Kapila
Discussion: https://postgr.es/m/20160330230914.GH13305@awork2.anarazel.de
這個patch的討論,詳見郵件組,本文末尾URL。
PostgreSQL社群的作風非常嚴謹,一個patch可能在郵件組中討論幾個月甚至幾年,根據大家的意見反覆的修正,patch合併到master已經非常成熟,所以PostgreSQL的穩定性也是遠近聞名的。
參考
https://git.postgresql.org/gitweb/?p=postgresql.git;a=commit;h=b64d92f1a
相關文章
- PostgreSQL10.0preview效能增強-hashindexmetapagecache、高併發增強SQLViewIndex
- PostgreSQL10.0preview效能增強-分割槽表效能增強(plan階段加速)SQLView
- PostgreSQL10.0preview效能增強-間接索引(secondaryindex)SQLView索引Index
- PostgreSQL10.0preview功能增強-國際化功能增強,支援ICU(InternationalComponentsforUnicode)SQLViewUnicode
- 震精-PostgreSQL10.0preview效能增強-WARM提升一倍效能SQLView
- PostgreSQL10.0preview效能增強-OLAP提速框架,FasterExpressionEvaluationFramework(含JIT)SQLView框架ASTExpressFramework
- PostgreSQL10.0preview效能增強-pg_xactalign(cacheline對齊)SQLView
- PostgreSQL10.0preview功能增強-增加ProcArrayGroupUpdate等待事件SQLView事件
- PostgreSQL10.0preview功能增強-OLAP增強向量聚集索引(列儲存擴充套件)SQLView索引套件
- PostgreSQL10.0preview功能增強-邏輯複製支援並行COPY初始化資料SQLView並行
- PostgreSQL10.0preview效能增強-(多維分析)更快,更省記憶體hashedaggregationwithgroupingsetsSQLView記憶體Gse
- PostgreSQL10.0preview功能增強-CLOGoldestXID跟蹤SQLViewGo
- PostgreSQL10.0preview功能增強-JSON內容全文檢索SQLViewJSON
- PostgreSQL10.0preview功能增強-後臺執行(pg_background)SQLView
- PostgreSQL10.0preview效能增強-hash,nestloopjoin優化(聰明的優化器是這樣的)SQLViewOOP優化
- PostgreSQL10.0preview功能增強-自由定義統計資訊維度SQLView
- IDEA 2024.1:Spring支援增強、GitHub Action支援增強、更新HTTP Client等IdeaSpringGithubHTTPclient
- PostgreSQL10.0preview功能增強-觸發器函式內建中間表SQLView觸發器函式
- PostgreSQL10.0preview功能增強-兩段式索引(約束欄位+附加欄位)SQLView索引
- PostgreSQL10.0preview功能增強-邏輯訂閱端控制引數解說SQLView
- MySQL 8 複製效能的增強MySql
- PostgreSQL10.0preview功能增強-序列隔離級別預加鎖閾值可控SQLView
- PostgreSQL10.0preview功能增強-客戶端ACL(pg_hba.conf動態檢視)SQLView客戶端
- PostgreSQL10.0preview功能增強-回滾範圍可精細控制(事務、語句級)SQLView
- Mac觸控板增強神器支援big surMac
- OpenCL 增強單work-item kernel效能策略
- Oracle利用Windows的高階特性增強效能OracleWindows
- PostgreSQL10.0preview功能增強-更強可靠性,過去式事務狀態可查(杜絕unknown事務)SQLView
- BetterTouchTool for Mac(觸控板增強神器)支援big surMac
- LightDB23.1新特性支援Oracle hint增強DB2Oracle
- MongoDB增強事務支援,向NewSQL的方向邁進MongoDBSQL
- 用歸納偏置來增強你的模型效能模型
- 微軟Xbox One更新 控制皮膚效能增強微軟
- PostgreSQL10.0preview功能增強-動態檢視pg_stat_activity新增資料庫管理程式資訊SQLView資料庫
- PostgreSQL10.0preview安全增強-任意wal副本數,金融級高可用與可靠性並存需求SQLView
- BetterTouchTool for Mac(觸控板增強神器)支援Monterey 12.xMac
- 深圳市恆訊科技分析如何增強mySQL效能?MySql
- 博雲容器雲升級,強化支援IPv6及多種功能增強