欧美三区_成人在线免费观看视频_欧美极品少妇xxxxⅹ免费视频_a级毛片免费播放_鲁一鲁中文字幕久久_亚洲一级特黄

64位中使用AWE分配內(nèi)存

系統(tǒng) 1842 0

We have already talked about Windows AWE mechanism on 32 bit and how SQL Server utilizes it. Today I would like to go over AWE & related mechanism on 64 bit platforms.

我們已經(jīng)談過(guò)windows AWE 在32bit 中sql server 如何利用。下面是AWE在64位環(huán)境的相關(guān)性
?
To some people it comes as a surprise that AWE mechanism is still present and actually could be useful on 64 bit platforms. As you remember the mechanism consists of two parts allocating physical memory and mapping it to the given process's VAS. The advantage of allocation mechanism is that once physical memory is allocated operating system can't reclaim it until either the process is terminated or the process frees memory back to the OS. This feature allows an application to control and even avoid paging altogether. Advantage of mapping/unmapping mechanism is that the same physical page could be mapped into different VAS's regions. As you imaging unmapping is not necessary on 64 bit platforms since we have enough VAS to accommodate all of existing physical memory.
?
對(duì)于有些人會(huì)很驚奇AWE機(jī)制任然存在并且在64位中是可用的。這個(gè)機(jī)制分為2部分分配內(nèi)存和映射到給定的VAS中。這種分配機(jī)制的好處是不會(huì)被系統(tǒng)回收,直到進(jìn)程終止或者進(jìn)程內(nèi)存被釋放會(huì)操作系統(tǒng)。這特性允許應(yīng)用程序控制并且避免分頁(yè)。映射和非映射機(jī)制的好處是相同的物理頁(yè)可以被映射到不同VAS空間。你可以想象在64bit中非映射是沒(méi)有必要的,因?yàn)?4bit 有足夠的vas容納所有物理內(nèi)存。
?

From Operating System theory, OS implements a page table entry, PTE, to describe a mapping of a page in VAS to physical page. Internally physical page is described by page frame number, PFN. Given PFN one can derive complete information about physical page it represents. For example PFN shows to which NUMA node the particular page belongs. OS has a database, collection of PFNs that it manages.??If page in VAS is committed, it has PTE which might or might not point to given PFN.??Conceptually, page that PTE represents can be either in memory or not, for example swapped out to disk. In the former case it is bound to a given PFN and in latter it is not. In its turn, once a physical page is bound to page in VAS, its PFN points back to PTE.

來(lái)自操作系統(tǒng)的理論,操作系統(tǒng)引入一個(gè)頁(yè)表項(xiàng),PTE,描述了一個(gè)在VAS中的頁(yè)到物理頁(yè)的映射。物理頁(yè)被頁(yè)幀號(hào)描述,PFN。給定的PFN可以導(dǎo)出所有它代表的物理頁(yè)。例如PFN顯示了指定的物理也屬于那個(gè)NUMA節(jié)點(diǎn)。OS有一個(gè)數(shù)據(jù)庫(kù)收集了PFN并且管理它。如果頁(yè)在VAS中已經(jīng)被提交了,PTE可能指向了一個(gè)給定的PFN。理論上PTE上的頁(yè)可能在內(nèi)存上也可能沒(méi)有,如切換到了磁盤(pán)上。先前的例子頁(yè)綁定了一個(gè)PFN,并且之后不綁定了。一旦物理頁(yè)被綁定到VAS中,PFN就反向指向到PTE。
?

When OS commits, frees, pages out/in a given PTE or needs to derive some information about it, for example NUMA residency, it has to acquire process's working set lock - to guarantee stability of PTE to PFN binding. This lock is a rather expensive and might hurt scalability of the process. Latter versions of Windows made this lock as light as possible but avoiding still will benefit application's scalability..

當(dāng)OS提交,釋放,切換一個(gè)給定的PTE或者取一些頁(yè)的信息。比如NUMA位置,頁(yè)不得不請(qǐng)求進(jìn)程工作集鎖,來(lái)保證PTE到PFN之間的穩(wěn)定性。這個(gè)鎖定比較昂貴并且可能會(huì)損害進(jìn)程的擴(kuò)展性。之后的windows版本會(huì)使這個(gè)鎖越來(lái)越輕量但是不能保證會(huì)對(duì)程序的擴(kuò)展性有好處。
?

When allocating physical pages utilizing AWE mechanism we are given a set of PFN entries directly from PFN database - remember that you should not manipulate or modify set of entries you get back??nor can you rely on values you get back. OS is required to take a PFN database lock when allocating PFN entries. Using AWE map mechanism you can map allocated PFN entries to the process's VAS. When mapping occurs PTEs are allocated, bound to PFNs and marked as locked. In this case OS needs to acquire process's working set lock only ones. When mapping regular pages, OS does it on demand and hence will have to acquire both working set and PFN database lock for every page. Since pages are locked in memory, OS will ignore these PTEs during??paging process.

當(dāng)物理內(nèi)存通過(guò)AWE分配的時(shí)候,我們獲取的PFN項(xiàng)直接來(lái)至于PFN數(shù)據(jù)庫(kù)——記住你不能刪除或者修改你獲取的項(xiàng),也不能依賴(lài)你獲取的值。當(dāng)PFN被分配的時(shí)候,OS會(huì)請(qǐng)求鎖定PFN數(shù)據(jù)庫(kù)。使用AWE映射機(jī)制你可以把PFN映射到進(jìn)程的VAS中。當(dāng)映射發(fā)生PTE就會(huì)被分配,綁定到PFN并且標(biāo)記被鎖定。這個(gè)時(shí)候OS只需要獲取進(jìn)程的工作集鎖。當(dāng)映射常規(guī)也的時(shí)候,OS按需求,并且會(huì)請(qǐng)求工作集鎖和PFN數(shù)據(jù)庫(kù)鎖。因?yàn)轫?yè)在內(nèi)存中是鎖定的,在分頁(yè)進(jìn)程的時(shí)候OS會(huì)忽略這些PTE。
?

On 64 bit platforms it is better to refer to such pages as locked pages - please don't confuse them with pages locked through VirtualLock API. As described above locked pages have two major properties - they are not considered for paging by OS and during allocation they acquire both working set and PFN database lock only ones.?

在64bit平臺(tái)上, 這些頁(yè)被鎖定會(huì)更好——不要喝通過(guò)VirtualLock API混淆。頁(yè)鎖定有2個(gè)主要的屬性——他們不會(huì)被OS分頁(yè)并且在分配的時(shí)候只會(huì)請(qǐng)求工作集鎖和PFN鎖的一個(gè)。
?

The first property has implicit implication on high end hardware such as NUMA. It provides explicit memory residency. Remember that OS commits a page on demand. To allocate physical memory, it will use a node on which a thread touching memory is running.??Latter on, the page can be swapped out by OS. Next time it will be brought up into memory, OS will again allocate physical page from the node a thread touching memory is running on. In this case a node could be completely different??from original one. Such behavior makes hard for applications to rely on page's NUMA residency. Locked pages solve this problem by removing themselves from paging altogether.??Moreover Windows 2003 SP1 introduced a new API - QueryWorkingSetEx. It allows to query extended??information about PTE's PFN.??In order to find out real page residency you should use this API. When pages are locked you need to it only ones. Otherwise you will have to do it periodically since residency of the page can actually change.

?第一個(gè)屬性隱約的涉及到了高端的硬件如NUMA。它提供了顯示的內(nèi)存位置。記住OS按需求提交了頁(yè)。分配內(nèi)存的時(shí)候會(huì)在線(xiàn)程觸及到的內(nèi)存節(jié)點(diǎn)中分配內(nèi)存。
?

The second property - taking both working set and PFN's database lock only ones enables applications to perform faster and better scalable ramp up.

?第二個(gè)屬性——只要獲取工作集鎖和PFN數(shù)據(jù)庫(kù)鎖一個(gè),可以讓?xiě)?yīng)用程序運(yùn)行的更快并且有更好的擴(kuò)展性。
?

On NUMA SQL Server' Buffer Pool marks each allocated page with its node residency. It leverages QueryWorkingSetEx to accomplish it.??Once page is allocated it calls the API to find??out page residency.???It does it only once. Therefore enabling locked pages for SQL server on 64 bit platform??will improve SQL Server ramp up time and will improve performance & scalability over longer period of time. When running SQL Server with locked pages enabled you shouldn't be worried about overall system performance due to memory starvation - SQL Server participates in OS's paging mechanism by listening on OS's memory notification API's and shrinks its working set accordingly.

?在NUMA SQL Server buffer pool 中標(biāo)記了每個(gè)分配也的節(jié)點(diǎn)位置。使用QueryWorkingSetEx來(lái)完成。一旦頁(yè)分配,就會(huì)調(diào)用api查找出頁(yè)所在節(jié)點(diǎn),只運(yùn)行一次。因此SQL Server 64位平臺(tái)會(huì)提高SQL Server 加速并且會(huì)提高性能和可擴(kuò)展性。當(dāng)運(yùn)行sql server鎖定頁(yè)你不需要擔(dān)心因?yàn)閮?nèi)存不足引起的性能問(wèn)題——sql server 會(huì)監(jiān)聽(tīng)OS內(nèi)存通知api參與分頁(yè)并且壓縮工作集。
?

Let us summarize now - on 64 bit platform, locked pages, awe mechanism, enable better application's scalability and performance both during ramp up time and over long period of time. However, keep in mind that an application is still required to implement a way of responding to memory pressure to avoid starving the whole system for memory.

總結(jié)一下:在64位的平臺(tái)上,鎖定頁(yè),AWE分配機(jī)制,可以讓?xiě)?yīng)用程序有更好的擴(kuò)展性和性能。但是記住一個(gè)應(yīng)用程序也要增強(qiáng)相應(yīng)內(nèi)存壓力的能力來(lái)避免整個(gè)系統(tǒng)的內(nèi)存不足。

64位中使用AWE分配內(nèi)存


更多文章、技術(shù)交流、商務(wù)合作、聯(lián)系博主

微信掃碼或搜索:z360901061

微信掃一掃加我為好友

QQ號(hào)聯(lián)系: 360901061

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描下面二維碼支持博主2元、5元、10元、20元等您想捐的金額吧,狠狠點(diǎn)擊下面給點(diǎn)支持吧,站長(zhǎng)非常感激您!手機(jī)微信長(zhǎng)按不能支付解決辦法:請(qǐng)將微信支付二維碼保存到相冊(cè),切換到微信,然后點(diǎn)擊微信右上角掃一掃功能,選擇支付二維碼完成支付。

【本文對(duì)您有幫助就好】

您的支持是博主寫(xiě)作最大的動(dòng)力,如果您喜歡我的文章,感覺(jué)我的文章對(duì)您有幫助,請(qǐng)用微信掃描上面二維碼支持博主2元、5元、10元、自定義金額等您想捐的金額吧,站長(zhǎng)會(huì)非常 感謝您的哦!!!

發(fā)表我的評(píng)論
最新評(píng)論 總共0條評(píng)論
主站蜘蛛池模板: 91一区二区三区 | 久久综合丝袜长腿丝袜 | 国产视频在线观看免费 | 亚洲国产成人av好男人在线观看 | 日韩国产欧美在线观看 | 人人做人人爽人人爱 | 日本wwwwwwwww| 国产精品久久久AV久久久 | 欧美性高清视频免费看www | 爱福利视频导航 | 久草在线精品视频 | 国产精品视频分类 | 日韩 亚洲 欧美 中文 高清 | 久综合色 | 亚洲一区自拍 | 小明看看在线视频 | 日产乱码卡一卡2卡三卡四麻豆 | 国产精品高清在线观看 | 青娱乐免费 | 亚洲视频在线免费看 | 欧美精品久久久 | 亚洲欧美日韩中文字幕在线一区 | 日韩在线观看视频一区二区三区 | 亚洲国产欧美久久香综合 | 久草精品在线 | 明明电影高清在线观看 | 欧美一区二区三区在线看 | 亚洲欧美中文日韩综合 | 免费免费视频片在线观看 | 综合二区 | 精品视频第一页 | 中文精品久久 | 日本在线亚州精品视频在线 | 日韩精品极品视频在线观看免费 | 日韩精品不卡 | 国产综合精品 | 97超级碰碰 | 国产日韩一区二区 | 草草影院地址 | 国产短视频精品区第一页 | 亚洲日本人成中文字幕 |