linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Sergey Senozhatsky <senozhatsky@chromium.org>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Minchan Kim <minchan@kernel.org>,
	linux-mm@kvack.org, linux-kernel@vger.kernel.org,
	Sergey Senozhatsky <senozhatsky@chromium.org>
Subject: [PATCHv3 07/11] zram: permit reclaim in recompression handle allocation
Date: Thu, 30 Jan 2025 20:10:52 +0900	[thread overview]
Message-ID: <20250130111105.2861324-8-senozhatsky@chromium.org> (raw)
In-Reply-To: <20250130111105.2861324-1-senozhatsky@chromium.org>

Recompression path can now permit direct reclaim during
new zs_handle allocation, because it's not atomic anymore.

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

diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c
index 28e5b02dc3a1..ac8b4f47a496 100644
--- a/drivers/block/zram/zram_drv.c
+++ b/drivers/block/zram/zram_drv.c
@@ -1981,17 +1981,11 @@ static int recompress_slot(struct zram *zram, u32 index, struct page *page,
 		return 0;
 
 	/*
-	 * No direct reclaim (slow path) for handle allocation and no
-	 * re-compression attempt (unlike in zram_write_bvec()) since
-	 * we already have stored that object in zsmalloc. If we cannot
-	 * alloc memory for recompressed object then we bail out and
-	 * simply keep the old (existing) object in zsmalloc.
+	 * If we cannot alloc memory for recompressed object then we bail out
+	 * and simply keep the old (existing) object in zsmalloc.
 	 */
 	handle_new = zs_malloc(zram->mem_pool, comp_len_new,
-			       __GFP_KSWAPD_RECLAIM |
-			       __GFP_NOWARN |
-			       __GFP_HIGHMEM |
-			       __GFP_MOVABLE);
+			       GFP_NOIO | __GFP_HIGHMEM | __GFP_MOVABLE);
 	if (IS_ERR_VALUE(handle_new)) {
 		zcomp_stream_put(zram->comps[prio], zstrm);
 		return PTR_ERR((void *)handle_new);
-- 
2.48.1.262.g85cc9f2d1e-goog



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

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-30 11:10 [PATCHv3 00/11] zram: preemptible writes and occasionally preemptible reads Sergey Senozhatsky
2025-01-30 11:10 ` [PATCHv3 01/11] zram: switch to non-atomic entry locking Sergey Senozhatsky
2025-01-30 11:10 ` [PATCHv3 02/11] zram: do not use per-CPU compression streams Sergey Senozhatsky
2025-01-30 11:10 ` [PATCHv3 03/11] zram: remove crypto include Sergey Senozhatsky
2025-01-30 11:10 ` [PATCHv3 04/11] zram: remove max_comp_streams device attr Sergey Senozhatsky
2025-01-30 11:10 ` [PATCHv3 05/11] zram: remove two-staged handle allocation Sergey Senozhatsky
2025-01-30 11:10 ` [PATCHv3 06/11] zram: permit reclaim in zstd custom allocator Sergey Senozhatsky
2025-01-30 11:10 ` Sergey Senozhatsky [this message]
2025-01-30 11:10 ` [PATCHv3 08/11] zram: remove writestall zram_stats member Sergey Senozhatsky
2025-01-30 11:10 ` [PATCHv3 09/11] zram: limit max recompress prio to num_active_comps Sergey Senozhatsky
2025-01-30 11:10 ` [PATCHv3 10/11] zram: filter out recomp targets based on priority Sergey Senozhatsky
2025-01-30 11:10 ` [PATCHv3 11/11] zram: unlock slot during recompression Sergey Senozhatsky
2025-01-30 14:18 ` [PATCHv3 00/11] zram: preemptible writes and occasionally preemptible reads 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=20250130111105.2861324-8-senozhatsky@chromium.org \
    --to=senozhatsky@chromium.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=minchan@kernel.org \
    /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