linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] zswap: do not allocate from atomic pool
@ 2022-11-22  1:33 Sergey Senozhatsky
  2022-11-22  1:56 ` Andrew Morton
  2022-11-22  3:16 ` Johannes Weiner
  0 siblings, 2 replies; 8+ messages in thread
From: Sergey Senozhatsky @ 2022-11-22  1:33 UTC (permalink / raw)
  To: Andrew Morton
  Cc: Seth Jennings, Dan Streetman, Vitaly Wool, Nhat Pham,
	Johannes Weiner, Minchan Kim, linux-mm, linux-kernel,
	Sergey Senozhatsky

zswap_frontswap_load() should be called from preemptible
context (we even call mutex_lock() there) and it does not
look like we need to do GFP_ATOMIC allocaion for temp
buffer there. Use GFP_KERNEL instead.

Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
---
 mm/zswap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/zswap.c b/mm/zswap.c
index 2d69c1d678fe..f6c89049cf70 100644
--- a/mm/zswap.c
+++ b/mm/zswap.c
@@ -1314,7 +1314,7 @@ static int zswap_frontswap_load(unsigned type, pgoff_t offset,
 	}
 
 	if (!zpool_can_sleep_mapped(entry->pool->zpool)) {
-		tmp = kmalloc(entry->length, GFP_ATOMIC);
+		tmp = kmalloc(entry->length, GFP_KERNEL);
 		if (!tmp) {
 			ret = -ENOMEM;
 			goto freeentry;
-- 
2.38.1.584.g0f3c55d4c2-goog



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

end of thread, other threads:[~2022-11-24  3:55 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-22  1:33 [PATCH] zswap: do not allocate from atomic pool Sergey Senozhatsky
2022-11-22  1:56 ` Andrew Morton
2022-11-22  2:43   ` Sergey Senozhatsky
2022-11-22  3:16 ` Johannes Weiner
2022-11-22  3:30   ` Sergey Senozhatsky
2022-11-24  3:32     ` Sergey Senozhatsky
2022-11-24  3:42       ` Andrew Morton
2022-11-24  3:55         ` Nhat Pham

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox