[systemd-devel] [PATCH] readahead: read /usr files last for rotational media, skip /var

Paolo Bonzini bonzini at gnu.org
Fri Sep 30 04:18:41 PDT 2011


[adding back the list]

On 09/30/2011 01:05 PM, Tom Gundersen wrote:
> I think a better heuristic is needed if we want to plan for
> the future. If I understand correctly, there seems to be a shift
> towards moving stuff from /lib, /bin and /sbin to /usr/lib, /usr/bin
> and /usr/sbin, respectively (and requiring /usr to be mounted when
> systemd starts). That means that at some point in the future we will
> be back to square one.

Requiring /usr to be mounted when systemd starts would sound like a very 
strange thing to me.  And I'm not even that much of a Unix maven.  If 
there is any place where a barrier can be placed, that is /usr.  So much 
that I've been thinking about adding "virtual" mount units that become 
active as soon as any directory above it is mounted.  This way, units 
that require /usr could be made to depend on usr.mount.

In fact, I think it is very wrong to make binfmt load from 
/usr/lib/binfmt.d.  Personally, I would have made it 
/lib/systemd/binfmt.d (likewise for tmpfiles).

If you really want to use /usr, there should be two instances of 
binfmt/tmpfiles/etc. one that is activated very early (loading from /etc 
and /lib) and one that is activated after remote-fs.target (in the lack 
of usr.mount---yes, remote!) that loads from /usr/lib and /usr/local/lib.

As I said, the heuristic is not perfect.  However, it is a huge 
improvement and right now the only /usr files that my system needs early 
are binfmt/tmpfiles configuration, plus some coreutils that perhaps 
should be moved to bin (id, tr, getopt).

> Also, I'm not sure if I understand your suggestion that /var should be
> ignored. In particular I think /var/tmp would be useful to readahead
> (albeit probably as one of the last things to do).

You could add that as a third group, after / and /usr.  The patch makes 
that kind of extensibility very easy.

> Lots of
> pregenerated stuff that rarely changes is stored there that we want to
> load as quickly as possible at boot (e.g. kde's caches).

Yes, /var/tmp is part of why I omitted that part of the patch (despite 
leaving it by mistake in the subject).  However, because I use GNOME :) 
my /.readahead doesn't have anything from /var/tmp; only from /var/log. 
  Perhaps /var/log should be ignored instead.

Paolo


More information about the systemd-devel mailing list