Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[vm build] force Linux to drop cache before calling kvm #2717

Merged
merged 2 commits into from
Mar 29, 2019

Conversation

yxieca
Copy link
Contributor

@yxieca yxieca commented Mar 28, 2019

- What I did

KVM need to allocate 2G memory for VS build. The system memory might
be occupied by cache at the moment and doesn't have 2G chunk to give
out. Forcing Kernel to drop cache to boost the chance of getting 2G
memory.

Signed-off-by: Ying Xie ying.xie@microsoft.com

- How to verify it
See if this PR test would pass?

KVM need to allocate 2G memory for this build. The system memory might
be occupied by cache at the moment and doesn't have 2G chunk to give
out. Forcing Kernel to drop cache to boost the chance of getting 2G
memory.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
build_kvm_image.sh Outdated Show resolved Hide resolved
@yxieca
Copy link
Contributor Author

yxieca commented Mar 29, 2019

vsimage build passed. It might have passed anyways since there was 4G free memory available.

  • free -m
    total used free shared buffers cached
    Mem: 32145 27542 4602 1 1420 14174
    -/+ buffers/cache: 11947 20197
    Swap: 0 0 0
  • echo 1
  • sudo tee /proc/sys/vm/drop_caches
    1
  • free -m
    total used free shared buffers cached
    Mem: 32145 13001 19144 1 145 1525
    -/+ buffers/cache: 11330 20815
    Swap: 0 0 0
  • kvm_pid=97081
  • sleep 2.0
  • /usr/bin/kvm -m 2048 -name onie -boot order=cd,once=d -cdrom target/files/onie-recovery-x86_64-kvm_x86_64-r0.iso -device e1000,netdev=onienet -netdev user,id=onienet,hostfwd=:0.0.0.0:3041-:22 -vnc 0.0.0.0:0 -vga std -drive file=target/sonic-vs.img,media=disk,if=virtio,index=0 -drive file=./sonic-installer.img,if=virtio,index=1 -serial telnet:127.0.0.1:9000,server
  • [ -d /proc/97081 ]

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
@lguohan lguohan merged commit 9d6bac5 into sonic-net:master Mar 29, 2019
@yxieca yxieca deleted the build branch March 29, 2019 22:46
@yxieca
Copy link
Contributor Author

yxieca commented Mar 30, 2019

201811 branch PRs were hitting the KVM memory issue due to lack of this change.

yxieca added a commit that referenced this pull request Apr 1, 2019
* [vm build] force Linux to drop cache before calling kvm

KVM need to allocate 2G memory for this build. The system memory might
be occupied by cache at the moment and doesn't have 2G chunk to give
out. Forcing Kernel to drop cache to boost the chance of getting 2G
memory.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

* [make] add option to enable/disable VS build memory preparation

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
tiantianlv pushed a commit to SONIC-DEV/sonic-buildimage that referenced this pull request Apr 10, 2019
* [vm build] force Linux to drop cache before calling kvm

KVM need to allocate 2G memory for this build. The system memory might
be occupied by cache at the moment and doesn't have 2G chunk to give
out. Forcing Kernel to drop cache to boost the chance of getting 2G
memory.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

* [make] add option to enable/disable VS build memory preparation

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
tiantianlv pushed a commit to SONIC-DEV/sonic-buildimage that referenced this pull request Apr 10, 2019
* [vm build] force Linux to drop cache before calling kvm

KVM need to allocate 2G memory for this build. The system memory might
be occupied by cache at the moment and doesn't have 2G chunk to give
out. Forcing Kernel to drop cache to boost the chance of getting 2G
memory.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

* [make] add option to enable/disable VS build memory preparation

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
tiantianlv pushed a commit to SONIC-DEV/sonic-buildimage that referenced this pull request Apr 10, 2019
* [vm build] force Linux to drop cache before calling kvm

KVM need to allocate 2G memory for this build. The system memory might
be occupied by cache at the moment and doesn't have 2G chunk to give
out. Forcing Kernel to drop cache to boost the chance of getting 2G
memory.

Signed-off-by: Ying Xie <ying.xie@microsoft.com>

* [make] add option to enable/disable VS build memory preparation

Signed-off-by: Ying Xie <ying.xie@microsoft.com>
yxieca pushed a commit that referenced this pull request Apr 6, 2023
Why I did it
src/linkmgrd

* 2b81c83 - (HEAD -> 202205, origin/202205) [active-standby] Enforce switchover based on heartbeats when mux probe keeps failing (#184) (5 hours ago) [Jing Zhang]
src/sonic-platform-common

* c401866 - (HEAD -> 202205, origin/202205) Add set/get_lpmode APIs for sff8436 and sff8636 optics (#353) (4 hours ago) [longhuan-cisco]
* ea8331e - implement CMIS set_laser_freq to support 100GHz grid space (#294) (4 hours ago) [ChiouRung Haung]
src/sonic-platform-daemons

* cc32493 - (HEAD -> 202205, origin/202205) Retrieve subport from CONFIG_DB to enable breakout support (#342) (4 hours ago) [mihirpat1]
* 864e589 - Pass grid parameter while calling set_laser_freq (#317) (4 hours ago) [mihirpat1]
src/sonic-swss

* 699477d - (HEAD -> 202205, origin/202205) overlay_dmac change in Vnet configuration. (#2721) (4 hours ago) [siqbal1986]
src/sonic-utilities

* f9f3e7e4 - (HEAD -> 202205, origin/202205) [voq] Add fabric_ns to the ns_list when display_option is DISPLAY_ALL. (#2717) (4 hours ago) [jfeng-arista]
* eb2d9167 - [GCU] Prohibit removal of PFC_WD POLL_INTERVAL field (#2777) (4 hours ago) [isabelmsft]
mihirpat1 pushed a commit to mihirpat1/sonic-buildimage that referenced this pull request Jun 14, 2023
* Update build pipeline to build for Bullseye

With the merge of sonic-net#13294, docker-sonic-vs is
now based on Bullseye. Switch to building for Bullseye to match that
change.

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>

* Reduce dependency list to just development packages

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>

* Update .NET repo URL and package name

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>

---------

Signed-off-by: Saikrishna Arcot <sarcot@microsoft.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants