Re: [systemd-devel] Switch root slowness

2014-10-31 Thread Jan Synacek
Lennart Poettering lenn...@poettering.net writes:
 On Thu, 30.10.14 14:35, Lennart Poettering (lenn...@poettering.net) wrote:
 I wish there was a way how we could use getrandom() in a way like
 /dev/urandom, where we can pull out the non-initialized data
 anyway. In absence of that we can just fallback to /dev/urandom on
 EAGAIN I guess, and always pass GRND_NONBLOCK.

 I have now implemented that. Please test!

 Lennart

It works now, thanks!

-- 
Jan Synacek
Software Engineer, Red Hat


signature.asc
Description: PGP signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


[systemd-devel] Switch root slowness

2014-10-30 Thread Jan Synáček
Hello,

commit 539618a0ddc2dc7f0fbe28de2ae0e07b34c81e60
Author: Lennart Poettering lenn...@poettering.net
Date:   Wed Oct 29 17:06:32 2014 +0100

util: make use of the new getrandom() syscall if it is available when 
needing entropy

Doesn't require an fd, and could be a bit faster, so let's make use of
it, if it is available.

Beginning from this commit, switch root takes about a minute on my machine.

Excerpts from the journal:
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: random: systemd urandom 
read with 10 bits of entropy available
Oct 30 13:08:37 fedora-rawhide-systemd-virt systemd-journal[109]: Journal 
started
Oct 30 13:08:37 fedora-rawhide-systemd-virt dracut-cmdline[105]: dracut-22 
(Rawhide) dracut-038-36.git20140815.fc22
Oct 30 13:08:37 fedora-rawhide-systemd-virt dracut-cmdline[105]: Using kernel 
command line parameters:
Oct 30 13:08:37 fedora-rawhide-systemd-virt systemd-udevd[158]: starting 
version 216

This line is pretty weird too, this commit is after v217 had been tagged.

Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] Initialized drm 1.1.0 
20060810
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] Device Version 0.0
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] Compression level 0 
log level 0
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] Currently using mode 
#0, list at 0x488
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] 12286 io pages at 
offset 0x100
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] 16777216 byte draw 
area at offset 0x0
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] RAM header offset: 
0x3ffe000
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] rom modes offset 
0x488 for 128 modes
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [TTM] Zone  kernel: 
Available graphics memory: 1024780 kiB
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [TTM] Initializing pool 
allocator
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [TTM] Initializing DMA pool 
allocator
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] qxl: 16M of VRAM 
memory size
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] qxl: 63M of IO pages 
memory ready (VRAM domain)
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] qxl: 64M of Surface 
memory size
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] main mem slot 1 
[f400,3ffe000]
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] surface mem slot 2 
[f800,400]
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] Supports vblank 
timestamp caching Rev 2 (21.10.2013).
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] No driver support for 
vblank timestamp query.
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] fb mappable at 
0xF400, size 3145728
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] fb: depth 24, pitch 
4096, width 1024, height 768
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: fbcon: qxldrmfb (fb0) is 
primary device
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: Console: switching to 
colour frame buffer device 128x48
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: qxl :00:02.0: fb0: 
qxldrmfb frame buffer device
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: qxl :00:02.0: 
registered panic notifier
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: [drm] Initialized qxl 0.1.0 
20120117 for :00:02.0 on minor 0
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: PM: Starting manual resume 
from disk
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: PM: Hibernation image 
partition 8:2 present
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: PM: Looking for hibernation 
image.
Oct 30 13:08:37 fedora-rawhide-systemd-virt systemd-fsck[198]: /dev/sda3: 
clean, 83696/853440 files, 1149042/3410688 blocks
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: PM: Image not found (code 
-22)
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: PM: Hibernation image not 
present or could not be loaded.
Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: EXT4-fs (sda3): mounted 
filesystem with ordered data mode. Opts: (null)
Oct 30 13:08:38 fedora-rawhide-systemd-virt systemd[1]: Switching root.
Oct 30 13:08:38 fedora-rawhide-systemd-virt systemd-journal[109]: Journal 
stopped

Hangs here for a while with no output.

Oct 30 13:09:44 fedora-rawhide-systemd-virt systemd-journal[279]: Runtime 
journal is using 8.0M (max allowed 100.0M, trying to leave 150.1M free of 
992.7M available → current limit 100.0M).
Oct 30 13:09:44 fedora-rawhide-systemd-virt systemd-journal[279]: Runtime 
journal is using 8.0M (max allowed 100.0M, trying to leave 150.1M free of 
992.7M available → current limit 100.0M).
Oct 30 13:09:44 fedora-rawhide-systemd-virt systemd-journald[109]: Received 
SIGTERM from PID 1 (systemd).
snip a lot of selinux related stuff
Oct 30 13:09:44 fedora-rawhide-systemd-virt kernel: random: 

Re: [systemd-devel] Switch root slowness

2014-10-30 Thread Dave Reisner
On Thu, Oct 30, 2014 at 01:18:24PM +0100, Jan Synáček wrote:
 Hello,
 
 commit 539618a0ddc2dc7f0fbe28de2ae0e07b34c81e60
 Author: Lennart Poettering lenn...@poettering.net
 Date:   Wed Oct 29 17:06:32 2014 +0100
 
 util: make use of the new getrandom() syscall if it is available when 
 needing entropy
 
 Doesn't require an fd, and could be a bit faster, so let's make use of
 it, if it is available.
 
 Beginning from this commit, switch root takes about a minute on my machine.
 
 Excerpts from the journal:
 Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: random: systemd urandom 
 read with 10 bits of entropy available
 Oct 30 13:08:37 fedora-rawhide-systemd-virt systemd-journal[109]: Journal 
 started
 Oct 30 13:08:37 fedora-rawhide-systemd-virt dracut-cmdline[105]: dracut-22 
 (Rawhide) dracut-038-36.git20140815.fc22
 Oct 30 13:08:37 fedora-rawhide-systemd-virt dracut-cmdline[105]: Using kernel 
 command line parameters:
 Oct 30 13:08:37 fedora-rawhide-systemd-virt systemd-udevd[158]: starting 
 version 216
 
 This line is pretty weird too, this commit is after v217 had been tagged.
 

Not that weird, it just means you didn't update your initrd after
updating to 217.

 ...

 Oct 30 13:08:38 fedora-rawhide-systemd-virt systemd[1]: Switching root.
 Oct 30 13:08:38 fedora-rawhide-systemd-virt systemd-journal[109]: Journal 
 stopped
 
 Hangs here for a while with no output.
 
 Oct 30 13:09:44 fedora-rawhide-systemd-virt systemd-journal[279]: Runtime 
 journal is using 8.0M (max allowed 100.0M, trying to leave 150.1M free of 
 992.7M available → current limit 100.0M).
 Oct 30 13:09:44 fedora-rawhide-systemd-virt systemd-journal[279]: Runtime 
 journal is using 8.0M (max allowed 100.0M, trying to leave 150.1M free of 
 992.7M available → current limit 100.0M).
 Oct 30 13:09:44 fedora-rawhide-systemd-virt systemd-journald[109]: Received 
 SIGTERM from PID 1 (systemd).
 snip a lot of selinux related stuff
 Oct 30 13:09:44 fedora-rawhide-systemd-virt kernel: random: nonblocking pool 
 is initialized
 
 Is anyone else running into this?

Probably fixed by:

http://cgit.freedesktop.org/systemd/systemd/commit/?id=74a550c5d8228

d
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Switch root slowness

2014-10-30 Thread Lennart Poettering
On Thu, 30.10.14 13:18, Jan Synáček (jsyna...@redhat.com) wrote:

 Hello,
 
 commit 539618a0ddc2dc7f0fbe28de2ae0e07b34c81e60
 Author: Lennart Poettering lenn...@poettering.net
 Date:   Wed Oct 29 17:06:32 2014 +0100
 
 util: make use of the new getrandom() syscall if it is available when 
 needing entropy
 
 Doesn't require an fd, and could be a bit faster, so let's make use of
 it, if it is available.
 
 Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: EXT4-fs (sda3): mounted 
 filesystem with ordered data mode. Opts: (null)
 Oct 30 13:08:38 fedora-rawhide-systemd-virt systemd[1]: Switching root.
 Oct 30 13:08:38 fedora-rawhide-systemd-virt systemd-journal[109]: Journal 
 stopped
 
 Hangs here for a while with no output.
 
 Oct 30 13:09:44 fedora-rawhide-systemd-virt systemd-journal[279]: Runtime 
 journal is using 8.0M (max allowed 100.0M, trying to leave 150.1M free of 
 992.7M available → current limit 100.0M).
 Oct 30 13:09:44 fedora-rawhide-systemd-virt systemd-journal[279]: Runtime 
 journal is using 8.0M (max allowed 100.0M, trying to leave 150.1M free of 
 992.7M available → current limit 100.0M).
 Oct 30 13:09:44 fedora-rawhide-systemd-virt systemd-journald[109]: Received 
 SIGTERM from PID 1 (systemd).
 snip a lot of selinux related stuff
 Oct 30 13:09:44 fedora-rawhide-systemd-virt kernel: random: nonblocking pool 
 is initialized
 
 Is anyone else running into this?

This could be due to the blocking nature of getrandom() if little
entropy is available. The call waits by default until the pool is
initialized before returning, which is probably what your system is
waiting on.

I wish there was a way how we could use getrandom() in a way like
/dev/urandom, where we can pull out the non-initialized data
anyway. In absence of that we can just fallback to /dev/urandom on
EAGAIN I guess, and always pass GRND_NONBLOCK.

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Switch root slowness

2014-10-30 Thread Cristian Rodríguez

El 30/10/14 a las #4, Lennart Poettering escribió:
 In absence of that we can just fallback to /dev/urandom on

EAGAIN I guess, and always pass GRND_NONBLOCK.



Before you made this commit, I had a local patch that did exactly 
that..currently this is the best solution. I suggest to give up on any 
failure (not implemented, blocking..whatever) and fallback to reading 
/dev/urandom.



___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Switch root slowness

2014-10-30 Thread Jan Synacek
Dave Reisner d...@falconindy.com writes:
 On Thu, Oct 30, 2014 at 01:18:24PM +0100, Jan Synáček wrote:
 Hello,
 
 commit 539618a0ddc2dc7f0fbe28de2ae0e07b34c81e60
 Author: Lennart Poettering lenn...@poettering.net
 Date:   Wed Oct 29 17:06:32 2014 +0100
 
 util: make use of the new getrandom() syscall if it is available when 
 needing entropy
 
 Doesn't require an fd, and could be a bit faster, so let's make use of
 it, if it is available.
 
 Beginning from this commit, switch root takes about a minute on my machine.

 ...

 Probably fixed by:

 http://cgit.freedesktop.org/systemd/systemd/commit/?id=74a550c5d8228

Nope, still slow.

-- 
Jan Synacek
Software Engineer, Red Hat


signature.asc
Description: PGP signature
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel


Re: [systemd-devel] Switch root slowness

2014-10-30 Thread Lennart Poettering
On Thu, 30.10.14 14:35, Lennart Poettering (lenn...@poettering.net) wrote:

 On Thu, 30.10.14 13:18, Jan Synáček (jsyna...@redhat.com) wrote:
 
  Hello,
  
  commit 539618a0ddc2dc7f0fbe28de2ae0e07b34c81e60
  Author: Lennart Poettering lenn...@poettering.net
  Date:   Wed Oct 29 17:06:32 2014 +0100
  
  util: make use of the new getrandom() syscall if it is available when 
  needing entropy
  
  Doesn't require an fd, and could be a bit faster, so let's make use of
  it, if it is available.
  
  Oct 30 13:08:37 fedora-rawhide-systemd-virt kernel: EXT4-fs (sda3): mounted 
  filesystem with ordered data mode. Opts: (null)
  Oct 30 13:08:38 fedora-rawhide-systemd-virt systemd[1]: Switching root.
  Oct 30 13:08:38 fedora-rawhide-systemd-virt systemd-journal[109]: Journal 
  stopped
  
  Hangs here for a while with no output.
  
  Oct 30 13:09:44 fedora-rawhide-systemd-virt systemd-journal[279]: Runtime 
  journal is using 8.0M (max allowed 100.0M, trying to leave 150.1M free of 
  992.7M available → current limit 100.0M).
  Oct 30 13:09:44 fedora-rawhide-systemd-virt systemd-journal[279]: Runtime 
  journal is using 8.0M (max allowed 100.0M, trying to leave 150.1M free of 
  992.7M available → current limit 100.0M).
  Oct 30 13:09:44 fedora-rawhide-systemd-virt systemd-journald[109]: Received 
  SIGTERM from PID 1 (systemd).
  snip a lot of selinux related stuff
  Oct 30 13:09:44 fedora-rawhide-systemd-virt kernel: random: nonblocking 
  pool is initialized
  
  Is anyone else running into this?
 
 This could be due to the blocking nature of getrandom() if little
 entropy is available. The call waits by default until the pool is
 initialized before returning, which is probably what your system is
 waiting on.
 
 I wish there was a way how we could use getrandom() in a way like
 /dev/urandom, where we can pull out the non-initialized data
 anyway. In absence of that we can just fallback to /dev/urandom on
 EAGAIN I guess, and always pass GRND_NONBLOCK.

I have now implemented that. Please test!

Lennart

-- 
Lennart Poettering, Red Hat
___
systemd-devel mailing list
systemd-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/systemd-devel