virtual memory - do_swap
The Versatile board running Linux uses virtual memory.
When a process is using more and more memory, it must swap old memory to disk in order to free space to the new memory.
The same mechanism for virtual memory is also used in memory mapped files. Let us suppose that a large file is mapped into memory. As the memory is being filled, data from memory must be saved in the file.
At first, it should be very easy to accomplish this memory swap, so I asked for some students to run a code like that, but they didn't get it. Then, I asked again in the following year, but they failed too. Next year, I decided to ask for Shibata's team to study it and they managed to see the memory swap. The kernel had to be compiled differently.
In order to compile the kernel:
CONFIG_DEVTMPFS=y
CONFIG_PCI=y
CONFIG_PCI_VERSATILE=y
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=y
In order to debug the kernel you will have to call qemu using the flags -S and -s. You may modify docker_cmd.sh inserting the flags -S and -s.
From now on, please follow the Shibata's team report:
https://drive.google.com/file/d/1fPQ8k4jIDsTTnL5AKW_TNym3Qya5at1k/view?usp=sharing
When a process is using more and more memory, it must swap old memory to disk in order to free space to the new memory.
The same mechanism for virtual memory is also used in memory mapped files. Let us suppose that a large file is mapped into memory. As the memory is being filled, data from memory must be saved in the file.
At first, it should be very easy to accomplish this memory swap, so I asked for some students to run a code like that, but they didn't get it. Then, I asked again in the following year, but they failed too. Next year, I decided to ask for Shibata's team to study it and they managed to see the memory swap. The kernel had to be compiled differently.
In order to compile the kernel:
- In /Downloads/pcs3746-sistemas-operacionais/1/linux create the file .config-fragment containing:
CONFIG_DEVTMPFS=y
CONFIG_PCI=y
CONFIG_PCI_VERSATILE=y
CONFIG_VIRTIO_BLK=y
CONFIG_VIRTIO_PCI=y
CONFIG_VIRTIO_BALLOON=y
- Merge .config to .config-fragment through: ~/Downloads/pcs3746-sistemas-operacionais/1/linux$ ../../4/merge_config.sh
- Run: :~/Downloads/pcs3746-sistemas-operacionais/4$ ./run.sh
In order to debug the kernel you will have to call qemu using the flags -S and -s. You may modify docker_cmd.sh inserting the flags -S and -s.
From now on, please follow the Shibata's team report:
https://drive.google.com/file/d/1fPQ8k4jIDsTTnL5AKW_TNym3Qya5at1k/view?usp=sharing
Comentários
Postar um comentário