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

/proc/sys/vm/compact_memory doesn't exist in Ubuntu 20.04, delete ref… #9079

Closed
wants to merge 1 commit into from

Conversation

tjcw
Copy link
Contributor

@tjcw tjcw commented Oct 27, 2021

…erence to it.

Why I did it

Builld was failing for PLATFORM=vs on a Ubuntu 20.04 system

How I did it

Edited scripts/build_kvm_image.sh to knock out line which was referring to /proc/sys/vm/compact_memory

How to verify it

Eyeball the affected script

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106

Description for the changelog

A picture of a cute animal (not mandatory but encouraged)

@lguohan
Copy link
Collaborator

lguohan commented Oct 27, 2021

not sure if this is true.

root@ubuntu:/home/ubuntu# uname -a
Linux ubuntu 5.4.0-1045-raspi #49-Ubuntu SMP PREEMPT Wed Sep 29 17:49:16 UTC 2021 aarch64 aarch64 aarch64 GNU/Linux
root@ubuntu:/home/ubuntu# cat /etc/os-release 
NAME="Ubuntu"
VERSION="20.04.1 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.1 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
root@ubuntu:/home/ubuntu# ls -l /proc/sys/vm/compact_memory 
--w------- 1 root root 0 Oct 27 19:56 /proc/sys/vm/compact_memory

@lguohan
Copy link
Collaborator

lguohan commented Oct 27, 2021

what kernel are you using? i suggest to check if the file exists or not, if not then we can skip.

@tjcw
Copy link
Contributor Author

tjcw commented Oct 27, 2021

I have

openstack@tjcw-sonic-build:~$ uname -a
Linux tjcw-sonic-build 5.4.0-1047-kvm #49-Ubuntu SMP Mon Sep 20 21:27:33 UTC 2021 x86_64 x86_64 x86_64 GNU/Linux
openstack@tjcw-sonic-build:~$ ls -l /proc/sys/vm/compact_memory
ls: cannot access '/proc/sys/vm/compact_memory': No such file or directory
openstack@tjcw-sonic-build:~$ cat /etc/os-release
NAME="Ubuntu"
VERSION="20.04.3 LTS (Focal Fossa)"
ID=ubuntu
ID_LIKE=debian
PRETTY_NAME="Ubuntu 20.04.3 LTS"
VERSION_ID="20.04"
HOME_URL="https://www.ubuntu.com/"
SUPPORT_URL="https://help.ubuntu.com/"
BUG_REPORT_URL="https://bugs.launchpad.net/ubuntu/"
PRIVACY_POLICY_URL="https://www.ubuntu.com/legal/terms-and-policies/privacy-policy"
VERSION_CODENAME=focal
UBUNTU_CODENAME=focal
openstack@tjcw-sonic-build:~$

I'm using the kvm kernel, i.e. the one designed for running in a VM, becuase I'm running my builds in the IBM cloud. Maybe the kvm kernel accounts for the difference.

Probably best to check for the existence of the file and only write it if it's there.

@saiarcot895
Copy link
Contributor

@tjcw on your system, what's the output of grep CONFIG_COMPACTION /boot/config-$(uname -r)? I'm guessing that it will say something like # CONFIG_COMPACTION is not set, or CONFIG_COMPACTION=n.

That kernel config controls whether or not /proc/sys/vm/compact_memory is available. Because of this, I agree that this should be changed to check if the file is there, and, if so, write to that file.

@tjcw
Copy link
Contributor Author

tjcw commented Oct 27, 2021

openstack@tjcw-sonic-build:~$ grep CONFIG_COMPACTION /boot/config-$(uname -r)
# CONFIG_COMPACTION is not set
openstack@tjcw-sonic-build:~$ 

@saiarcot895
Copy link
Contributor

That confirms it. The kernel that you're running has that config disabled, so /proc/sys/vm/compact_memory doesn't exist.

…erence to it.

improve the handling of compact_memory

Should check that compact_memory is writeable

Signed-off-by: Chris Ward <[email protected]>
@tjcw
Copy link
Contributor Author

tjcw commented Nov 5, 2021

Closing to revise to check for file being writeable

@tjcw tjcw closed this Nov 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants