What is Write-Combined memory

http://makble.com/what-is-writecombined-memory

What is Write-Combined memory

Write-Combining can batches writes to the same cache line so they can be transferred in a single bus clock.

The data will be combined and stored in the write combine buffer, and then write is in burst mode.

By combining small individual memory transfers into one large (and continuous) one. This technique allows systems to nearly saturate the AGP/PCI bus and can transfer twice as much or more data than systems that do not have write combining.

The normal way:

 

Combine Write

 

The Weak Ordering problem

Write-Combining is weak ordering which makes it cannot be used for general memory access. The common case to use combine write is deal with frame buffer of video memory which does not need strong ordering.

Using _mm_stream_si128 intrinsics

In C++ code, there are some intrinsics function can help to utilize the write combine buffers.

 
void _mm_stream_si128(__m128i *p, __m128i a)
 
 

Stores the data in a to the address p without polluting the caches. If the cache line containing address p is already in the cache, the cache will be updated. Address p must be 16-byte aligned.

 

 

 

The cache line is the unit of CPU cache and memory transfer. CPU cache implemented by hash map, each bucket is typically 64 bytes. This is so called cache line.

A variable of type __m128i maps to the XMM[0-7] registers. Every register has 128 bits(16 bytes).

Store Intrinsics

Reference

Write-combining

Why SSDs Care About What You Write: Fragmentation & Write Combining

 

The basic idea of write combining

Copying Accelerated Video Decode Frame Buffers

Write Combining by Martin Thompson

评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值