I have verified the fix using systemd 255.4-1ubuntu8.5 from noble-
proposed:

$ cat > /etc/apt/sources.list.d/proposed.sources << EOF
> Types: deb
URIs: http://archive.ubuntu.com/ubuntu/
Suites: noble-proposed
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
> EOF
$ apt update
Hit:1 http://us.archive.ubuntu.com/ubuntu noble InRelease
Get:2 http://us.archive.ubuntu.com/ubuntu noble-updates InRelease [126 kB]      
                                                                                
     
Get:3 http://security.ubuntu.com/ubuntu noble-security InRelease [126 kB]       
                                                                                
     
Get:4 http://archive.ubuntu.com/ubuntu noble-proposed InRelease [265 kB]        
                                                       
Get:5 http://us.archive.ubuntu.com/ubuntu noble-backports InRelease [126 kB]    
                                                                  
Get:6 http://us.archive.ubuntu.com/ubuntu noble-updates/main amd64 Packages 
[663 kB]                                                                        
Hit:7 https://ppa.launchpadcontent.net/enr0n/systemd/ubuntu noble InRelease     
                                         
Get:8 http://us.archive.ubuntu.com/ubuntu noble-updates/main Translation-en 
[156 kB]     
Get:9 http://us.archive.ubuntu.com/ubuntu noble-updates/main amd64 Components 
[120 kB]         
Get:10 http://us.archive.ubuntu.com/ubuntu noble-updates/main Icons (48x48) 
[32.4 kB]            
Get:11 http://us.archive.ubuntu.com/ubuntu noble-updates/main Icons (64x64) 
[47.0 kB]    
Get:12 http://us.archive.ubuntu.com/ubuntu noble-updates/main amd64 c-n-f 
Metadata [10.4 kB]
Get:13 http://us.archive.ubuntu.com/ubuntu noble-updates/restricted amd64 
Packages [473 kB]
Get:14 http://us.archive.ubuntu.com/ubuntu noble-updates/restricted 
Translation-en [91.2 kB]
Get:15 http://us.archive.ubuntu.com/ubuntu noble-updates/restricted amd64 
Components [212 B]
Get:16 http://us.archive.ubuntu.com/ubuntu noble-updates/restricted amd64 c-n-f 
Metadata [424 B]
Get:17 http://us.archive.ubuntu.com/ubuntu noble-updates/universe amd64 
Packages [718 kB]       
Get:18 http://us.archive.ubuntu.com/ubuntu noble-updates/universe 
Translation-en [213 kB]       
Get:19 http://us.archive.ubuntu.com/ubuntu noble-updates/universe amd64 
Components [310 kB]     
Get:20 http://us.archive.ubuntu.com/ubuntu noble-updates/universe Icons (48x48) 
[170 kB]     
Get:21 http://us.archive.ubuntu.com/ubuntu noble-updates/universe Icons (64x64) 
[269 kB]     
Get:22 http://us.archive.ubuntu.com/ubuntu noble-updates/universe amd64 c-n-f 
Metadata [19.9 kB]
Get:23 http://us.archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 
Packages [15.0 kB]      
Get:24 http://us.archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 
Components [940 B]      
Get:25 http://us.archive.ubuntu.com/ubuntu noble-updates/multiverse amd64 c-n-f 
Metadata [552 B]  
Get:26 http://us.archive.ubuntu.com/ubuntu noble-backports/main amd64 
Components [208 B]
Get:27 http://us.archive.ubuntu.com/ubuntu noble-backports/restricted amd64 
Components [212 B]
Get:28 http://us.archive.ubuntu.com/ubuntu noble-backports/universe amd64 
Components [21.0 kB]
Get:29 http://us.archive.ubuntu.com/ubuntu noble-backports/multiverse amd64 
Components [212 B]
Get:30 http://security.ubuntu.com/ubuntu noble-security/main amd64 Packages 
[489 kB]
Get:31 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 Packages [173 
kB]      
Get:32 http://archive.ubuntu.com/ubuntu noble-proposed/main Translation-en 
[51.1 kB]       
Get:33 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 Components 
[61.1 kB]          
Get:34 http://archive.ubuntu.com/ubuntu noble-proposed/main Icons (48x48) [14.1 
kB]                
Get:35 http://archive.ubuntu.com/ubuntu noble-proposed/main Icons (64x64) [17.4 
kB]
Get:36 http://archive.ubuntu.com/ubuntu noble-proposed/main Icons (64x64@2) [29 
B]             
Get:37 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 c-n-f 
Metadata [3,768 B] 
Get:38 http://archive.ubuntu.com/ubuntu noble-proposed/restricted amd64 
Packages [52.6 kB]
Get:39 http://archive.ubuntu.com/ubuntu noble-proposed/restricted 
Translation-en [13.5 kB]
Get:40 http://archive.ubuntu.com/ubuntu noble-proposed/restricted amd64 
Components [212 B]    
Get:41 http://archive.ubuntu.com/ubuntu noble-proposed/restricted Icons (48x48) 
[29 B]
Get:42 http://security.ubuntu.com/ubuntu noble-security/main Translation-en 
[100 kB]     
Get:43 http://security.ubuntu.com/ubuntu noble-security/main amd64 Components 
[7,140 B]       
Get:44 http://security.ubuntu.com/ubuntu noble-security/main amd64 c-n-f 
Metadata [5,892 B]
Get:45 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 
Packages [473 kB]       
Get:46 http://archive.ubuntu.com/ubuntu noble-proposed/restricted Icons (64x64) 
[29 B]    
Get:47 http://archive.ubuntu.com/ubuntu noble-proposed/restricted Icons 
(64x64@2) [29 B]            
Get:48 http://archive.ubuntu.com/ubuntu noble-proposed/restricted amd64 c-n-f 
Metadata [360 B]
Get:49 http://archive.ubuntu.com/ubuntu noble-proposed/universe amd64 Packages 
[651 kB]   
Get:50 http://security.ubuntu.com/ubuntu noble-security/restricted 
Translation-en [91.2 kB]       
Get:51 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 
Components [212 B]               
Get:52 http://security.ubuntu.com/ubuntu noble-security/restricted amd64 c-n-f 
Metadata [424 B]
Get:53 http://security.ubuntu.com/ubuntu noble-security/universe amd64 Packages 
[561 kB]
Get:54 http://security.ubuntu.com/ubuntu noble-security/universe Translation-en 
[149 kB]           
Get:55 http://security.ubuntu.com/ubuntu noble-security/universe amd64 
Components [51.9 kB]               
Get:56 http://security.ubuntu.com/ubuntu noble-security/universe amd64 c-n-f 
Metadata [13.5 kB]                
Get:57 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 
Packages [12.2 kB]
Get:58 http://archive.ubuntu.com/ubuntu noble-proposed/universe Translation-en 
[78.9 kB]      
Get:59 http://security.ubuntu.com/ubuntu noble-security/multiverse 
Translation-en [2,940 B]   
Get:60 http://archive.ubuntu.com/ubuntu noble-proposed/universe amd64 
Components [66.1 kB]    
Get:61 http://archive.ubuntu.com/ubuntu noble-proposed/universe Icons (48x48) 
[46.7 kB]    
Get:62 http://archive.ubuntu.com/ubuntu noble-proposed/universe Icons (64x64) 
[89.4 kB]
Get:63 http://archive.ubuntu.com/ubuntu noble-proposed/universe Icons (64x64@2) 
[29 B]
Get:64 http://archive.ubuntu.com/ubuntu noble-proposed/universe amd64 c-n-f 
Metadata [10.7 kB]
Get:65 http://archive.ubuntu.com/ubuntu noble-proposed/multiverse amd64 
Components [212 B]
Get:66 http://archive.ubuntu.com/ubuntu noble-proposed/multiverse Icons (48x48) 
[29 B]
Get:67 http://archive.ubuntu.com/ubuntu noble-proposed/multiverse Icons (64x64) 
[29 B]
Get:68 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 
Components [212 B]
Get:69 http://security.ubuntu.com/ubuntu noble-security/multiverse amd64 c-n-f 
Metadata [356 B]
Get:70 http://archive.ubuntu.com/ubuntu noble-proposed/multiverse Icons 
(64x64@2) [29 B]
Get:71 http://archive.ubuntu.com/ubuntu noble-proposed/multiverse amd64 c-n-f 
Metadata [344 B]
Fetched 7,264 kB in 2s (3,344 kB/s)              
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
113 packages can be upgraded. Run 'apt list --upgradable' to see them.
$ apt install systemd -t noble-proposed -y
Reading package lists... Done
Building dependency tree... Done
Reading state information... Done
The following additional packages will be installed:
  libnss-systemd libpam-systemd libsystemd-shared libsystemd0 libudev1 
systemd-dev systemd-oomd systemd-resolved systemd-sysv systemd-timesyncd udev
Suggested packages:
  systemd-container systemd-homed systemd-userdbd systemd-boot libqrencode4
The following packages will be upgraded:
  libnss-systemd libpam-systemd libsystemd-shared libsystemd0 libudev1 systemd 
systemd-dev systemd-oomd systemd-resolved systemd-sysv systemd-timesyncd udev
12 upgraded, 0 newly installed, 0 to remove and 218 not upgraded.
Need to get 8,902 kB of archives.
After this operation, 4,096 B of additional disk space will be used.
Get:1 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 systemd-dev 
all 255.4-1ubuntu8.5 [104 kB]
Get:2 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 
systemd-timesyncd amd64 255.4-1ubuntu8.5 [35.3 kB]
Get:3 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 
systemd-resolved amd64 255.4-1ubuntu8.5 [296 kB]
Get:4 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 systemd-oomd 
amd64 255.4-1ubuntu8.5 [39.2 kB]
Get:5 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 
libsystemd-shared amd64 255.4-1ubuntu8.5 [2,069 kB]
Get:6 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 libsystemd0 
amd64 255.4-1ubuntu8.5 [433 kB]
Get:7 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 systemd-sysv 
amd64 255.4-1ubuntu8.5 [11.9 kB]
Get:8 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 libnss-systemd 
amd64 255.4-1ubuntu8.5 [159 kB]
Get:9 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 libpam-systemd 
amd64 255.4-1ubuntu8.5 [235 kB]
Get:10 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 systemd amd64 
255.4-1ubuntu8.5 [3,471 kB]
Get:11 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 udev amd64 
255.4-1ubuntu8.5 [1,874 kB]
Get:12 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 libudev1 
amd64 255.4-1ubuntu8.5 [175 kB]
Fetched 8,902 kB in 1s (6,369 kB/s) 
(Reading database ... 188976 files and directories currently installed.)
Preparing to unpack .../0-systemd-dev_255.4-1ubuntu8.5_all.deb ...
Unpacking systemd-dev (255.4-1ubuntu8.5) over (255.4-1ubuntu8.5~ppa1) ...
Preparing to unpack .../1-systemd-timesyncd_255.4-1ubuntu8.5_amd64.deb ...
Unpacking systemd-timesyncd (255.4-1ubuntu8.5) over (255.4-1ubuntu8.5~ppa1) ...
Preparing to unpack .../2-systemd-resolved_255.4-1ubuntu8.5_amd64.deb ...
Unpacking systemd-resolved (255.4-1ubuntu8.5) over (255.4-1ubuntu8.5~ppa1) ...
Preparing to unpack .../3-systemd-oomd_255.4-1ubuntu8.5_amd64.deb ...
Unpacking systemd-oomd (255.4-1ubuntu8.5) over (255.4-1ubuntu8.5~ppa1) ...
Preparing to unpack .../4-libsystemd-shared_255.4-1ubuntu8.5_amd64.deb ...
Unpacking libsystemd-shared:amd64 (255.4-1ubuntu8.5) over 
(255.4-1ubuntu8.5~ppa1) ...
Preparing to unpack .../5-libsystemd0_255.4-1ubuntu8.5_amd64.deb ...
Unpacking libsystemd0:amd64 (255.4-1ubuntu8.5) over (255.4-1ubuntu8.5~ppa1) ...
Setting up libsystemd0:amd64 (255.4-1ubuntu8.5) ...
(Reading database ... 188976 files and directories currently installed.)
Preparing to unpack .../0-systemd-sysv_255.4-1ubuntu8.5_amd64.deb ...
Unpacking systemd-sysv (255.4-1ubuntu8.5) over (255.4-1ubuntu8.5~ppa1) ...
Preparing to unpack .../1-libnss-systemd_255.4-1ubuntu8.5_amd64.deb ...
Unpacking libnss-systemd:amd64 (255.4-1ubuntu8.5) over (255.4-1ubuntu8.5~ppa1) 
...
Preparing to unpack .../2-libpam-systemd_255.4-1ubuntu8.5_amd64.deb ...
Unpacking libpam-systemd:amd64 (255.4-1ubuntu8.5) over (255.4-1ubuntu8.5~ppa1) 
...
Preparing to unpack .../3-systemd_255.4-1ubuntu8.5_amd64.deb ...
Unpacking systemd (255.4-1ubuntu8.5) over (255.4-1ubuntu8.5~ppa1) ...
Preparing to unpack .../4-udev_255.4-1ubuntu8.5_amd64.deb ...
Unpacking udev (255.4-1ubuntu8.5) over (255.4-1ubuntu8.5~ppa1) ...
Preparing to unpack .../5-libudev1_255.4-1ubuntu8.5_amd64.deb ...
Unpacking libudev1:amd64 (255.4-1ubuntu8.5) over (255.4-1ubuntu8.5~ppa1) ...
Setting up libudev1:amd64 (255.4-1ubuntu8.5) ...
Setting up systemd-dev (255.4-1ubuntu8.5) ...
Setting up libsystemd-shared:amd64 (255.4-1ubuntu8.5) ...
Setting up systemd (255.4-1ubuntu8.5) ...
Setting up systemd-timesyncd (255.4-1ubuntu8.5) ...
Setting up udev (255.4-1ubuntu8.5) ...
Setting up systemd-oomd (255.4-1ubuntu8.5) ...
Setting up systemd-resolved (255.4-1ubuntu8.5) ...
Setting up systemd-sysv (255.4-1ubuntu8.5) ...
Setting up libnss-systemd:amd64 (255.4-1ubuntu8.5) ...
Setting up libpam-systemd:amd64 (255.4-1ubuntu8.5) ...
Processing triggers for libc-bin (2.39-0ubuntu8.3) ...
Processing triggers for man-db (2.12.0-4build2) ...
Processing triggers for dbus (1.14.10-4ubuntu4.1) ...
Processing triggers for initramfs-tools (0.142ubuntu25.2) ...
update-initramfs: Generating /boot/initrd.img-6.8.0-47-generic
$ apt policy systemd
systemd:
  Installed: 255.4-1ubuntu8.5
  Candidate: 255.4-1ubuntu8.5
  Version table:
 *** 255.4-1ubuntu8.5 100
        100 http://archive.ubuntu.com/ubuntu noble-proposed/main amd64 Packages
        100 /var/lib/dpkg/status
     255.4-1ubuntu8.5~ppa1 500
        500 https://ppa.launchpadcontent.net/enr0n/systemd/ubuntu noble/main 
amd64 Packages
     255.4-1ubuntu8.4 500
        500 http://us.archive.ubuntu.com/ubuntu noble-updates/main amd64 
Packages
     255.4-1ubuntu8 500
        500 http://us.archive.ubuntu.com/ubuntu noble/main amd64 Packages

$ systemd-run -u test-memory-ksm.service --wait -p MemoryKSM=yes /usr/bin/true
Running as unit: test-memory-ksm.service; invocation ID: 
05930adfe3704479b14c0dcc3dc0e35d
Finished with result: success
Main processes terminated with: code=exited/status=0
Service runtime: 12ms
CPU time consumed: 10ms
Memory peak: 1.0M
Memory swap peak: 0B
$ journalctl -u test-memory-ksm.service
Nov 19 10:20:08 ubuntu systemd[1]: Started test-memory-ksm.service - 
/usr/bin/true.
Nov 19 10:20:08 ubuntu systemd[1]: test-memory-ksm.service: Deactivated 
successfully.


** Tags removed: verification-needed verification-needed-noble
** Tags added: verification-done verification-done-noble

-- 
You received this bug notification because you are a member of Ubuntu
Touch seeded packages, which is subscribed to systemd in Ubuntu.
https://bugs.launchpad.net/bugs/2081192

Title:
  Cannot change MemoryKSM in systemd units

Status in systemd package in Ubuntu:
  Fix Released
Status in systemd source package in Noble:
  Fix Committed

Bug description:
  [Impact]

  Units with MemoryKSM=yes setting will fail to start with an "Invalid
  argument" error. This makes the setting unusable on Noble.

  [Test Plan]

  On Noble, start a systemd service with MemoryKSM=yes:

  $ systemd-run -u test-memory-ksm.service --wait -p MemoryKSM=yes
  /usr/bin/true

  On an affected system, this will fail immediately. Inspecting the
  journal will show why, e.g.:

  $ journalctl -u test-memory-ksm.service
  Oct 17 10:37:20 six (sleep)[1494131]: test-memory-ksm.service: Failed to set 
KSM: Invalid argument
  Oct 17 10:37:20 six systemd[1]: Started test-memory-ksm.service - 
/usr/bin/sleep infinity.
  Oct 17 10:37:20 six systemd[1]: test-memory-ksm.service: Main process exited, 
code=exited, status=245/KSM
  Oct 17 10:37:20 six systemd[1]: test-memory-ksm.service: Failed with result 
'exit-code'.

  On a patched system, the unit should start/exit normally.

  [Where problems could occur]

  This patch simply adds missing arguments to the prctl call for
  PR_SET_MEMORY_MERGE. Problems would be isolated to the MemoryKSM=
  setting.

  [Other information]

  The patch is from upstream:
  
https://github.com/systemd/systemd/commit/9bb89a55a235a3c64ec099bb86296d7fd1bb3302

  [Original Description]

  In one of my working unit (service), I try to toggle the MemoryKSM
  boolean setting.

  Using any of:

  MemoryKSM=yes
  MemoryKSM=on
  MemoryKSM=true
  MemoryKSM=1

  Results in:

  Sep 19 16:16:56 systemd[1]: Started XXX.service - XXX service.
  Sep 19 16:16:56 (e_server)[4487]: XXX.service: Failed to set KSM: Invalid 
argument
  Sep 19 16:16:56 systemd[1]: XXX.service: Main process exited, code=exited, 
status=245/KSM
  Sep 19 16:16:56 systemd[1]: XXX.service: Failed with result 'exit-code'.

  The following lines allow the service to start:

  MemoryKSM="yes"
  MemoryKSM="on"
  MemoryKSM="true"
  MemoryKSM="1"

  but still, MemoryKSM stays off:

  # systemctl show XXX.service | grep MemoryKSM
  MemoryKSM=no

  KSM is activated in my running kernel:
  # cat /boot/config-$(uname -r) | grep KSM
  CONFIG_KSM=y

  Using prctl (libc6 2.39-0ubuntu8.3) to toggle KSM inside a running
  process also works. I can read and set the memory_merge switch.

  ProblemType: Bug
  DistroRelease: Ubuntu 24.04
  Package: systemd 255.4-1ubuntu8.4
  ProcVersionSignature: Ubuntu 6.8.0-45.45-generic 6.8.12
  Uname: Linux 6.8.0-45-generic x86_64
  ApportVersion: 2.28.1-0ubuntu3.1
  Architecture: amd64
  CasperMD5CheckResult: unknown
  CloudArchitecture: x86_64
  CloudBuildName: server
  CloudID: openstack
  CloudName: openstack
  CloudPlatform: openstack
  CloudSerial: 20240612
  CloudSubPlatform: metadata (http://169.254.169.254)
  Date: Thu Sep 19 16:06:51 2024
  Lsusb:
   Bus 001 Device 001: ID 1d6b:0001 Linux Foundation 1.1 root hub
   Bus 001 Device 002: ID 0627:0001 Adomax Technology Co., Ltd QEMU Tablet
   Bus 001 Device 003: ID 0627:0001 Adomax Technology Co., Ltd QEMU Tablet
  Lsusb-t:
   /:  Bus 001.Port 001: Dev 001, Class=root_hub, Driver=uhci_hcd/2p, 12M
       |__ Port 001: Dev 002, If 0, Class=Human Interface Device, 
Driver=usbhid, 12M
       |__ Port 002: Dev 003, If 0, Class=Human Interface Device, 
Driver=usbhid, 12M
  MachineType: OpenStack Foundation OpenStack Nova
  ProcKernelCmdLine: BOOT_IMAGE=/vmlinuz-6.8.0-45-generic 
root=UUID=1c5e2fdc-a746-403d-9fc0-71af31bc9c19 ro console=tty1 console=ttyS0
  SourcePackage: systemd
  UpgradeStatus: No upgrade log present (probably fresh install)
  dmi.bios.date: 02/06/2015
  dmi.bios.release: 0.0
  dmi.bios.vendor: EFI Development Kit II / OVMF
  dmi.bios.version: 0.0.0
  dmi.chassis.type: 1
  dmi.chassis.vendor: QEMU
  dmi.chassis.version: pc-q35-4.2
  dmi.modalias: 
dmi:bvnEFIDevelopmentKitII/OVMF:bvr0.0.0:bd02/06/2015:br0.0:svnOpenStackFoundation:pnOpenStackNova:pvr26.2.3:cvnQEMU:ct1:cvrpc-q35-4.2:sku:
  dmi.product.family: Virtual Machine
  dmi.product.name: OpenStack Nova
  dmi.product.version: 26.2.3
  dmi.sys.vendor: OpenStack Foundation

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/systemd/+bug/2081192/+subscriptions


-- 
Mailing list: https://launchpad.net/~touch-packages
Post to     : touch-packages@lists.launchpad.net
Unsubscribe : https://launchpad.net/~touch-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to