All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ted Ts'o <tytso@mit.edu>
To: Andreas Dilger <adilger@whamcloud.com>
Cc: linux-ext4@vger.kernel.org, Yu Jian <yujian@whamcloud.com>
Subject: Re: [PATCH] ext4: fall back to vmalloc() for large allocations
Date: Sun, 17 Jul 2011 21:25:56 -0400	[thread overview]
Message-ID: <20110718012556.GJ2717@thunk.org> (raw)
In-Reply-To: <1310506846-25843-1-git-send-email-adilger@whamcloud.com>

On Tue, Jul 12, 2011 at 03:40:46PM -0600, Andreas Dilger wrote:
> For very large ext4 filesystems (128TB and larger) kmalloc() of
> some per-group structures can fail at mount time due to memory
> fragmentation.  If kmalloc() fails, fall back to vmalloc() for
> the s_group_info and s_group_desc arrays.
> 
> Signed-off-by: Yu Jian <yujian@whamcloud.com>
> Signed-off-by: Andreas Dilger <adilger@whamcloud.com>

Andras, was this patch authored by Yu Jian or by you?

>  	sbi->s_buddy_cache = new_inode(sb);
>  	if (sbi->s_buddy_cache == NULL) {
> -		printk(KERN_ERR "EXT4-fs: can't get new inode\n");
> +		ext4_msg(sb, KERN_ERR, "can't get new inode\n");
>  		goto err_freesgi;
>  	}

Using ext4_msg instead of printk is good, but that really should be a
separate patch.


> -	sbi->s_buddy_cache->i_ino = get_next_ino();
> +	/* To avoid potentially colliding with an valid on-disk inode number,
> +	 * use EXT4_BAD_INO for the buddy cache inode number.  This inode is
> +	 * not in the inode hash, so it should never be found by iget(), but
> +	 * this will avoid confusion if it ever shows up during debugging. */
> +	sbi->s_buddy_cache->i_ino = EXT4_BAD_INO;

This should be a separate patch.

> @@ -2457,12 +2472,6 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
>  		i++;
>  	} while (i <= sb->s_blocksize_bits + 1);
>  
> -	/* init file for buddy data */
> -	ret = ext4_mb_init_backend(sb);
> -	if (ret != 0) {
> -		goto out;
> -	}
> -
>  	spin_lock_init(&sbi->s_md_lock);
>  	spin_lock_init(&sbi->s_bal_lock);
>  
> @@ -2487,6 +2496,11 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
>  		spin_lock_init(&lg->lg_prealloc_lock);
>  	}
>  
> +	/* init file for buddy data */
> +	ret = ext4_mb_init_backend(sb);
> +	if (ret != 0)
> +		goto out;
> +
>  	if (sbi->s_proc)
>  		proc_create_data("mb_groups", S_IRUGO, sbi->s_proc,
>  				 &ext4_mb_seq_groups_fops, sb);

Why are you moving ext4_mb_init_backend()?  This should be a separate
patch, with an explanation of what is going on....

       	       		      	      	    - Ted

  reply	other threads:[~2011-07-18  1:25 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-12 21:40 [PATCH] ext4: fall back to vmalloc() for large allocations Andreas Dilger
2011-07-18  1:25 ` Ted Ts'o [this message]
2011-07-18  5:12   ` Andreas Dilger
2011-07-18 11:36     ` Ted Ts'o
2011-08-01 13:13     ` [PATCH 0/5] Break up "fall back to vmalloc() for large allocations" Theodore Ts'o
2011-08-01 13:13       ` [PATCH 1/5] ext4: introduce ext4_kvmalloc(), ext4_kzalloc(), and ext4_kvfree() Theodore Ts'o
2011-08-02  6:07         ` [PATCH] ext4: use kzalloc in ext4_kzalloc() Mathias Krause
2011-08-03 18:57           ` Ted Ts'o
2011-08-01 13:13       ` [PATCH 2/5] ext4: use ext4_kvzalloc()/ext4_kvmalloc() for s_group_desc and s_group_info Theodore Ts'o
2011-08-01 13:13       ` [PATCH 3/5] ext4: use ext4_msg() instead of printk in mballoc Theodore Ts'o
2011-08-02  3:12         ` Andreas Dilger
2011-08-01 13:13       ` [PATCH 4/5] ext4: use EXT4_BAD_INO for buddy cache to avoid colliding with valid inode # Theodore Ts'o
2011-08-01 13:13       ` [PATCH 5/5] ext4: prevent memory leaks from ext4_mb_init_backend() on error path Theodore Ts'o

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=20110718012556.GJ2717@thunk.org \
    --to=tytso@mit.edu \
    --cc=adilger@whamcloud.com \
    --cc=linux-ext4@vger.kernel.org \
    --cc=yujian@whamcloud.com \
    /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.