[Bug 1078165] Re: zram-config fails to start/install on a system with more then 30 processors

Lenin 1078165 at bugs.launchpad.net
Wed Dec 19 13:08:44 UTC 2018


I have 40 core machines, but I only get /dev/zram0 .. 25 used.

# lsb_release -d
Description:    Ubuntu 18.04.1 LTS

# systemctl --all --failed
  UNIT                LOAD   ACTIVE SUB    DESCRIPTION                                                               
Ï zram-config.service loaded failed failed Initializes zram swaping    

# systemctl status zram-config.service
Ï zram-config.service - Initializes zram swaping
   Loaded: loaded (/lib/systemd/system/zram-config.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2018-12-19 14:07:29 CET; 3s ago
  Process: 41212 ExecStart=/usr/bin/init-zram-swapping (code=exited, status=255)
 Main PID: 41212 (code=exited, status=255)

Dec 19 14:07:29 host init-zram-swapping[41212]: no label, UUID=49e2e5a0-af6f-46e9-9cff-4df9be04acc5
Dec 19 14:07:29 host init-zram-swapping[41212]: swapon: /dev/zram38: swapon failed: Operation not permitted
Dec 19 14:07:29 host init-zram-swapping[41212]: sh: echo: I/O error
Dec 19 14:07:29 host init-zram-swapping[41212]: mkswap: /dev/zram39: warning: wiping old swap signature.
Dec 19 14:07:29 host init-zram-swapping[41212]: Setting up swapspace version 1, size = 400.8 MiB (420233216 byte
Dec 19 14:07:29 host init-zram-swapping[41212]: no label, UUID=e6b6cd37-8036-4466-a98d-df3e15af5626
Dec 19 14:07:29 host init-zram-swapping[41212]: swapon: /dev/zram39: swapon failed: Operation not permitted
Dec 19 14:07:29 host systemd[1]: zram-config.service: Main process exited, code=exited, status=255/n/a
Dec 19 14:07:29 host systemd[1]: zram-config.service: Failed with result 'exit-code'.
Dec 19 14:07:29 host systemd[1]: Failed to start Initializes zram swaping.

-- 
You received this bug notification because you are a member of Ubuntu
Foundations Bugs, which is subscribed to zram-config in Ubuntu.
https://bugs.launchpad.net/bugs/1078165

Title:
  zram-config fails to start/install on a system with more then 30
  processors

Status in zram-config package in Ubuntu:
  Confirmed

Bug description:
  I have an dual processor "Intel(R) Xeon(R) CPU E5-2650 0 @ 2.00GHz".

  Its an octo core with hyper-thread so the number of virtual processors are 32:
  # grep -c ^processor /proc/cpuinfo
  32

  zram fails to install and start. from dmesg:

  [20817.608907] zram: Creating 32 devices ...
  [20817.621309] Adding 514360k swap on /dev/zram0.  Priority:5 extents:1 across:514360k SS
  [20817.624251] Adding 514360k swap on /dev/zram1.  Priority:5 extents:1 across:514360k SS
  [20817.627307] Adding 514360k swap on /dev/zram2.  Priority:5 extents:1 across:514360k SS
  [20817.630403] Adding 514360k swap on /dev/zram3.  Priority:5 extents:1 across:514360k SS
  [20817.633359] Adding 514360k swap on /dev/zram4.  Priority:5 extents:1 across:514360k SS
  [20817.636437] Adding 514360k swap on /dev/zram5.  Priority:5 extents:1 across:514360k SS
  [20817.639563] Adding 514360k swap on /dev/zram6.  Priority:5 extents:1 across:514360k SS
  [20817.642648] Adding 514360k swap on /dev/zram7.  Priority:5 extents:1 across:514360k SS
  [20817.645693] Adding 514360k swap on /dev/zram8.  Priority:5 extents:1 across:514360k SS
  [20817.648791] Adding 514360k swap on /dev/zram9.  Priority:5 extents:1 across:514360k SS
  [20817.651829] Adding 514360k swap on /dev/zram10.  Priority:5 extents:1 across:514360k SS
  [20817.654847] Adding 514360k swap on /dev/zram11.  Priority:5 extents:1 across:514360k SS
  [20817.657859] Adding 514360k swap on /dev/zram12.  Priority:5 extents:1 across:514360k SS
  [20817.660907] Adding 514360k swap on /dev/zram13.  Priority:5 extents:1 across:514360k SS
  [20817.663990] Adding 514360k swap on /dev/zram14.  Priority:5 extents:1 across:514360k SS
  [20817.666961] Adding 514360k swap on /dev/zram15.  Priority:5 extents:1 across:514360k SS
  [20817.669740] Adding 514360k swap on /dev/zram16.  Priority:5 extents:1 across:514360k SS
  [20817.672784] Adding 514360k swap on /dev/zram17.  Priority:5 extents:1 across:514360k SS
  [20817.675825] Adding 514360k swap on /dev/zram18.  Priority:5 extents:1 across:514360k SS
  [20817.678807] Adding 514360k swap on /dev/zram19.  Priority:5 extents:1 across:514360k SS
  [20817.681866] Adding 514360k swap on /dev/zram20.  Priority:5 extents:1 across:514360k SS
  [20817.684797] Adding 514360k swap on /dev/zram21.  Priority:5 extents:1 across:514360k SS
  [20817.687597] Adding 514360k swap on /dev/zram22.  Priority:5 extents:1 across:514360k SS
  [20817.690546] Adding 514360k swap on /dev/zram23.  Priority:5 extents:1 across:514360k SS
  [20817.693530] Adding 514360k swap on /dev/zram24.  Priority:5 extents:1 across:514360k SS
  [20817.696615] Adding 514360k swap on /dev/zram25.  Priority:5 extents:1 across:514360k SS
  [20817.699563] Adding 514360k swap on /dev/zram26.  Priority:5 extents:1 across:514360k SS
  [20817.702580] Adding 514360k swap on /dev/zram27.  Priority:5 extents:1 across:514360k SS
  [20817.705844] init: zram-config pre-start process (7513) terminated with status 255

  From my tests I see that the maximum number of swaps linux accepts to
  create is 29. I already had 1 swap partition so zram-config fails to
  start trying to create the 28th extent.

  I made a patch to zram-config.conf that, before starting zram-config,
  counts how many swap spaces are already configured and reduce them
  from the number of extents to create:

  patch:
  # diff -u zram-config.conf.dpkg-dist zram-config.conf
  --- zram-config.conf.dpkg-dist	2012-01-09 11:29:00.000000000 -0200
  +++ zram-config.conf	2012-11-13 02:10:30.122396348 -0200
  @@ -6,6 +6,8 @@
   pre-start script
     # load dependency modules
     NRDEVICES=$(grep -c ^processor /proc/cpuinfo | sed 's/^0$/1/')
  +  NRSWAPS=$(($(cat /proc/swaps | wc -l)+$NRDEVICES))
  +  if [ $NRSWAPS>=30 ]; then NRDEVICES=$((30+$NRDEVICES-$NRSWAPS)); fi
     if modinfo zram | grep -q ' zram_num_devices:' 2>/dev/null; then
       MODPROBE_ARGS="zram_num_devices=${NRDEVICES}"
     elif modinfo zram | grep -q ' num_devices:' 2>/dev/null; then

  I have tested on a 32 core and 4 core machines with 1 swap partition
  and no error at start.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/zram-config/+bug/1078165/+subscriptions



More information about the foundations-bugs mailing list