×

根据 Linux 的操作系统探究存储器特性及性能

消耗积分:0 | 格式:rar | 大小:0.2 MB | 2017-09-13

分享资料个

  探究存储器特性以分析和预测应用处理器性能及功耗

  关键字:存储器 CPU 多媒体

  作者:柏瑜

  Marvell 公司应用处理器主任工程师

  由于超快的 CPU 内核与相对慢的存储器之间的速度差距在日渐增大,存储器系统可能成为当前制约系统性能的主要瓶颈。此外,低功耗是另一个重要的设计考虑,尤其在电池供电设备与日俱增的情况下更是如此。低功耗意味着更长的电池续航时间和设备使用时间。在常见的应用场合,存储器功耗通常占了应用处理器功耗相当大的一部分,而且,随着存储器设计日益复杂、容量增大、分层增多,存储器功耗往往会迅速增加。因此,降低存储器功耗非常有利于延长电池续航时间。为了更好地了解各种应用的固有行为,有必要探究存储器的特性、建立存储器模型,以判断应用是否涉及频繁的存储器存取操作,甚至帮助预测应用的性能。

  本文提供了一种简单、经济的方法,能以可接受的精确度动态地表征应用的计算及存储器的构成。

  描述存储器特性的方法

  如果不涉及存储器操作,那么 CPU 利用率应该随着 CPU 内核的频率呈线性关系,而应用成本(定义为 CPU 利用率和 CPU 频率的乘积)应该保持恒定。但在考虑存储器存取以后,CPU 利用率就不再随内核频率呈线性关系了。在频率较高时,存储器对性能的影响往往更大,因为 CPU 要用更多的 CPU 周期等待存储器的响应(这里我们假定,存储器频率不随 CPU 频率而变)。从这种意义上,应用可以分为两种类型:计算限定型和存储器限定型。

  接下来,我们来讲述如何用三种不同的方法表征存储器特性,并帮助确定应用的 CPU 利用率。在此,硬件性能信

  息是通过查看性能监视单元(Performance Monitoring Unit,简称 PMU)来收集的。因此,Marvell 的方法仅适用于有 PMU 硬件支持的系统。

  1. 整体数据缓存失效率:直觉上,较高的数据缓存失效率意味着更大的存储器流量。为了获得数据缓存失效率的数值,我们需要监视一级数据缓存和二级数据缓存(如果有的话)的存取操作和失效总数。

  2. 主存储器访问率:外部存储器控制器的占用率直接表明了存储器的利用率。为了得 到主存储器访问率数值,必须收集两种 PMU 信息:存储器控制器被占用的周期总数;监视窗口中的周期总数。

  3. 数据停顿率:流水线停顿主要由数据相关性引起,而数据不可用的原因是存储器存取速度远比 CPU 速度低。因此,流水线的停顿次数反映了存储器的流量情况。此外,流水线停顿次数还表明了存储器存取的重要性。并不是每次存储器存取都对最终性能有关键影响,因此,持续跟踪因数据相关性对性能造成影响的存储器存取操作,是相当有用的。使用这种方法,可以监视由数据相关性引起停顿的事件情况。此外,必须记录总的周期数,以计算每个窗口中的数据停顿率。

  这些不同的方法从不同角度反映出存储器的特性。我们能以合理的开销使用一种方法或组合使用多种方法,以更有效地进行性能分析、做出更准确的预测。

  在测试中,我们使用了 Marvell 的应用处理器,运行基于 Linux 的操作系统,采用 QVGA LCD 显示器作为测试平台。该应用处理器包括两级缓存。在本次研究中,我们专注于 MP3、AAC+和 H.264 解码器。

声明:本文内容及配图由入驻作者撰写或者入驻合作网站授权转载。文章观点仅代表作者本人,不代表电子发烧友网立场。文章及其配图仅供工程师学习之用,如有内容侵权或者其他违规问题,请联系本站处理。 举报投诉

评论(0)
发评论

下载排行榜

全部0条评论

快来发表一下你的评论吧 !

'+ '

'+ '

'+ ''+ '
'+ ''+ ''+ '
'+ ''+ '' ); $.get('/article/vipdownload/aid/'+webid,function(data){ if(data.code ==5){ $(pop_this).attr('href',"/login/index.html"); return false } if(data.code == 2){ //跳转到VIP升级页面 window.location.href="//m.lene-v.com/vip/index?aid=" + webid return false } //是会员 if (data.code > 0) { $('body').append(htmlSetNormalDownload); var getWidth=$("#poplayer").width(); $("#poplayer").css("margin-left","-"+getWidth/2+"px"); $('#tips').html(data.msg) $('.download_confirm').click(function(){ $('#dialog').remove(); }) } else { var down_url = $('#vipdownload').attr('data-url'); isBindAnalysisForm(pop_this, down_url, 1) } }); }); //是否开通VIP $.get('/article/vipdownload/aid/'+webid,function(data){ if(data.code == 2 || data.code ==5){ //跳转到VIP升级页面 $('#vipdownload>span').text("开通VIP 免费下载") return false }else{ // 待续费 if(data.code == 3) { vipExpiredInfo.ifVipExpired = true vipExpiredInfo.vipExpiredDate = data.data.endoftime } $('#vipdownload .icon-vip-tips').remove() $('#vipdownload>span').text("VIP免积分下载") } }); }).on("click",".download_cancel",function(){ $('#dialog').remove(); }) var setWeixinShare={};//定义默认的微信分享信息,页面如果要自定义分享,直接更改此变量即可 if(window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i) == 'micromessenger'){ var d={ title:'根据 Linux 的操作系统探究存储器特性及性能',//标题 desc:$('[name=description]').attr("content"), //描述 imgUrl:'https://'+location.host+'/static/images/ele-logo.png',// 分享图标,默认是logo link:'',//链接 type:'',// 分享类型,music、video或link,不填默认为link dataUrl:'',//如果type是music或video,则要提供数据链接,默认为空 success:'', // 用户确认分享后执行的回调函数 cancel:''// 用户取消分享后执行的回调函数 } setWeixinShare=$.extend(d,setWeixinShare); $.ajax({ url:"//www.lene-v.com/app/wechat/index.php?s=Home/ShareConfig/index", data:"share_url="+encodeURIComponent(location.href)+"&format=jsonp&domain=m", type:'get', dataType:'jsonp', success:function(res){ if(res.status!="successed"){ return false; } $.getScript('https://res.wx.qq.com/open/js/jweixin-1.0.0.js',function(result,status){ if(status!="success"){ return false; } var getWxCfg=res.data; wx.config({ //debug: true, // 开启调试模式,调用的所有api的返回值会在客户端alert出来,若要查看传入的参数,可以在pc端打开,参数信息会通过log打出,仅在pc端时才会打印。 appId:getWxCfg.appId, // 必填,公众号的唯一标识 timestamp:getWxCfg.timestamp, // 必填,生成签名的时间戳 nonceStr:getWxCfg.nonceStr, // 必填,生成签名的随机串 signature:getWxCfg.signature,// 必填,签名,见附录1 jsApiList:['onMenuShareTimeline','onMenuShareAppMessage','onMenuShareQQ','onMenuShareWeibo','onMenuShareQZone'] // 必填,需要使用的JS接口列表,所有JS接口列表见附录2 }); wx.ready(function(){ //获取“分享到朋友圈”按钮点击状态及自定义分享内容接口 wx.onMenuShareTimeline({ title: setWeixinShare.title, // 分享标题 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享给朋友”按钮点击状态及自定义分享内容接口 wx.onMenuShareAppMessage({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 type: setWeixinShare.type, // 分享类型,music、video或link,不填默认为link dataUrl: setWeixinShare.dataUrl, // 如果type是music或video,则要提供数据链接,默认为空 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到QQ”按钮点击状态及自定义分享内容接口 wx.onMenuShareQQ({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到腾讯微博”按钮点击状态及自定义分享内容接口 wx.onMenuShareWeibo({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); //获取“分享到QQ空间”按钮点击状态及自定义分享内容接口 wx.onMenuShareQZone({ title: setWeixinShare.title, // 分享标题 desc: setWeixinShare.desc, // 分享描述 link: setWeixinShare.link, // 分享链接 imgUrl: setWeixinShare.imgUrl, // 分享图标 success: function () { setWeixinShare.success; // 用户确认分享后执行的回调函数 }, cancel: function () { setWeixinShare.cancel; // 用户取消分享后执行的回调函数 } }); }); }); } }); } function openX_ad(posterid, htmlid, width, height) { if ($(htmlid).length > 0) { var randomnumber = Math.random(); var now_url = encodeURIComponent(window.location.href); var ga = document.createElement('iframe'); ga.src = 'https://www1.elecfans.com/www/delivery/myafr.php?target=_blank&cb=' + randomnumber + '&zoneid=' + posterid+'&prefer='+now_url; ga.width = width; ga.height = height; ga.frameBorder = 0; ga.scrolling = 'no'; var s = $(htmlid).append(ga); } } openX_ad(828, '#berry-300', 300, 250);