[systemd-devel] [PATCH 4/4] Add a new tmpfiles.d snippets to set the NOCOW the journal.
Zbigniew Jędrzejewski-Szmek
zbyszek at in.waw.pl
Sat Apr 11 10:07:57 PDT 2015
On Wed, Apr 08, 2015 at 11:48:21PM +0200, Lennart Poettering wrote:
> On Sun, 22.03.15 20:53, Zbigniew Jędrzejewski-Szmek (zbyszek at in.waw.pl) wrote:
>
> > On Fri, Mar 20, 2015 at 07:06:28PM +0100, Goffredo Baroncelli wrote:
> > > Hi Zbyszek,
> > >
> > > On 2015-03-21 14:37, Zbigniew Jędrzejewski-Szmek wrote:
> > > > On Mon, Mar 16, 2015 at 08:33:52PM +0100, Goffredo Baroncelli wrote:
> > > >> From: Goffredo Baroncelli <kreijack at inwind.it>
> > > >>
> > > >> Add a new tmpfiles.d snippets to set the NOCOW attributes for the
> > > >> journal files. This allow better perfomance when the root file system
> > > >> is BTRFS. Pay attention that the NOCOW flags disables the checksum and
> > > >> prevent scrub to rebuild a corrupted journal.
> > > > I now merged patches 1-3/4, but not this one. Setting/unsetting
> > > > attributes seems to be generally useful, so the rest stands on its
> > > > own. The reason I held back with the last patch is that setting of the
> > > > attributes through tmpfiles should be added together with the removal
> > > > of the same functionality from journald.
> > >
> > > You are right, the patch #4 and the removal of the current code are coupled;
> > > with the patch #1..#3 included, I will re-issue the #4 with another patch which reverts the code. And the discussion will restart.
> > >
> > >
> > >
> > > > But there are some details to
> > > > work out.
> > > >
> > > > Setting +C on /var/log/journal/%m has smaller scope than the code in
> > > > journal-file.c now. For example it does not cover files opened by
> > > > systemd-journal-remote.
> > >
> > > I am not familiar with s*d-journal-remote; from the man page it seems that the log are stored /by default) in /var/log/journal/remote/ ; if so it is sufficient to add a line like
> > >
> > > +h /var/log/journal/remote - - - - +C
> >
> > That's the problem: current functionality works no matter where you
> > store the files, but it's hard to provide the same level of
> > flexibility with the tmpfiles-based solution.
>
> Well, but we never store files outside of /var/log/journal,
> /var/log/journal/%m and /var/log/journal/remote/, do we?
We can, if instructed to do so. journal-remote can store files wherever.
Original motivation for this patch was to make the NOCOW on journal files
configurable without too much fuss and without making it an explicit option.
Journal files on btrfs without NOCOW are rather slow, so it seems that most
people will want NOCOW on. But with the proposed patch, people would want
to add the tmpfile snippet to set NOCOW for every location they write too,
which is very visible and requires explicit configuration. Doing this in
journal-file directly was simple, synchronous, and worked everywhere, and
we are replacing this with a more complicated and more brittle scheme.
Dunno, if you think things are better this way, I'm fine with that,
since both schemes should get the job done. But in the end, adding a
switch in journald.conf seems more in the systemd spirit of doing the right
thing automatically and also less work for both sides...
Zbyszek
More information about the systemd-devel
mailing list