linux-btrfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Sergei Trofimovich <slyich@gmail.com>
To: David Sterba <dsterba@suse.cz>
Cc: linux-btrfs@vger.kernel.org, chris.mason@oracle.com
Subject: Re: [PATCH][RESEND] btrfs: separate superblock items out of fs_info
Date: Thu, 2 Jun 2011 21:36:43 +0300	[thread overview]
Message-ID: <20110602213643.6d62caef@sf> (raw)
In-Reply-To: <1307031202-14029-1-git-send-email-dsterba@suse.cz>

[-- Attachment #1: Type: text/plain, Size: 1274 bytes --]

On Thu,  2 Jun 2011 18:13:22 +0200
David Sterba <dsterba@suse.cz> wrote:

> fs_info is now ~9kb, more than fits into one page. This will cause
> mount failure when memory is too fragmented. Top space consumers are
> super block structures super_copy and super_for_commit, ~2.8kb each.
> Allocate them dynamically. fs_info will be ~3.5kb. (measured on x86_64)
> 
> Add a wrapper for freeing fs_info.
> 
> Signed-off-by: David Sterba <dsterba@suse.cz>
> ---
...
> @@ -801,6 +800,15 @@ static struct dentry *btrfs_mount(struct file_system_type *fs_type, int flags,
>  	fs_info->fs_devices = fs_devices;
>  	tree_root->fs_info = fs_info;
>  
> +	fs_info->super_copy = kzalloc(sizeof(struct btrfs_super_block),
> +			GFP_NOFS);
> +	fs_info->super_for_commit = kzalloc(sizeof(struct btrfs_super_block),
> +			GFP_NOFS);

In light of http://thread.gmane.org/gmane.comp.file-systems.btrfs/11004/focus=11038
what do you think of allocating BTRFS_SUPER_INFO_SIZE instead of sizeof?

> +	if (!fs_info->super_copy || !fs_info->super_for_commit) {
> +		error = -ENOMEM;
> +		goto error_close_devices;
> +	}
> +
>  	bdev = fs_devices->latest_bdev;
>  	s = sget(fs_type, btrfs_test_super, btrfs_set_super, tree_root);
>  	if (IS_ERR(s))

-- 

  Sergei

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 198 bytes --]

  reply	other threads:[~2011-06-02 18:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-02 16:13 [PATCH][RESEND] btrfs: separate superblock items out of fs_info David Sterba
2011-06-02 18:36 ` Sergei Trofimovich [this message]
2011-06-03 16:36   ` David Sterba

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=20110602213643.6d62caef@sf \
    --to=slyich@gmail.com \
    --cc=chris.mason@oracle.com \
    --cc=dsterba@suse.cz \
    --cc=linux-btrfs@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 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).