ImageVerifierCode 换一换
格式:DOCX , 页数:11 ,大小:972.40KB ,
资源ID:8327924      下载积分:3 金币
快捷下载
登录下载
邮箱/手机:
温馨提示:
快捷下载时,用户名和密码都是您填写的邮箱或者手机号,方便查询和重复下载(系统自动生成)。 如填写123,账号就是123,密码也是123。
特别说明:
请自助下载,系统不会自动发送文件的哦; 如果您已付费,想二次下载,请登录后访问:我的下载记录
支付方式: 支付宝    微信支付   
验证码:   换一换

加入VIP,免费下载
 

温馨提示:由于个人手机设置不同,如果发现不能下载,请复制以下地址【https://www.bdocx.com/down/8327924.html】到电脑端继续下载(重复下载不扣费)。

已注册用户请登录:
账号:
密码:
验证码:   换一换
  忘记密码?
三方登录: 微信登录   QQ登录  

下载须知

1: 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。
2: 试题试卷类文档,如果标题没有明确说明有答案则都视为没有答案,请知晓。
3: 文件的所有权益归上传用户所有。
4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
5. 本站仅提供交流平台,并不能对任何下载内容负责。
6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

版权提示 | 免责声明

本文(08010211李国龙vm67.docx)为本站会员(b****5)主动上传,冰豆网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对上载内容本身不做任何修改或编辑。 若此文所含内容侵犯了您的版权或隐私,请立即通知冰豆网(发送邮件至service@bdocx.com或直接QQ联系客服),我们立即给予删除!

08010211李国龙vm67.docx

1、08010211李国龙vm67VM6:1. With a linear page table, you need a single register to locate the page table, assuming that hardware does the lookup upon a TLB miss. How many registers do you need to locate a two-level page table? A three-level table?答:无论是多少级的页表,只需一个寄存器。当为线性页表时,寄存器中VPN的长度比较长,当为二级或多级页表时,总的VPN

2、长度是不变的。不同的只是为每一级页表分派了PDI,而随着页表级数增加,每一级的PDI的长度在减小。总的PDI的长度加上PTI的长度与线性页表中VPN的长度是相同的(如下图)。所以不论页表的级数有多少,始终只需要一个寄存器。2. Use the simulator to perform translations given random seeds 0, 1, and 2, and check your answers using the -c flag. How many memory references are needed to perform each lookup?答:取种子Seed

3、为1时为例:pythonpaging-multilevel-translate.py-c116进制pdeptevalue物理地址indexvalidpfnindexvalidpfn0x611c0x1810x210x0810x35080x06bc0x3da80x0f10x560x0d00x7ffaultfault0x17f50x0510x540x1f10x4e1c0x09d50x7f6c0x1f10x7f0x1b00x7ffaultfault0x0bad0x0210x600x1d00x7ffaultfault0x6d600x1b10x420x0b00x7ffaultfault0x2a5b0x0a

4、10x550x1200x7ffaultfault0x4c5e0x1310x780x0200x7f1b0x07b20x25920x0910x1e0x0c10x3dfaultfault0x3e990x0f10x560x1410x4a1e0x09593. Given your understanding of how cache memory works, how do you think memory references to the page table will behave in the cache? Will they lead to lots of cache hits (and th

5、us fast accesses?) Or lots of misses (and thus slow accesses)?答:catchmemory缓存。用来存储近期或者常用的指令或者数据,在多级页表的内存管理中,catchmemory和TLB的作用很相似。我们知道从内存中去数据比从缓存中取数据话费的时间要多得多,那么如果对于近期HIT命中的或者使用频率高页表,我们很可能在接下来会申请。把这些页表存放在TLB即缓存(catchmemory)中,可以大大减少再次访问内存的次数,从而降低时间。VM7:1. Now, we will run the program mem.c but with v

6、ery little memory usage. This can be accomplished by typing ./mem 1 (which uses only 1 MB of memory). How do the CPU usage statistics change when running mem? Do the numbers in the user time column make sense? How does this change when running more than one instance of mem at once?答:vmstat输出的字段说明:Pr

7、ocs(进程):r: 运行队列中进程数量b: 等待IO的进程数量Memory(内存):swpd: 使用虚拟内存大小free: 可用内存大小buff: 用作缓冲的内存大小cache: 用作缓存的内存大小Swap:si: 每秒从交换区写到内存的大小so: 每秒写入交换区的内存大小IO:(现在的Linux版本块的大小为1024bytes)bi: 每秒读取的块数bo: 每秒写入的块数系统:in: 每秒中断数,包括时钟中断。cs: 每秒上下文切换数。CPU(以百分比表示):us: 用户进程执行时间(user time)sy: 系统进程执行时间(system time)id: 空闲时间(包括IO等待时间)

8、wa: 等待IO时间启动vmstat后输出:将mem.c编译成可执行文件:当再启动./mem 1后,vmstat输出:运行mem后与未运行对比发现:1) Procs(进程)中r: 运行队列中进程数量增加;Memory(内存)中free: 可用内存大小与之前相比减小大约1M,因为输入的指令./mem 1(其仅使用1MB的内存);2) CPU使用率:us: 用户进程执行时间明显增大,id: 空闲时间降为0;其中user time是有意义的,代表处于用户模式的时间百分比。3) 当打开的mem超过一个后发现CPU使用率:us: 用户进程执行时间(user time)与之前只开一个相比有些许下降,从运行

9、结果可看出,开一个时us可以达到97%,开两个后只有94%附近,这是因为系统要进行进程间的切换,相应的用户进程执行时间减少。2. Lets now start looking at some of the memory statistics while running mem. Well focus on two columns: swpd (the amount of virtual memory used) and free (the amount of idle memory). Run ./mem 1024 (which allocates 1024 MB) and watch how

10、 these values change. Then kill the running program (by typing control-c) and watch again how the values change. What do you notice about the values? In particular, how does the free column change when the program exits? Does the amount of free memory increase by the expected amount when mem exits?答

11、:下面是运行结果,其中圈出来部分之前是刚开始启动vmstat输出,圈出来部分是再启动一个程序./mem 512(分配512 MB)后输出,圈出来部分后面是杀死启动的程序之后输出情况,我们通过前后对比内存中swpd(使用的虚拟内存量)和free(空闲内存量)这两列的情况。a) 在没有运行时,swpd大约为0(KB),free大约为259496(KB),在运行mem后,swpd迅速增加最后大约保持在555640(KB),free迅速减少最后保持在71000(KB)左右。从这变化可见,在运行mem后,虚拟内存的使用明显增加,可用的空闲内存明显减少。b) 在杀死mem程序后,swpd突然减少到2124

12、60左右(减少了一半),free突然增加到788296左右(增加了约11倍)。c) 退出后空闲内存的大小比原来没运行时的还增大了。3.Well next look at the swap columns (si and so), which indicate how much swapping is taking place to and from the disk. Of course, to activate these, youll need to run mem with large amounts of memory. First, examine how much free mem

13、ory is on your Linux system (for example, by typing cat /proc/meminfo; type man proc for details on the /proc file system and the types of information you can find there). One of the first entries in /proc/meminfo is the total amount of memory in your system. Lets assume its something like 8 GB of m

14、emory; if so, start by running mem 4000 (about 4 GB) and watching the swap in/out columns. Do they ever give non-zero values? Then, try with 5000, 6000, etc. What happens to these values as the program enters the second loop (and beyond), as compared to the first loop? How much data (total) are swap

15、ped in and out during the second, third, and subsequent loops? (do the numbers make sense?)答:通过查看知道Linux上内存总量大约1G,所以我们依次测试./mem 512 600 700。其中si: 每秒从交换区写到内存的大小;so: 每秒写入交换区的内存大小。在内存只是用一半时,只有刚开始的循环si不为0表示有数据从交换区写到内存,后面几乎都为0。在测试测试./mem 600时和测试./mem 512几乎一样,只有刚开始的si大于0有数据从交换区写到内存,后面全为0。在测试测试./mem 700时发现

16、si没有小于0的情况,说明数据忙于在交换区写到内存.4.Do the same experiments as above, but now watch the other statistics (such as CPU utilization, and block I/O statistics). How do they change when mem is running?答:我们从CPU利用率上来进行相似的分析。可以看出当运行mem(内存是600时)后us: 用户进程执行时间(user time)从之前的6%瞬间上升到98%,id: 空闲时间(包括IO等待时间)也瞬间降到0,由此可见此时C

17、PU主要用于用户进程。但是当运行mem(内存是1024时)由上图可以看出CPU wa: 等待IO时间达到90%以上,此时CPU主要用在了等待I/O。5.Now lets examine performance. Pick an input for mem that comfortably fits in memory (say 4000 if the amount of memory on the system is 8 GB). How long does loop 0 take (and subsequent loops 1, 2, etc.)? Now pick a size comfo

18、rtably beyond the size of memory (say 12000 again assuming 8 GB of memory). How long do the loops take here? How do the bandwidth numbers compare? How different is performance when constantly swapping versus fitting everything comfortably in memory? Can you make a graph, with the size of memory used

19、 by mem on the x-axis, and the bandwidth of accessing said memory on the y-axis? Finally, how does the performance of the first loop compare to that of subsequent loops, for both the case where everything fits in memory and where it doesnt?答:因为在Linux下内存是1G,所以用./mem 512来测试适合情况。使用./mem 1024来测试超出内存情况。a

20、) 从上面两次情况我们对比可以发现,当内存为512M时比1024M时的bandwidth快的多。并且在512M时,第一次循环速度最慢也有738.78MB/S,之后都能达到1200多MB/S,而当内存为1024时,第一次循环速度最快也只有93.07MB/S,之后更小达不到10MB/S。b) 为了绘制图形,我们分别取 500,600,700,800,900,1000来测数据,取前三次循环平均值。分配内存大小(MB)Bandwidth(MB/s)5001156.586001024.0870074.3680045.9890041.38100029.12c) 当分配数组大小适合内存时,第0次循环的bandwidth最慢,之后逐渐提升。当分配数组大小超出内存时,第0次循环的bandwidth最快,之后都要慢得多。

copyright@ 2008-2022 冰豆网网站版权所有

经营许可证编号:鄂ICP备2022015515号-1