login
Login
/
Register
Search
Header Space
Forums
News
Jobs
Blogs
Features
Man Pages
Site
Home
»
Mailing list archives
»
linux-kernel
»
2007
»
September
»
19
Re: [PATCH] JBD: use GFP_NOFS in kmalloc
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
From:
Mingming Cao <cmm@...>
To: Andrew Morton <akpm@...>
Cc: linux-fsdevel <linux-fsdevel@...>, ext4 development <linux-ext4@...>, lkml <linux-kernel@...>
Subject:
Re: [PATCH] JBD: use GFP_NOFS in kmalloc
Date: Wednesday, September 19, 2007 - 5:55 pm
On Wed, 2007-09-19 at 14:34 -0700, Andrew Morton wrote:
quoted text
> On Wed, 19 Sep 2007 12:22:09 -0700 > Mingming Cao <cmm@us.ibm.com> wrote: > > > Convert the GFP_KERNEL flag used in JBD/JBD2 to GFP_NOFS, consistent > > with the rest of kmalloc flag used in the JBD/JBD2 layer. > > > > Signed-off-by: Mingming Cao <cmm@us.ibm.com> > > > > --- > > fs/jbd/journal.c | 6 +++--- > > fs/jbd/revoke.c | 8 ++++---- > > fs/jbd2/journal.c | 6 +++--- > > fs/jbd2/revoke.c | 8 ++++---- > > 4 files changed, 14 insertions(+), 14 deletions(-) > > > > Index: linux-2.6.23-rc6/fs/jbd/journal.c > > =================================================================== > > --- linux-2.6.23-rc6.orig/fs/jbd/journal.c 2007-09-19 11:51:10.000000000 -0700 > > +++ linux-2.6.23-rc6/fs/jbd/journal.c 2007-09-19 11:51:57.000000000 -0700 > > @@ -653,7 +653,7 @@ static journal_t * journal_init_common ( > > journal_t *journal; > > int err; > > > > - journal = kmalloc(sizeof(*journal), GFP_KERNEL); > > + journal = kmalloc(sizeof(*journal), GFP_NOFS); > > if (!journal) > > goto fail; > > memset(journal, 0, sizeof(*journal)); > > @@ -723,7 +723,7 @@ journal_t * journal_init_dev(struct bloc > > journal->j_blocksize = blocksize; > > n = journal->j_blocksize / sizeof(journal_block_tag_t); > > journal->j_wbufsize = n; > > - journal->j_wbuf = kmalloc(n * sizeof(struct buffer_head*), GFP_KERNEL); > > + journal->j_wbuf = kmalloc(n * sizeof(struct buffer_head*), GFP_NOFS); > > if (!journal->j_wbuf) { > > printk(KERN_ERR "%s: Cant allocate bhs for commit thread\n", > > __FUNCTION__); > > @@ -777,7 +777,7 @@ journal_t * journal_init_inode (struct i > > /* journal descriptor can store up to n blocks -bzzz */ > > n = journal->j_blocksize / sizeof(journal_block_tag_t); > > journal->j_wbufsize = n; > > - journal->j_wbuf = kmalloc(n * sizeof(struct buffer_head*), GFP_KERNEL); > > + journal->j_wbuf = kmalloc(n * sizeof(struct buffer_head*), GFP_NOFS); > > if (!journal->j_wbuf) { > > printk(KERN_ERR "%s: Cant allocate bhs for commit thread\n", > > __FUNCTION__); > > Index: linux-2.6.23-rc6/fs/jbd/revoke.c > > =================================================================== > > --- linux-2.6.23-rc6.orig/fs/jbd/revoke.c 2007-09-19 11:51:30.000000000 -0700 > > +++ linux-2.6.23-rc6/fs/jbd/revoke.c 2007-09-19 11:52:34.000000000 -0700 > > @@ -206,7 +206,7 @@ int journal_init_revoke(journal_t *journ > > while((tmp >>= 1UL) != 0UL) > > shift++; > > > > - journal->j_revoke_table[0] = kmem_cache_alloc(revoke_table_cache, GFP_KERNEL); > > + journal->j_revoke_table[0] = kmem_cache_alloc(revoke_table_cache, GFP_NOFS); > > if (!journal->j_revoke_table[0]) > > return -ENOMEM; > > journal->j_revoke = journal->j_revoke_table[0]; > > @@ -219,7 +219,7 @@ int journal_init_revoke(journal_t *journ > > journal->j_revoke->hash_shift = shift; > > > > journal->j_revoke->hash_table = > > - kmalloc(hash_size * sizeof(struct list_head), GFP_KERNEL); > > + kmalloc(hash_size * sizeof(struct list_head), GFP_NOFS); > > if (!journal->j_revoke->hash_table) { > > kmem_cache_free(revoke_table_cache, journal->j_revoke_table[0]); > > journal->j_revoke = NULL; > > @@ -229,7 +229,7 @@ int journal_init_revoke(journal_t *journ > > for (tmp = 0; tmp < hash_size; tmp++) > > INIT_LIST_HEAD(&journal->j_revoke->hash_table[tmp]); > > > > - journal->j_revoke_table[1] = kmem_cache_alloc(revoke_table_cache, GFP_KERNEL); > > + journal->j_revoke_table[1] = kmem_cache_alloc(revoke_table_cache, GFP_NOFS); > > if (!journal->j_revoke_table[1]) { > > kfree(journal->j_revoke_table[0]->hash_table); > > kmem_cache_free(revoke_table_cache, journal->j_revoke_table[0]); > > @@ -246,7 +246,7 @@ int journal_init_revoke(journal_t *journ > > journal->j_revoke->hash_shift = shift; > > > > journal->j_revoke->hash_table = > > - kmalloc(hash_size * sizeof(struct list_head), GFP_KERNEL); > > + kmalloc(hash_size * sizeof(struct list_head), GFP_NOFS); > > if (!journal->j_revoke->hash_table) { > > kfree(journal->j_revoke_table[0]->hash_table); > > kmem_cache_free(revoke_table_cache, journal->j_revoke_table[0]); > > These were all OK using GFP_KERNEL. > > GFP_NOFS should only be used when the caller is holding some fs locks which > might cause a deadlock if that caller reentered the fs in ->writepage (and > maybe put_inode and such). That isn't the case in any of the above code, > which is all mount time stuff (I think). >
You are right they are all occur at initialization time.
quoted text
> ext3/4 should be using GFP_NOFS when the caller has a transaction open, has > a page locked, is holding i_mutex, etc. >
Thanks for your feedback. Mingming -
unsubscribe notice
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to
majordomo@vger.kernel.org
More majordomo info at
http://vger.kernel.org/majordomo-info.html
Please read the FAQ at
http://www.tux.org/lkml/
Previous message: [
thread
] [
date
] [
author
]
Next message: [thread] [
date
] [
author
]
Messages in current thread:
[31/36] Large Blocksize: Core piece
,
, (Tue Aug 28, 3:06 pm)
Re: [31/36] Large Blocksize: Core piece
, Mingming Cao
, (Wed Aug 29, 8:11 pm)
Re: [31/36] Large Blocksize: Core piece
, Christoph Lameter
, (Wed Aug 29, 8:12 pm)
[RFC 4/4]ext4: fix rec_len overflow with 64KB block size
, Mingming Cao
, (Wed Aug 29, 8:48 pm)
[RFC 3/4] ext3: fix rec_len overflow with 64KB block size
, Mingming Cao
, (Wed Aug 29, 8:48 pm)
[RFC 2/4]ext2: fix rec_len overflow with 64KB block size
, Mingming Cao
, (Wed Aug 29, 8:47 pm)
[RFC 1/4] Large Blocksize support for Ext2/3/4
, Mingming Cao
, (Wed Aug 29, 8:47 pm)
[PATCH 2/2] ext3: Avoid rec_len overflow with 64KB block size
, Mingming Cao
, (Mon Oct 1, 8:36 pm)
[PATCH 1/2] ext3: Support large blocksize up to PAGESIZE
, Mingming Cao
, (Mon Oct 1, 8:36 pm)
[PATCH 2/2] ext2: Avoid rec_len overflow with 64KB block size
, Mingming Cao
, (Mon Oct 1, 8:35 pm)
Re: [PATCH 2/2] ext2: Avoid rec_len overflow with 64KB block...
, Andrew Morton
, (Thu Oct 4, 4:12 pm)
Re: [PATCH 2/2] ext2: Avoid rec_len overflow with 64KB block...
, Jan Kara
, (Thu Oct 11, 7:18 am)
Re: [PATCH 2/2] ext2: Avoid rec_len overflow with 64KB block...
, Andrew Morton
, (Thu Oct 18, 12:09 am)
Re: [PATCH 2/2] ext2: Avoid rec_len overflow with 64KB block...
, Mingming Cao
, (Thu Oct 18, 10:05 pm)
Re: [PATCH 2/2] ext2: Avoid rec_len overflow with 64KB block...
, Christoph Lameter
, (Thu Oct 18, 5:03 am)
Re: [PATCH 2/2] ext2: Avoid rec_len overflow with 64KB block...
, Andrew Morton
, (Thu Oct 18, 5:11 am)
Re: [PATCH 2/2] ext2: Avoid rec_len overflow with 64KB block...
, Andrew Morton
, (Thu Oct 18, 12:07 am)
Re: [PATCH 2/2] ext2: Avoid rec_len overflow with 64KB block...
, Jan Kara
, (Mon Oct 8, 9:02 am)
Re: [PATCH 2/2] ext2: Avoid rec_len overflow with 64KB block...
, Andreas Dilger
, (Thu Oct 4, 6:40 pm)
Re: [PATCH 2/2] ext2: Avoid rec_len overflow with 64KB block...
, Andrew Morton
, (Thu Oct 4, 7:11 pm)
Re: [PATCH 2/2] ext2: Avoid rec_len overflow with 64KB block...
, Jan Kara
, (Thu Oct 11, 6:30 am)
Re: [PATCH 2/2] ext2: Avoid rec_len overflow with 64KB block...
, Andrew Morton
, (Thu Oct 11, 6:14 am)
[PATCH 1/2] ext2: Support large blocksize up to PAGESIZE
, Mingming Cao
, (Mon Oct 1, 8:35 pm)
[PATCH 2/2] ext4: Avoid rec_len overflow with 64KB block size
, Mingming Cao
, (Mon Oct 1, 8:35 pm)
[PATCH 1/2] ext4: Support large blocksize up to PAGESIZE
, Mingming Cao
, (Mon Oct 1, 8:34 pm)
Re: [RFC 1/4] Large Blocksize support for Ext2/3/4
, Christoph Lameter
, (Wed Aug 29, 8:59 pm)
[RFC 2/2] JBD: blocks reservation fix for large block support
, Mingming Cao
, (Fri Aug 31, 8:12 pm)
[RFC 1/2] JBD: slab management support for large block(>8k)
, Mingming Cao
, (Fri Aug 31, 8:12 pm)
Re: [RFC 1/2] JBD: slab management support for large block(&...
, Christoph Hellwig
, (Sat Sep 1, 2:39 pm)
Re: [RFC 1/2] JBD: slab management support for large block(&...
, Christoph Lameter
, (Sun Sep 2, 7:40 am)
Re: [RFC 1/2] JBD: slab management support for large block(&...
, Christoph Hellwig
, (Sun Sep 2, 11:28 am)
Re: [RFC 1/2] JBD: slab management support for large block(&...
, Christoph Lameter
, (Mon Sep 3, 3:55 am)
Re: [RFC 1/2] JBD: slab management support for large block(&...
, Christoph Hellwig
, (Mon Sep 3, 9:40 am)
Re: [RFC 1/2] JBD: slab management support for large block(&...
, Christoph Lameter
, (Mon Sep 3, 3:31 pm)
Re: [RFC 1/2] JBD: slab management support for large block(&...
, Christoph Hellwig
, (Mon Sep 3, 3:33 pm)
[PATCH] JBD slab cleanups
, Mingming Cao
, (Fri Sep 14, 2:53 pm)
Re: [PATCH] JBD slab cleanups
, Mingming Cao
, (Mon Sep 17, 3:29 pm)
Re: [PATCH] JBD slab cleanups
, Badari Pulavarty
, (Mon Sep 17, 6:01 pm)
Re: [PATCH] JBD slab cleanups
, Mingming Cao
, (Mon Sep 17, 6:57 pm)
Re: [PATCH] JBD slab cleanups
, Christoph Hellwig
, (Tue Sep 18, 5:04 am)
Re: [PATCH] JBD slab cleanups
, Mingming Cao
, (Tue Sep 18, 12:35 pm)
Re: [PATCH] JBD slab cleanups
, Dave Kleikamp
, (Tue Sep 18, 2:04 pm)
Re: [PATCH] JBD slab cleanups
, Mingming Cao
, (Tue Sep 18, 9:00 pm)
Re: [PATCH] JBD slab cleanups
, Andrew Morton
, (Tue Sep 18, 10:19 pm)
Re: [PATCH] JBD slab cleanups
, Mingming Cao
, (Wed Sep 19, 3:15 pm)
Re: [PATCH] JBD slab cleanups
, Andreas Dilger
, (Wed Sep 19, 3:48 pm)
Re: [PATCH] JBD slab cleanups
, Mingming Cao
, (Wed Sep 19, 6:03 pm)
[PATCH] JBD/ext34 cleanups: convert to kzalloc
, Mingming Cao
, (Fri Sep 21, 7:13 pm)
Re: [PATCH] JBD/ext34 cleanups: convert to kzalloc
, Andrew Morton
, (Wed Sep 26, 3:54 pm)
Re: [PATCH] JBD/ext34 cleanups: convert to kzalloc
, Mingming Cao
, (Wed Sep 26, 5:05 pm)
[PATCH] JBD2/ext4 naming cleanup
, Mingming Cao
, (Fri Sep 21, 7:32 pm)
Re: [PATCH] JBD slab cleanups
, Dave Kleikamp
, (Wed Sep 19, 3:26 pm)
Re: [PATCH] JBD slab cleanups
, Dave Kleikamp
, (Wed Sep 19, 3:28 pm)
Re: [PATCH] JBD slab cleanups
, Mingming Cao
, (Wed Sep 19, 4:47 pm)
[PATCH] JBD: use GFP_NOFS in kmalloc
, Mingming Cao
, (Wed Sep 19, 3:22 pm)
Re: [PATCH] JBD: use GFP_NOFS in kmalloc
, Andreas Dilger
, (Thu Sep 20, 12:25 am)
Re: [PATCH] JBD: use GFP_NOFS in kmalloc
, Andrew Morton
, (Wed Sep 19, 5:34 pm)
Re: [PATCH] JBD: use GFP_NOFS in kmalloc
, Mingming Cao
, (Wed Sep 19, 5:55 pm)
Re: [PATCH] JBD slab cleanups
, Christoph Hellwig
, (Mon Sep 17, 3:34 pm)
Re: [PATCH] JBD slab cleanups
, Christoph Lameter
, (Fri Sep 14, 2:58 pm)
Re: [RFC 1/4] Large Blocksize support for Ext2/3/4
, Mingming Cao
, (Fri Aug 31, 8:01 pm)
Navigation
Create content
Mailing list archives
Recent posts
Mail archive search
Enter your search terms.
all mailing lists
alsa-devel
dragonflybsd-bugs
dragonflybsd-commit
dragonflybsd-docs
dragonflybsd-kernel
dragonflybsd-submit
dragonflybsd-user
freebsd-announce
freebsd-bugs
freebsd-chat
freebsd-cluster
freebsd-current
freebsd-drivers
freebsd-embeded
freebsd-fs
freebsd-hackers
freebsd-hardware
freebsd-mobile
freebsd-net
freebsd-performance
freebsd-pf
freebsd-security
freebsd-security-notifications
freebsd-threads
git
git-commits-head
linux-activists
linux-arm
linux-ath5k-devel
linux-c-programming
linux-driver-devel
linux-ext4
linux-fsdevel
linux-input
linux-kernel
linux-kernel-janitors
linux-kernel-mentors
linux-kernel-newbies
linux-net
linux-netdev
linux-newbie
linux-nfs
linux-raid
linux-scsi
linux-security-module
linux-sparse
linux-usb
linux-usb-devel
madwifi-devel
netbsd-announce
netbsd-tech-kern
openbsd-announce
openbsd-bugs
openbsd-ipv6
openbsd-misc
openbsd-security-announce
openbsd-smp
openbsd-source-changes
openbsd-tech
openfabrics-general
openmoko-community
openmoko-devel
openmoko-kernel
ucarp
Optionally limit your search to a specific mailing list.
advanced
Popular discussions
linux-kernel
:
Thomas Gleixner
Re: Linux 2.6.23-rc9 and a heads-up for the 2.6.24 series..
Karl Meyer
PROBLEM: 2.6.23-rc "NETDEV WATCHDOG: eth0: transmit timed out"
Mark Weber
hdparm standby timeout not working for WD raptors?
Robin Lee Powell
NFS hang + umount -f: better behaviour requested.
git
:
Adam Roben
Equivalent of `svn switch` for git-svn?
Linus Torvalds
Re: On Tabs and Spaces
Adam Mercer
git cvsimport error
Sam Song
Fwd: [OT] Re: Git via a proxy server?
openbsd-misc
:
Antti Harri
Re: wine question
Paul Pruett
anyone using zoneminder.com on OpenBSD?
Josh
Re: removing sendmail
Sevan / Venture37
wpi(4) not working in -CURRENT
linux-activists
:
Bill Day
telnet: Unable to connect to remote host: Network is unreachable
Dong Liu
Re: CXterm for LINUX
Framstag
ftp-error: bind: Address already in use?
Theodore Ts'o
RESULT: comp.os.linux passes: 858: 5
Latest forum posts
SMDK2410 LCD Framebuffer driver
5 hours ago
Linux kernel
Resetting the bios password for Toshiba Laptop
5 hours ago
Hardware
Problem booting a barebone kernel in VMWare
8 hours ago
Linux kernel
IP layer send packet
13 hours ago
Linux kernel
PID to ELF image full path
15 hours ago
Linux kernel
types of kernel
1 day ago
Linux kernel
magical mounts
2 days ago
Linux kernel
Problem in scim in Fedora 9
2 days ago
Linux general
The new Western Digital power saving drives
2 days ago
Hardware
Battery Maximizer Software
3 days ago
Linux kernel
Show all forums...
Recent Tags
Ingo Molnar
license
GPLv2
phone
Jobs
-rc9
Neo FreeRunner
2.6.24
HP
Sean Moss-Pultz
Linux
2.6.26
Openmoko
quote
Al Viro
Linus Torvalds
KernelTrap
Andrew Morton
-rc
hardware
more tags
Colocation donated by:
Who's online
There are currently
3 users
and
1353 guests
online.
Online users
Jeremy
memphis
Mr_Z
Syndicate
speck-geostationary