All of lore.kernel.org
 help / color / mirror / Atom feed
From: Karel Zak <kzak@redhat.com>
To: "Pádraig Brady" <P@draigBrady.com>
Cc: Bernhard Voelker <mail@bernhard-voelker.de>,
	Coreutils <coreutils@gnu.org>, bug-gnulib <bug-gnulib@gnu.org>,
	util-linux <util-linux@vger.kernel.org>,
	Fridolin Pokorny <fpokorny@redhat.com>
Subject: Re: large overhead in libmount
Date: Thu, 2 Apr 2015 12:05:46 +0200	[thread overview]
Message-ID: <20150402100546.GE2097@ws.net.home> (raw)
In-Reply-To: <54BDB6E9.4070500@draigBrady.com>

On Tue, Jan 20, 2015 at 02:01:13AM +0000, Pádraig Brady wrote:
> On 30/12/14 22:06, Bernhard Voelker wrote:
> > I just pulled the recent gnulib update, and now the above, expensive
> > test fails:
> > 
> >    + ulimit -v 40000
> >    + du -sh d
> >    du: fts_read failed: d: Cannot allocate memory
> >    + fail=1
> > 
> > I guess this due to the inclusion of libmount?
> 
> Yes I get the same issue in that test:
> http://git.sv.gnu.org/gitweb/?p=coreutils.git;a=blob;f=tests/rm/many-dir-entries-vs-OOM.sh
> 
> Indeed there is significant overhead in using libmount as shown below.
> This is a crazy amount of overhead just to read /proc/self/mountinfo,
> and is the sort of creeping dependencies I hate.  The proposed solution
> in the attached gnulib patch, is to require ./configure --with-libmount
> to enable this feature. I.E. it's disabled by default.
> 
> cheers,
> Pádraig
> 
> ======= without =========
> $ (ulimit -v 5380; du -s .)
> 
> $ ldd /usr/bin/du
> linux-vdso.so.1 =>  (0x00007fff0d7fe000)
> libc.so.6 => /lib64/libc.so.6 (0x00007fd414a32000)
> /lib64/ld-linux-x86-64.so.2 (0x00007fd414e0b000)
> 
> $ time du -s src/du.c >/dev/null
> real    0m0.003s
> user    0m0.000s
> sys     0m0.003s
> 
> ======= with =========
> $ (ulimit -v 23250; src/du -s .)
> 
> $ ldd src/du
> linux-vdso.so.1 =>  (0x00007fff76ca8000)
> libc.so.6 => /lib64/libc.so.6 (0x00007f2a1f742000)
> /lib64/ld-linux-x86-64.so.2 (0x00007f2a1fd61000)
>  libmount.so.1 => /lib64/libmount.so.1 (0x00007f2a1faff000)
>   libblkid.so.1 => /lib64/libblkid.so.1 (0x00007f2a1f501000)
>   libuuid.so.1 => /lib64/libuuid.so.1 (0x00007f2a1f2fc000)
>   libselinux.so.1 => /lib64/libselinux.so.1 (0x00007f2a1f0d7000)
>   libpcre.so.1 => /lib64/libpcre.so.1 (0x00007f2a1ee69000)
>   liblzma.so.5 => /lib64/liblzma.so.5 (0x00007f2a1ec44000)
>   libdl.so.2 => /lib64/libdl.so.2 (0x00007f2a1ea40000)
>   libpthread.so.0 => /lib64/libpthread.so.0 (0x00007f2a1e823000)

The problem is libselinux, but on selinux based system you have all the
libraries already in memory for many another tools...

    Karel
-- 
 Karel Zak  <kzak@redhat.com>
 http://karelzak.blogspot.com

  reply	other threads:[~2015-04-02 10:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <54A321DC.4020300@bernhard-voelker.de>
2015-01-20  2:01 ` large overhead in libmount Pádraig Brady
2015-04-02 10:05   ` Karel Zak [this message]
2015-04-02 11:36     ` Pádraig Brady
2015-04-07 10:29       ` Karel Zak
2015-04-07 11:00         ` Daniel J Walsh

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20150402100546.GE2097@ws.net.home \
    --to=kzak@redhat.com \
    --cc=P@draigBrady.com \
    --cc=bug-gnulib@gnu.org \
    --cc=coreutils@gnu.org \
    --cc=fpokorny@redhat.com \
    --cc=mail@bernhard-voelker.de \
    --cc=util-linux@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.