linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Norbert Preining <preining@logic.at>
To: Ted Ts'o <tytso@mit.edu>, Eric Sandeen <sandeen@redhat.com>
Cc: linux-ext4@vger.kernel.org
Subject: Re: Ext4 slow on links
Date: Wed, 20 Jun 2012 12:38:31 +0900	[thread overview]
Message-ID: <20120620033831.GA2395@gamma.logic.tuwien.ac.at> (raw)
In-Reply-To: <4FE14034.6070800@redhat.com> <20120620021912.GA26323@thunk.org>

Hi Ted, hi Eric,

thanks for the answers, here some remarks.

On Di, 19 Jun 2012, Ted Ts'o wrote:
> The inode has room for 60 characters; after that, the symlink target
> gets stored in an external block.  The seek to read in the symlink
> target could be one of the causes of the delay.  The other is

Ok.

> Nothing has changed here between ext2/ext3 and ext4 here, so ext2/ext3
> will behave exactly the same.  There are changes in the block and
> inode allocation algorithms which might make a minor difference, but
> the same is potentially true of a very fragmented file system.

Ok.

Thinking about that, even if I dereference the files, I still am a 
bit surprised. For each file we have the following times:
1- read the inode and determine if it is a link
2- check if link target fits in the the 60chars
3- read the additional block for long link target
4- read the target inode

I assume that the items 1,3, and 4 are the time consuming ones and
about the same time.

Now what I don't understand, why doing a 
	time ls -l >/dev/null
on the directory with the original files takes 1.2s,
but reading the links with ls -l >/dev/null takes 1m13s, both
after reboot on cold cache.

I assume that some data is hashed in the directory inode, so doing
ls -l on the real files only reads the directory inode and not 
each file invividually, while reading all the links read all the
individual files.

Is this the explanation? If not, I cannot imagine any way that reading
a list of links and dereferencing them plus reading the ttargets 
takes 60times as long.

On Di, 19 Jun 2012, Eric Sandeen wrote:
> As Ted said, the targets might be far-flung.  If you do /bin/ls -l instead
> of maybe an aliased ls which stats everything to make pretty colors,
> is that faster?

Might be the problem, but I saw the same with a program doing
opendir readdir etc, so no allias or external program involved.

Best wishes

Norbert
------------------------------------------------------------------------
Norbert Preining            preining@{jaist.ac.jp, logic.at, debian.org}
JAIST, Japan                                 TeX Live & Debian Developer
DSA: 0x09C5B094   fp: 14DF 2E6C 0307 BE6D AD76  A9C0 D2BF 4AA3 09C5 B094
------------------------------------------------------------------------
NACTION (n.)
The 'n' with which cheap advertising copywriters replace the word
'and' (as in 'fish 'n' chips', 'mix 'n' match', 'assault 'n'
battery'), in the mistaken belief that this is in some way chummy or
endearing.
			--- Douglas Adams, The Meaning of Liff

  reply	other threads:[~2012-06-20  3:38 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-06-20  0:20 Ext4 slow on links Norbert Preining
2012-06-20  2:19 ` Ted Ts'o
2012-06-20  3:38   ` Norbert Preining [this message]
2012-06-20  3:57     ` Eric Sandeen
2012-06-20  4:01       ` Norbert Preining
2012-06-20  5:18       ` Norbert Preining
2012-06-20 14:07         ` Eric Sandeen
2012-06-20 19:35       ` Eric Sandeen
2012-06-21  2:28         ` Norbert Preining
2012-06-21  4:05           ` Eric Sandeen
2012-06-21  4:50             ` Norbert Preining
2012-06-21  5:18               ` Andreas Dilger
2012-06-21  6:55                 ` Norbert Preining
2012-06-22  9:53             ` Bernd Schubert
2012-06-22 14:08               ` Ted Ts'o
2012-06-20  3:15 ` Eric Sandeen

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=20120620033831.GA2395@gamma.logic.tuwien.ac.at \
    --to=preining@logic.at \
    --cc=linux-ext4@vger.kernel.org \
    --cc=sandeen@redhat.com \
    --cc=tytso@mit.edu \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).