2016-01-07 balloon set_config invoke

来源:互联网 发布:龙管家网络计费系统 编辑:程序博客网 时间:2024/06/04 08:39

balloon set_config invoke

Modern Operating System: Memory Management

No Memory Abastraction

  • 单进程
  • 多进程:页机制,PSW,保护位,静态重定位
  • 在嵌入式系统中,依然有很多没有内存抽象

A Memory Abstraction:Address Spaces

Two problems:protection and multi-process

  • The Notion of an Adress Space:Base and Limit Registers,dynamic relocation
  • Swapping:memory compaction
  • Managing Free Memory
    • bitmaps
    • linked lists:first fit,next fit,best fit,worst fit,quick fit
  • Virtual Memory

    • Paging:MMU,pages,page frames,present/absent bit,page fault,page table
    • Page Tables:Empty,Caching disabled,Referenced,Modified,Protection,Present/absent,Page frame number
    • Speeding Up Paging:fast,and page table is small

      • Translation lookaside buffers:TLB
      • Software TLB Management:less miss,and quick deal miss;software cache
      • soft miss,hard miss
    • Page Tables for Lage Memories:multi-level page tables,inverted page tables
  • Page Swapping Algorithm
    • optimal
    • NRU,FIFO,Second Chance,Clock
    • LRU,NFU,Aging
    • Working set,WSClock

vim 取消高亮

:nohl

QEMU

Enter QEMU console

Ctrl+a c

balloon set_config invoke

qemu/build/x86_64-softmmu/hmp-commands.h    这种全是{},的头文件是用来做什么的?里面的赋值很像是json    {    .name       = "balloon",    .args_type  = "value:M",//此处value依然为MB数    .params     = "target",    .help       = "request VM to change its memory allocation (in MB)",    .mhandler.cmd = hmp_balloon,    },qemu/hmp.c    hmp_balloon()        qmp_balloon(value, &err);//此处的value应该已经转换为字节数为单位了qemu/balloon.c    qmp_balloon()        balloon_event_fn(balloon_opaque,target);    QEMUBalloonEvent *balloon_event_fn    qemu_add_balloon_handler()        balloon_event_fn=event_func;qemu/hw/virtio/virtio-balloon.c    virtio_balloon_device_realize()        ret = qemu_add_balloon_handler(virtio_balloon_to_target,virtio_balloon_stat, s);    virtio_balloon_to_target()        ram_addr_t vm_ram_size = get_current_ram_size();        if (target > vm_ram_size) {            target = vm_ram_size;        }        if (target) {            dev->num_pages = (vm_ram_size - target) >> VIRTIO_BALLOON_PFN_SHIFT;            virtio_notify_config(vdev);        }

USACO Training

USACO新增了三道题目,借此机会在Github建立了algorithm,并且把以前的USACO代码上传了上去。

Memcached

forked memcached, and wget & compiled memcached-1.4.5

随笔

现在流的泪,都是当年脑子进的水。

简单的grep自己都没好好学,找balloon的入口都费了老半天劲,最后还是韬神过来几下就搞定了。知耻而后勇,既然知道了自己的不足,那就抓紧赶上。平时的闲暇时间要找出以前的讲义、作业重新掌握。

0 0
原创粉丝点击