* [RFC PATCH] xfs: pass KM_SLEEP flag to kmem_realloc() in xlog_recover_add_to_cnt_trans()
@ 2012-01-27 6:37 Mitsuo Hayasaka
2012-01-27 10:52 ` Christoph Hellwig
2012-01-31 17:50 ` Ben Myers
0 siblings, 2 replies; 3+ messages in thread
From: Mitsuo Hayasaka @ 2012-01-27 6:37 UTC (permalink / raw)
To: Ben Myers, Alex Elder, Christoph Hellwig
Cc: xfs-masters, xfs, linux-kernel, yrl.pp-manager.tt,
Mitsuo Hayasaka, Ben Myers, Alex Elder, Christoph Hellwig
The kmem_realloc() in xfs is given KM_* memory allocation flags. And it
allocates memory using kmalloc() after they are converted to gfp_mask
flags. In xlog_recover_add_to_cont_trans(), 0u is passed to kmem_realloc(),
instead of them. I guess it is preferred to use them, and here memory must
be allocated but don't have to be done with GFP_ATOMIC. So, this patch
changes it to KM_SLEEP.
Signed-off-by: Mitsuo Hayasaka <mitsuo.hayasaka.hu@hitachi.com>
Cc: Ben Myers <bpm@sgi.com>
Cc: Alex Elder <elder@kernel.org>
Cc: Christoph Hellwig <hch@lst.de>
---
fs/xfs/xfs_log_recover.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/fs/xfs/xfs_log_recover.c b/fs/xfs/xfs_log_recover.c
index 541a508..15ff539 100644
--- a/fs/xfs/xfs_log_recover.c
+++ b/fs/xfs/xfs_log_recover.c
@@ -1489,7 +1489,7 @@ xlog_recover_add_to_cont_trans(
old_ptr = item->ri_buf[item->ri_cnt-1].i_addr;
old_len = item->ri_buf[item->ri_cnt-1].i_len;
- ptr = kmem_realloc(old_ptr, len+old_len, old_len, 0u);
+ ptr = kmem_realloc(old_ptr, len+old_len, old_len, KM_SLEEP);
memcpy(&ptr[old_len], dp, len); /* d, s, l */
item->ri_buf[item->ri_cnt-1].i_len += len;
item->ri_buf[item->ri_cnt-1].i_addr = ptr;
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] xfs: pass KM_SLEEP flag to kmem_realloc() in xlog_recover_add_to_cnt_trans()
2012-01-27 6:37 [RFC PATCH] xfs: pass KM_SLEEP flag to kmem_realloc() in xlog_recover_add_to_cnt_trans() Mitsuo Hayasaka
@ 2012-01-27 10:52 ` Christoph Hellwig
2012-01-31 17:50 ` Ben Myers
1 sibling, 0 replies; 3+ messages in thread
From: Christoph Hellwig @ 2012-01-27 10:52 UTC (permalink / raw)
To: Mitsuo Hayasaka
Cc: Ben Myers, Alex Elder, Christoph Hellwig, Alex Elder,
linux-kernel, xfs, xfs-masters, yrl.pp-manager.tt
On Fri, Jan 27, 2012 at 03:37:26PM +0900, Mitsuo Hayasaka wrote:
> The kmem_realloc() in xfs is given KM_* memory allocation flags. And it
> allocates memory using kmalloc() after they are converted to gfp_mask
> flags. In xlog_recover_add_to_cont_trans(), 0u is passed to kmem_realloc(),
> instead of them. I guess it is preferred to use them, and here memory must
> be allocated but don't have to be done with GFP_ATOMIC. So, this patch
> changes it to KM_SLEEP.
Looks good. I actually just noticed it when changing the kmem_realloc
implementation, but let's put your patch in before that and send it off
to Linus ASAP.
Reviewed-by: Christoph Hellwig <hch@lst.de>
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [RFC PATCH] xfs: pass KM_SLEEP flag to kmem_realloc() in xlog_recover_add_to_cnt_trans()
2012-01-27 6:37 [RFC PATCH] xfs: pass KM_SLEEP flag to kmem_realloc() in xlog_recover_add_to_cnt_trans() Mitsuo Hayasaka
2012-01-27 10:52 ` Christoph Hellwig
@ 2012-01-31 17:50 ` Ben Myers
1 sibling, 0 replies; 3+ messages in thread
From: Ben Myers @ 2012-01-31 17:50 UTC (permalink / raw)
To: Mitsuo Hayasaka
Cc: Alex Elder, Christoph Hellwig, Alex Elder, linux-kernel, xfs,
xfs-masters, yrl.pp-manager.tt
On Fri, Jan 27, 2012 at 03:37:26PM +0900, Mitsuo Hayasaka wrote:
> The kmem_realloc() in xfs is given KM_* memory allocation flags. And it
> allocates memory using kmalloc() after they are converted to gfp_mask
> flags. In xlog_recover_add_to_cont_trans(), 0u is passed to kmem_realloc(),
> instead of them. I guess it is preferred to use them, and here memory must
> be allocated but don't have to be done with GFP_ATOMIC. So, this patch
> changes it to KM_SLEEP.
>
> Signed-off-by: Mitsuo Hayasaka <mitsuo.hayasaka.hu@hitachi.com>
> Cc: Ben Myers <bpm@sgi.com>
> Cc: Alex Elder <elder@kernel.org>
> Cc: Christoph Hellwig <hch@lst.de>
Looks good. Consistent with other kmem_*alloc in log recovery.
Reviewed-by: Ben Myers <bpm@sgi.com>
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-01-31 17:50 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-01-27 6:37 [RFC PATCH] xfs: pass KM_SLEEP flag to kmem_realloc() in xlog_recover_add_to_cnt_trans() Mitsuo Hayasaka
2012-01-27 10:52 ` Christoph Hellwig
2012-01-31 17:50 ` Ben Myers
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).