linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Andrew Morton <akpm@linux-foundation.org>,
	Yosry Ahmed <yosry.ahmed@linux.dev>
Cc: Minchan Kim <minchan@kernel.org>,
	Johannes Weiner <hannes@cmpxchg.org>,
	Nhat Pham <nphamcs@gmail.com>, Uros Bizjak <ubizjak@gmail.com>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: [PATCHv2 7/7] zram: add might_sleep to zcomp API
Date: Thu, 30 Jan 2025 13:42:50 +0900	[thread overview]
Message-ID: <20250130044455.2642465-8-senozhatsky@chromium.org> (raw)
In-Reply-To: <20250130044455.2642465-1-senozhatsky@chromium.org>

Explicitly state that zcomp compress/decompress must be
called from non-atomic context.

Signed-off-by: Sergey Senozhatsky <senozhatsky@chromium.org>
---
 drivers/block/zram/zcomp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/block/zram/zcomp.c b/drivers/block/zram/zcomp.c
index 675f2a51ad5f..f4235735787b 100644
--- a/drivers/block/zram/zcomp.c
+++ b/drivers/block/zram/zcomp.c
@@ -185,6 +185,7 @@ int zcomp_compress(struct zcomp *comp, struct zcomp_strm *zstrm,
 	};
 	int ret;
 
+	might_sleep();
 	ret = comp->ops->compress(comp->params, &zstrm->ctx, &req);
 	if (!ret)
 		*dst_len = req.dst_len;
@@ -201,6 +202,7 @@ int zcomp_decompress(struct zcomp *comp, struct zcomp_strm *zstrm,
 		.dst_len = PAGE_SIZE,
 	};
 
+	might_sleep();
 	return comp->ops->decompress(comp->params, &zstrm->ctx, &req);
 }
 
-- 
2.48.1.262.g85cc9f2d1e-goog



  parent reply	other threads:[~2025-01-30  4:45 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-30  4:42 [PATCHv2 0/7] zsmalloc: preemptible object mapping Sergey Senozhatsky
2025-01-30  4:42 ` [PATCHv2 1/7] zsmalloc: factor out pool locking helpers Sergey Senozhatsky
2025-01-30  4:42 ` [PATCHv2 2/7] zsmalloc: re-shuffle zs_pool members Sergey Senozhatsky
2025-01-30  4:42 ` [PATCHv2 3/7] zsmalloc: factor out size-class locking helpers Sergey Senozhatsky
2025-01-30  4:42 ` [PATCHv2 4/7] zsmalloc: make zspage lock preemptible Sergey Senozhatsky
2025-01-30  4:42 ` [PATCHv2 5/7] zsmalloc: introduce new object mapping API Sergey Senozhatsky
2025-01-30  4:42 ` [PATCHv2 6/7] zram: switch to new zsmalloc " Sergey Senozhatsky
2025-01-30  4:42 ` Sergey Senozhatsky [this message]
2025-01-30 14:21 ` [PATCHv2 0/7] zsmalloc: preemptible object mapping Sergey Senozhatsky

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=20250130044455.2642465-8-senozhatsky@chromium.org \
    --to=senozhatsky@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    --cc=nphamcs@gmail.com \
    --cc=ubizjak@gmail.com \
    --cc=yosry.ahmed@linux.dev \
    /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