[systemd-devel] [RFC] Integrate export mount command in code

Lennart Poettering lennart at poettering.net
Mon Aug 18 05:30:51 PDT 2014


On Mon, 18.08.14 00:25, Timofey Titovets (nefelim4ag at gmail.com) wrote:

> Good time of day, i just want to ask:
> Systemd depend on util-linux mount command and in code we call him,
> may have a sense to import and cleanup code to systemd base, and just
> call function in systemd, instead of using mount command?
> 
> But only benefit what i see:
> it faster, when call external command, but i can miss something

No. I don't think this would be a good idea. First of all, util-linux is
maintained very well upstream (by Karel Zak, who's actually on the same
team at RH as Kay and I are). Then, the current mount binary is
actually a real API, with it callouts to /usr/sbin/mount.<fstype> and
suchlike, we cannot get rid of that. This is frequently used for network
file systems (such as NFS), or FUSE. Then, it wouldn't actually get us
anything, since we have to invoke the mount() syscall out-of-process
anyway (since it is blocking). But if we invoke it out-of-process, we
have to have an exec() transition in the child, because otherwise just
forking things would simply result in tons of pagefaults in the parent
(due to the copy-of-write semantics of fork()), and we don't want that
for perfomance reasons. 

So, I really don't see any benefit in merging that.

Lennart

-- 
Lennart Poettering, Red Hat


More information about the systemd-devel mailing list