flush cache line dirty bytes

news2024/9/28 0:13:41

结论:

ARM :To mark these lines, each line of the cache has an associated dirty bit (or bits)

所以这个依赖硬件实现,可能只刷出dirty bytes of cache line to memory.有的硬件只有一个dirty bit,所以会刷出整条cache line

x86没有找到官方文档,所以猜测应该也是类似的。

https://developer.arm.com/documentation/den0013/d/Caches/Cache-architecture/A-real-life-example#:~:text=The%20cache%20line%20length%20is%20eight%20words%20%2832,index%20a%20line%20within%20a%20way%20%28bits%20%5B12%3A5%5D%29.

A real-life example

Before going on to look at write buffers, let's consider an example that is more realistic than those shown in the previous two diagrams. Figure 8.7 is a 4-way set associative 32KB data cache, with an 8-word cache line length. This kind of cache structure can be found on the Cortex-A7 or Cortex-A9 processors.

The cache line length is eight words (32 bytes) and you have 4-ways. 32KB divided by 4 (the number of ways), divided by 32 (the number of bytes in each line) gives you a figure of 256 lines in each way. This means that you require eight bits to index a line within a way (bits [12:5]). Here, you must use bits [4:2] of the address to select from the eight words within the line, though the number of bits which are required to index into the line depends on whether you are accessing a word, halfword, or byte. The remaining bits [31:13] in this case will be used as a tag.

Figure 8.7. A 32KB 4-way set associative cache

Documentation – Arm Developer

Invalidating and cleaning cache memory

Cleaning and invalidation can be required when the contents of external memory have been changed and you want to remove stale data from the cache. It can also be required after MMU related activity such as changing access permissions, cache policies, or virtual to physical address mappings.

The word flush is often used in descriptions of clean and invalidate operations. ARM generally uses only the terms clean and invalidate.

  • Invalidation of a cache or cache line means to clear it of data. This is done by clearing the valid bit of one or more cache lines. The cache must always be invalidated after reset as its contents will be undefined. If the cache contains dirty data, it is generally incorrect to invalidate it. Any updated data in the cache from writes to write-back cacheable regions would be lost by simple invalidation.

  • Cleaning a cache or cache line means writing the contents of dirty cache lines out to main memory and clearing the dirty bit(s) in the cache line. This makes the contents of the cache line and main memory coherent with each other. This is only applicable for data caches in which a write-back policy is used. Cache invalidate, and cache clean operations can be performed by cache set, or way, or by virtual address.

https://developer.arm.com/documentation/den0013/d/Caches/Cache-policies/Write-policy#:~:text=The%20cache%20line%20holds%20newer%20data,%20and

  • Write-back. In this case, writes are performed only to the cache, and not to main memory. This means that cache lines and main memory can contain different data. The cache line holds newer data, and main memory contains older data (said to be stale). To mark these lines, each line of the cache has an associated dirty bit (or bits). When a write happens that updates the cache, but not main memory, the dirty bit is set. If the cache later evicts a cache line whose dirty bit is set (a dirty line), it writes the line out to main memory. Using a write-back cache policy can significantly reduce traffic to slow external memory and therefore improve performance and save power. However, if there are other agents in the system that can access memory at the same time as the core, you must consider coherency issues. These are described in Cache coherency.

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.coloradmin.cn/o/2167672.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

1--苍穹外卖-SpringBoot项目介绍及环境搭建 详解

目录 软件开发整体流程 软件开发流程 角色分工 软件环境 苍穹外卖项目介绍 项目介绍 产品原型 技术选型 开发环境搭建 前端环境搭建 后端环境搭建 完善登录功能 导入接口文档 Swagger 介绍 使用方式 常用注解 软件开发整体流程 软件开发流程 需求分析&#x…

Supabase 入门指南

Supabase 是一个开源替代品,用于 Firebase 提供的后端服务。它基于 PostgreSQL,提供实时数据库、身份验证、存储等功能。本文将深入探讨 Supabase 的主要功能,并结合不同场景给出代码实例。 1. 创建 Supabase 项目 首先,访问 S…

Cannon-es物理引擎中物体动力控制的深度探索

本文目录 前言1、cannon-es给物体施加力1.1 前置代码1.2 效果1.3 给小球施加力1. applyForce效果 2. applyImpulse效果 3. applyLocalImpulse效果 4. applyTorque效果 区别总结 前言 在三维物理引擎的世界里,Cannon-ES以其轻量级和高效能著称,为开发者提…

寿司检测系统源码分享

寿司检测检测系统源码分享 [一条龙教学YOLOV8标注好的数据集一键训练_70全套改进创新点发刊_Web前端展示] 1.研究背景与意义 项目参考AAAI Association for the Advancement of Artificial Intelligence 项目来源AACV Association for the Advancement of Computer Vision …

zabbix“专家坐诊”第257期问答

问题一 Q:zabbix5.0监控项里的键值,怎么设置变量值?{#ABC} {$ABC} 都识别不到变量。 A:可以参考一下这个。 问题二 Q:我想问一下用odbc创建监控项,生成了json格式,如何创建一个触发器去判断里面…

精准控制交易亏损:掌握关键止损点设置技巧

前段时间,咱们探讨了开仓的策略,那今天就需要来聊聊止损的技巧了。一个好的开始很重要,但知道何时止损也是同样关键。市场波动大,机会稍纵即逝。当趋势变得不明确时,止损可以帮助我们管理风险,防止损失加剧…

Spring Cloud Gateway 之动态uri 自定义过滤器

背景:第三方公司 请求本公司入参和出参一样的同一个接口,根据业务类型不一样需要不同业务微服务处理 ,和第三方公司协商在请求头中加入业务类型方便我公司在网关成分发请求。 1:在spring cloud gateway yml 中加入路由 重点是 -…

STL——map和set【map和set的介绍和使用】【multimap和multiset】

目录 map和set1.关联式容器2.键值对3.树形结构的关联式容器3.1set3.1.1set的介绍3.1.2set的使用3.1.2.1set的模版参数列表3.1.2.2set的构造3.1.2.3set的迭代器3.1.2.4set基本接口的使用3.1.2.5set使用案例 3.2map3.2.1map介绍3.2.2map的使用3.2.2.1map的构造3.2.2.2map的迭代器…

一个必会算法模型,XGBoost !!

大家好,今天咱们来聊聊XGBoost ~ XGBoost(Extreme Gradient Boosting)是一种集成学习算法,是梯度提升树的一种改进。它通过结合多个弱学习器(通常是决策树)来构建一个强大的集成模型。 XGBoost 的核心原理…

数据结构练习题————(二叉树)——考前必备合集!

今天在牛客网和力扣上带来了数据结构中二叉树的进阶练习题 1.二叉搜索树与双向链表———二叉搜索树与双向链表_牛客题霸_牛客网 (nowcoder.com) 2.二叉树遍历————二叉树遍历_牛客题霸_牛客网 (nowcoder.com) 3.二叉树的层序遍历————102. 二叉树的层序遍历 - 力扣&am…

C# 一键清空控件值

_场景:_在任何一个Form表单的操作页面或者数据台账的查询页面,基本都会看到一个清除的按钮,其功能就是用来清除我们需要抛弃的已经写入到控件内的数据。如果一个个控件来处理的话,想必会非常麻烦,而且系统不单单只是一…

杭州算力小镇:AI泛化解锁新机遇,探寻AI Agent 迭代新路径

人工智能技术不断迭代,重点围绕着两个事情,一是数据,二是算力。 算法的迭代推动着AI朝向多模态的方向发展,使之能够灵活应对不同领域的不同任务,模型的任务执行能力大大提升,人工智能泛化能力被推上高潮。…

scala 2.12 error: value foreach is not a member of Object

如图所示:在scala 2.11的时候下面的不报错,但是在2.12下报错了 在scala2.12环境下错误如下: 经过查找资料得到:df 后面加上rdd 即可

kafka下载配置

下载安装 参开kafka社区 zookeeperkafka消息队列群集部署https://apache.csdn.net/66c958fb10164416336632c3.html 下载 kafka_2.12-3.2.0安装包快速下载地址分享 官网下载链接地址: 官网下载地址:https://kafka.apache.org/downloads 官网呢下载慢…

详细解读,F5服务器负载均衡的技术优势

在现代大规模、高流量的网络使用场景中,为应对高并发和海量数据的挑战,服务器负载均衡技术应运而生。但凡知道服务器负载均衡这一名词的,基本都对F5有所耳闻,因为负载均衡正是F5的代表作,换句通俗易懂的话来说&#xf…

需求: 通过后台生成的树形结构,返回给前台用于动态生成表格标题,并将对应标题下面的信息对应起来

1. 如图所以&#xff0c;完成以下内容对应 2. 代码示例如下&#xff0c; 动态生成树形结构列名称&#xff0c;并将表格中存在的值与其对应起来 /*** 查询资源计划列表** param resourcePlan 资源计划* return 资源计划*/Overridepublic Map<String, Object> selectResour…

程序编译的四个阶段

程序编译的四个阶段 #include <stdio.h>int main(){printf("Hello World~");return 0; } hello.c程序的生命周期从一个高级C语言程序开始&#xff0c;这种形式容易被人读懂。 但这无法直接被计算机读懂。为了在系统上运行hello.c程序&#xff0c;每条C语言都…

科研绘图系列:R语言组合多个图形

文章目录 介绍加载R包画图介绍 通过patchworkR包组合多个ggplot数据图形对象。 加载R包 library(ggplot2) library(patchwork)画图 画图theme_set(theme_bw() +theme(

2024年408真题计算机网络篇

1 https://zhuanlan.zhihu.com/p/721169467。最小割可以看作是切断水流的最薄弱环节——通过切断这些关键的“水管”&#xff0c;就可以完全阻止水从源点流到汇点。 在下列二进制数字调制方法中&#xff0c;需要2个不同频率载波 的是 A. ASK B. PSK C. FSK D. DPSK 解答…

Linux终端简介

Linux终端简介 导语基本终端交互终端读写标准/非标准模式重定向处理 终端对话 termios结构模式相关输入模式输出模式控制模式本地模式特殊控制字符终端速度其他函数 终端输出终端类型terminfo 击键动作检测虚拟控制台&伪终端总结参考文献 导语 本章基本是以一个简单的用户…