博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
What is Write-Combined memory | 合并写
阅读量:2031 次
发布时间:2019-04-28

本文共 1345 字,大约阅读时间需要 4 分钟。

 

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).

Reference

 

 

 

转载地址:http://ovvaf.baihongyu.com/

你可能感兴趣的文章
使用2个MR计算
查看>>
Linux,du、df统计磁盘情况不一致
查看>>
springmvc事务回滚失效
查看>>
Java 8的五大开发技巧
查看>>
多线程中的注意点
查看>>
netty4 Handler的执行顺序
查看>>
ZooKeeper原理及使用
查看>>
guava学习--事件驱动模型
查看>>
guava学习--hashing
查看>>
guava学习--AsyncFunction
查看>>
guava学习--monitor
查看>>
guava学习--FutureCallback
查看>>
golang的数据类型之布尔类型
查看>>
golang的数据类型之字符类型
查看>>
安装MySQL
查看>>
golang简介
查看>>
golang的数据类型之整型类型
查看>>
安装go版本
查看>>
golang的数据类型之基本数据类型的默认值和转换
查看>>
golang的数据类型之浮点类型
查看>>