mirror of
				https://github.com/Telecominfraproject/ols-nos.git
				synced 2025-10-30 17:48:09 +00:00 
			
		
		
		
	[kvm] improve the handling of compact_memory during kvm image build (#9184)
Build failed on a Ubuntu 20.04 system with kvm kernel, which does not have the /proc/sys/vm/compact_memory Should check if compact_memory is writeable before doing it. Signed-off-by: Chris Ward <tjcw@uk.ibm.com>
This commit is contained in:
		| @@ -59,7 +59,11 @@ free -m | |||||||
| if [[ "$vs_build_prepare_mem" == "yes" ]]; then | if [[ "$vs_build_prepare_mem" == "yes" ]]; then | ||||||
|     # Force o.s. to drop cache and compact memory so that KVM can get 2G memory |     # Force o.s. to drop cache and compact memory so that KVM can get 2G memory | ||||||
|     bash -c 'echo 1 > /proc/sys/vm/drop_caches' |     bash -c 'echo 1 > /proc/sys/vm/drop_caches' | ||||||
|     bash -c 'echo 1 > /proc/sys/vm/compact_memory' |     # Not all kernels support compact_memory | ||||||
|  |     if [[ -w '/proc/sys/vm/compact_memory' ]] | ||||||
|  |     then	     | ||||||
|  |         bash -c 'echo 1 > /proc/sys/vm/compact_memory' | ||||||
|  |     fi | ||||||
|     free -m |     free -m | ||||||
| fi | fi | ||||||
|  |  | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user
	 Chris Ward
					Chris Ward