linux-ext4.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Aneesh Kumar K.V" <aneesh.kumar@linux.vnet.ibm.com>
To: Theodore Y Tso <theotso@us.ibm.com>,
	Mingming Cao <cmm@us.ibm.com>, Alex Tomas <bzzz@sun.com>,
	Andreas Dilger <adilger@clusterfs.com>
Subject: GFP_ usage in kmalloc with mballoc
Date: Thu, 24 Jan 2008 21:26:07 +0530	[thread overview]
Message-ID: <20080124155607.GE14348@skywalker> (raw)

Hi,


I looked at the GFP flag usage in mballoc.  I think the below change
make sense with respect to mballoc.

First hunk is memory allocation during ext4_mb_init which is called
during mount time. I guess it is ok to convert that to GFP_KERNEL.

Second hunk is during ext4_mb_free_metadata. I guess it should be
GFP_NOFS. This is called during ext4_free_blocks.


diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index bec699a..a15f18e 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -2662,7 +2662,7 @@ int ext4_mb_init(struct super_block *sb, int needs_recovery)
 	sbi->s_mb_group_prealloc = MB_DEFAULT_GROUP_PREALLOC;
 
 	i = sizeof(struct ext4_locality_group) * NR_CPUS;
-	sbi->s_locality_groups = kmalloc(i, GFP_NOFS);
+	sbi->s_locality_groups = kmalloc(i, GFP_KERNEL);
 	if (sbi->s_locality_groups == NULL) {
 		clear_opt(sbi->s_mount_opt, MBALLOC);
 		kfree(sbi->s_mb_offsets);
@@ -4366,7 +4366,7 @@ static int ext4_mb_free_metadata(handle_t *handle, struct ext4_buddy *e4b,
 
 		if (md == NULL) {
 			ext4_unlock_group(sb, group);
-			md = kmalloc(sizeof(*md), GFP_KERNEL);
+			md = kmalloc(sizeof(*md), GFP_NOFS);
 			if (md == NULL)
 				return -ENOMEM;
 			md->num = 0;

                 reply	other threads:[~2008-01-24 15:56 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20080124155607.GE14348@skywalker \
    --to=aneesh.kumar@linux.vnet.ibm.com \
    --cc=adilger@clusterfs.com \
    --cc=bzzz@sun.com \
    --cc=cmm@us.ibm.com \
    --cc=theotso@us.ibm.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 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).