2015-06-19 18:08:25

by Dave Hansen

[permalink] [raw]
Subject: [PATCH] fs: inotify: systemd needs it so make it depend on CONFIG_EMBEDDED


From: Dave Hansen <[email protected]>

I have a little microbenchmark that sits and does write() in a loop.
The number one kernel function in the profiles is __srcu_read_lock()
from fsnotify(). I decided to turn off INOTIFY in order to see what
the potential from optimizing this path would be. I ended up with
a system at the rescue console as systemd complained that dependencies
were not met mounting some non-root filesystems:

systemd: inotify_init1() failed: Function not implemented
systemd: Dependency failed for Mark the need to relabel after reboot.
systemd: Triggering OnFailure= dependencies of local-fs.target.
systemd: inotify_init1() failed: Function not implemented
systemd: Dependency failed for /gcc.

It looks like CONFIG_INOTIFY is now a critical part of any system
that wants to both use systemd and boot. Let's make it depend
on CONFIG_EMBEDDED.

Signed-off-by: Dave Hansen <[email protected]>
Cc: John McCutchan <[email protected]>
Cc: Robert Love <[email protected]>
Cc: Eric Paris <[email protected]>
Cc: Alexander Viro <[email protected]>
Cc: Linus Torvalds <[email protected]>
Cc: [email protected]

---

b/fs/notify/inotify/Kconfig | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN fs/notify/inotify/Kconfig~make-inotify-harder-to-turn-off fs/notify/inotify/Kconfig
--- a/fs/notify/inotify/Kconfig~make-inotify-harder-to-turn-off 2015-06-19 10:54:06.528721072 -0700
+++ b/fs/notify/inotify/Kconfig 2015-06-19 10:55:16.426892530 -0700
@@ -1,5 +1,5 @@
config INOTIFY_USER
- bool "Inotify support for userspace"
+ bool "Inotify support for userspace" if EMBEDDED
select ANON_INODES
select FSNOTIFY
default y
_


2015-06-19 18:18:15

by Ilia Mirkin

[permalink] [raw]
Subject: Re: [PATCH] fs: inotify: systemd needs it so make it depend on CONFIG_EMBEDDED

On Fri, Jun 19, 2015 at 2:07 PM, Dave Hansen <[email protected]> wrote:
>
> From: Dave Hansen <[email protected]>
>
> I have a little microbenchmark that sits and does write() in a loop.
> The number one kernel function in the profiles is __srcu_read_lock()
> from fsnotify(). I decided to turn off INOTIFY in order to see what
> the potential from optimizing this path would be. I ended up with
> a system at the rescue console as systemd complained that dependencies
> were not met mounting some non-root filesystems:
>
> systemd: inotify_init1() failed: Function not implemented
> systemd: Dependency failed for Mark the need to relabel after reboot.
> systemd: Triggering OnFailure= dependencies of local-fs.target.
> systemd: inotify_init1() failed: Function not implemented
> systemd: Dependency failed for /gcc.
>
> It looks like CONFIG_INOTIFY is now a critical part of any system
> that wants to both use systemd and boot. Let's make it depend
> on CONFIG_EMBEDDED.

Is systemd depending on something really reason enough to make it
depend on EMBEDDED? For example all the cgroups stuff is not only not
dependent on embedded, but also off by default, and I'm sure there are
a boatload of other dependencies which any normal system has no
business worrying about but that are required by systemd.

-ilia

2015-06-19 18:55:28

by Austin S Hemmelgarn

[permalink] [raw]
Subject: Re: [PATCH] fs: inotify: systemd needs it so make it depend on CONFIG_EMBEDDED

On 2015-06-19 14:18, Ilia Mirkin wrote:
> On Fri, Jun 19, 2015 at 2:07 PM, Dave Hansen <[email protected]> wrote:
>>
>> From: Dave Hansen <[email protected]>
>>
>> I have a little microbenchmark that sits and does write() in a loop.
>> The number one kernel function in the profiles is __srcu_read_lock()
>> from fsnotify(). I decided to turn off INOTIFY in order to see what
>> the potential from optimizing this path would be. I ended up with
>> a system at the rescue console as systemd complained that dependencies
>> were not met mounting some non-root filesystems:
>>
>> systemd: inotify_init1() failed: Function not implemented
>> systemd: Dependency failed for Mark the need to relabel after reboot.
>> systemd: Triggering OnFailure= dependencies of local-fs.target.
>> systemd: inotify_init1() failed: Function not implemented
>> systemd: Dependency failed for /gcc.
>>
>> It looks like CONFIG_INOTIFY is now a critical part of any system
>> that wants to both use systemd and boot. Let's make it depend
>> on CONFIG_EMBEDDED.
>
> Is systemd depending on something really reason enough to make it
> depend on EMBEDDED? For example all the cgroups stuff is not only not
> dependent on embedded, but also off by default, and I'm sure there are
> a boatload of other dependencies which any normal system has no
> business worrying about but that are required by systemd.
>
> -ilia
I agree with this, kconfig isn't designed to make sure that your system
will boot. There are plenty of non-embedded systems that don't use
systemd at all (such as every Linux based system on the TOP500 list, and
a large majority of Gentoo installations), and also have no reason to
have INOTIFY enabled.

I would stipulate however that systemd _should_ (if it doesn't already)
clearly document this and any other kernel configuration dependencies.



Attachments:
smime.p7s (2.90 kB)
S/MIME Cryptographic Signature

2015-06-19 21:48:55

by Dave Hansen

[permalink] [raw]
Subject: Re: [PATCH] fs: inotify: systemd needs it so make it depend on CONFIG_EMBEDDED

On 06/19/2015 11:18 AM, Ilia Mirkin wrote:
> Is systemd depending on something really reason enough to make it
> depend on EMBEDDED? For example all the cgroups stuff is not only not
> dependent on embedded, but also off by default, and I'm sure there are
> a boatload of other dependencies which any normal system has no
> business worrying about but that are required by systemd.

Does the lack of cgroups keep a (normal) system from booting, though?

2015-06-22 12:21:12

by Austin S Hemmelgarn

[permalink] [raw]
Subject: Re: [PATCH] fs: inotify: systemd needs it so make it depend on CONFIG_EMBEDDED

On 2015-06-19 17:48, Dave Hansen wrote:
> On 06/19/2015 11:18 AM, Ilia Mirkin wrote:
>> Is systemd depending on something really reason enough to make it
>> depend on EMBEDDED? For example all the cgroups stuff is not only not
>> dependent on embedded, but also off by default, and I'm sure there are
>> a boatload of other dependencies which any normal system has no
>> business worrying about but that are required by systemd.
>
> Does the lack of cgroups keep a (normal) system from booting, though?
Define 'normal'. Just because userspace software depends on something
doesn't mean we should force that on everyone, even if disabling it
could make some systems fail to boot (that is an inherent risk in
building your own kernel). dnotify (inotify's predecessor) is an
excellent example of this: nfs-utils depends on it, and that not working
can definitely make a system fail to boot, yet it is not hidden behind
some other config option, but defaults to being on.

Making inotify default to on (like dnotify) is a better solution to
this, anyone who is going around turning off options that default to on
in kconfig should be prepared to deal with a system that doesn't boot
anyway, and EMBEDDED is intended (AFAICT) for saving space on systems
with limited memory, not hiding userspace dependencies that have other
legitimate reasons to be disabled.



Attachments:
smime.p7s (2.90 kB)
S/MIME Cryptographic Signature