All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ted Ts'o <tytso@mit.edu>
To: Andreas Dilger <adilger@dilger.ca>
Cc: Andre Noll <maan@systemlinux.org>,
	linux-ext4 development <linux-ext4@vger.kernel.org>,
	Marcus Hartmann <marcus.hartmann@tuebingen.mpg.de>
Subject: Re: Memory allocation failed, e2fsck: aborted
Date: Fri, 20 Aug 2010 08:46:42 -0400	[thread overview]
Message-ID: <20100820124642.GB4053@thunk.org> (raw)
In-Reply-To: <ABE19F5B-74C8-47E9-B359-D3FB2C137087@dilger.ca>

On Thu, Aug 19, 2010 at 01:03:06PM -0600, Andreas Dilger wrote:
> 
> I think the problem isn't just the TOTAL amount of RAM being used,
> but the fact that this piece of code is trying to do a SINGLE
> allocation that is HUGE.  The second problem is that the constant
> re-allocation of this huge array (every 100 insertions) means that
> it can never really exceed 1/2 of RAM in size.

Part of the problem is that the data structures are optimized for
relatively few hard links and a reasonable number of directories
compared to other types of inodes.  For people who are using hard-link
backup schemes, these assumptions are violated in some fairly massive
ways.

Something that might be interesting to do is to keep some statistics
in the superblock about the number of hard links.  This would allow
e2fsck to allocate the data structures appropriately up front, and
maybe allow it to switch to some other representation if it turns out
the file system is one which is dense with hard links.

> That said, any insert-optimized tree structure with a high fan-out
> would be suitable.  Elements are almost never deleted, and we would
> never need to compact the tree (it is freed as a whole when it is
> done).

We could try to create a tree-optimized data structure, but I wonder
if it's worth it.  IIRC berk_db has an in-memory and file-backed
option, and it has a btree option.  Using that might be easier than
trying to hand-code something special.

							- Ted

  reply	other threads:[~2010-08-20 14:15 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-18 14:04 Memory allocation failed, e2fsck: aborted Andre Noll
2010-08-18 20:20 ` Andreas Dilger
2010-08-19  0:54   ` Ted Ts'o
2010-08-19 13:10     ` Andre Noll
2010-08-19 17:16       ` Ted Ts'o
2010-08-20 14:40         ` Andre Noll
2010-08-20 14:36       ` Andre Noll
2010-08-19 13:01   ` Andre Noll
2010-08-19 19:03     ` Andreas Dilger
2010-08-20 12:46       ` Ted Ts'o [this message]
2010-08-20 14:39       ` Andre Noll
2010-08-23 15:53         ` [PATCH]: icount: Replace the icount list by a two-level tree Andre Noll
2010-11-01 22:49           ` Mala Iyer
2010-11-01 23:23             ` Andreas Dilger

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=20100820124642.GB4053@thunk.org \
    --to=tytso@mit.edu \
    --cc=adilger@dilger.ca \
    --cc=linux-ext4@vger.kernel.org \
    --cc=maan@systemlinux.org \
    --cc=marcus.hartmann@tuebingen.mpg.de \
    /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.