linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH v5 1/4] zram: Fix deadlock bug in partial write
@ 2013-01-28  0:38 Minchan Kim
  2013-01-28  0:38 ` [RESEND PATCH v5 2/4] zram: force disksize setting before using zram Minchan Kim
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Minchan Kim @ 2013-01-28  0:38 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-mm, linux-kernel, Dan Magenheimer, Nitin Gupta,
	Konrad Rzeszutek Wilk, Seth Jennings, Pekka Enberg, Minchan Kim,
	stable, Jerome Marchand

Now zram allocates new page with GFP_KERNEL in zram I/O path
if IO is partial. Unfortunately, It may cuase deadlock with
reclaim path so this patch solves the problem.

Cc: stable@vger.kernel.org
Cc: Jerome Marchand <jmarchan@redhat.com>
Acked-by: Nitin Gupta <ngupta@vflare.org>
Signed-off-by: Minchan Kim <minchan@kernel.org>
---
 drivers/staging/zram/zram_drv.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/zram/zram_drv.c b/drivers/staging/zram/zram_drv.c
index 61fb8f1..b285b3a 100644
--- a/drivers/staging/zram/zram_drv.c
+++ b/drivers/staging/zram/zram_drv.c
@@ -220,7 +220,7 @@ static int zram_bvec_read(struct zram *zram, struct bio_vec *bvec,
 	user_mem = kmap_atomic(page);
 	if (is_partial_io(bvec))
 		/* Use  a temporary buffer to decompress the page */
-		uncmem = kmalloc(PAGE_SIZE, GFP_KERNEL);
+		uncmem = kmalloc(PAGE_SIZE, GFP_ATOMIC);
 	else
 		uncmem = user_mem;
 
@@ -268,7 +268,7 @@ static int zram_bvec_write(struct zram *zram, struct bio_vec *bvec, u32 index,
 		 * This is a partial IO. We need to read the full page
 		 * before to write the changes.
 		 */
-		uncmem = kmalloc(PAGE_SIZE, GFP_KERNEL);
+		uncmem = kmalloc(PAGE_SIZE, GFP_NOIO);
 		if (!uncmem) {
 			pr_info("Error allocating temp memory!\n");
 			ret = -ENOMEM;
-- 
1.7.9.5


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2013-01-31  5:41 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-28  0:38 [RESEND PATCH v5 1/4] zram: Fix deadlock bug in partial write Minchan Kim
2013-01-28  0:38 ` [RESEND PATCH v5 2/4] zram: force disksize setting before using zram Minchan Kim
2013-01-28  0:38 ` [RESEND PATCH v5 3/4] zram: give up lazy initialization of zram metadata Minchan Kim
2013-01-28  0:38 ` [RESEND PATCH v5 4/4] zram: get rid of lockdep warning Minchan Kim
2013-01-28  7:16 ` [RESEND PATCH v5 1/4] zram: Fix deadlock bug in partial write Pekka Enberg
2013-01-28 11:24   ` Jerome Marchand
2013-01-28 13:26     ` Pekka Enberg
2013-01-28 13:47       ` Jerome Marchand
2013-01-28 23:21   ` Minchan Kim
2013-01-29  7:11     ` Pekka Enberg
2013-01-30  1:32       ` Minchan Kim
2013-01-30  4:20 ` Greg Kroah-Hartman
2013-01-30  8:21   ` Minchan Kim
2013-01-31  5:41     ` Minchan Kim

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).