From nobody Fri Jan 31 00:24:55 2025 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 5F7671FF602 for ; Mon, 27 Jan 2025 07:30:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.216.41 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737963018; cv=none; b=Yoj7ub8v2oAETcvK+BVd0yNxSEhsZAantV1hn1GjsOobLTdfmTNvkev4uEpYy1NA3rDWh2nFWLnK5STI4299fh3y6cPgbmUMfMvANBhDQCT5JFDwXohy7OjQCWshps1R4ddPpHp09Y3KPnxjKWUuQKVJuU5g0lV4Gt2yZoqC7pM= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1737963018; c=relaxed/simple; bh=xLjcXBVyaOqBx8gEu7T4yqHFwFjH+nKadXGoLMeevHw=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=S6/EvG+kE1OGhfE3t9sHLFcy9kLOhtFQsYCjn5SRhJLAtXeVGW/xwFr/CpFSDtCcQ9WQ1xTLD8n3Pd2VtHbV1UyC+xOoORiPygqlkNIaV9Tip9zpdAU9GKencihyy3kgnDZTGNFgBBl+egPnoc+YzkVNN+m73ZVg1s8grbFUK6U= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org; spf=pass smtp.mailfrom=chromium.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b=VBKSQ2Wk; arc=none smtp.client-ip=209.85.216.41 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=chromium.org Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="VBKSQ2Wk" Received: by mail-pj1-f41.google.com with SMTP id 98e67ed59e1d1-2ee709715d9so5599228a91.3 for ; Sun, 26 Jan 2025 23:30:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1737963016; x=1738567816; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=eEuN8Bq5p1mqZ6qTtfa1iRJPgB+Yv5kUdAyDKcVHFeU=; b=VBKSQ2Wkr0lR0cy7l+9IEA7ArlVTSjPa87IMAmV/JZPlhzo2GfRmMEEVJsyJ8vb4ii mLSu5dlk6HyLvff9OWmVcc/Qj1Q7xiYHuW98svBXfhXsL9AvxbTsQGTJoBo3yaihhk+3 WUNE8WPv19I4uKJGkEez76il1q0FUJvRnlcBg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737963016; x=1738567816; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=eEuN8Bq5p1mqZ6qTtfa1iRJPgB+Yv5kUdAyDKcVHFeU=; b=pOpsNaWbKpcOvhsKh0Dduc+LbAo5M9/dQWTxjWSRCoRSCeuVSPxJcDE57SGdIi0PIz hR+ViMa6+MzbfJVNnhVpD2y8IJjK5OM+LkPCYS4fE315xaypwefwR5eEGoD6XtVBvhBy IsLc/uLyvuIMaHcQHwVHG68mrgJN+K1akJ5rpftoL5RNB8JtB9ReJ4x2Qau6En3Z+r18 Tg2SMFp/j39tdOco0WrFL5w/PV+phQhripIQKzp+YSSzFyUH7WHmPLP4bGn1OkwJpGST cWcXq7c+oBfE+66kZuDCh/+oapbd1lNQz1kvSt9w2kTdlidacEe60A2zGQKh7geWoVEk f40w== X-Forwarded-Encrypted: i=1; AJvYcCXWqqP/FjBDc7O4QoKPedYLHC4ybmTvF4cYDxTybTyhMhJeQpgKLL9dRuPFX/aXqFG72ZCYplLTD1Hpomo=@vger.kernel.org X-Gm-Message-State: AOJu0YzFm5vE85CRkyMQ654cR2IVui7WcI7I7fFX8KLbchod0pDFEd7O 9QXYpUyGKt38Ltw1jJaKB7Dl2mi6DfJYq6SHgXWf/rzOGiq4BC0zGKQb4VJYpg== X-Gm-Gg: ASbGncvTjEjwsS/h3QM6ENux9DvtTqqvA6HvnOVJEzmEHUCtLA0f639ii9r1Uug/Chq svJANnXYcPI6sbh9QKy45tDijLnaLBDKkNp+R8Ojj2/hSwWE6PCIaJ76ATes3tv2ZEUeZKWlNVB U4xhVPiE8VUHc49BwJqO0ZMW8/PcYuwtZva7J2+Yr8nqkC5D2P3ptTn289RPu5EWivgmc+U6Bji r92wsxqNHvUbUGAFkGIBHULPF57Aoe/k4kvqVDCpf2KxK/JD3A4Ra2KI0mVRn35Q5jKPpFGKKy/ BUmHIUY= X-Google-Smtp-Source: AGHT+IGlo/vTdElSIeoYoZL5xyWIf44NgB7/wcjQQDIBMbG82N6RjyywPPzveq1A/4IFqrAaMweY1g== X-Received: by 2002:a17:90b:5249:b0:2ee:e518:c1cb with SMTP id 98e67ed59e1d1-2f782c4bdd2mr61051697a91.7.1737963015607; Sun, 26 Jan 2025 23:30:15 -0800 (PST) Received: from localhost ([2401:fa00:8f:203:566d:6152:c049:8d3a]) by smtp.gmail.com with UTF8SMTPSA id 98e67ed59e1d1-2f7ffa6a755sm7123997a91.26.2025.01.26.23.30.13 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Sun, 26 Jan 2025 23:30:15 -0800 (PST) From: Sergey Senozhatsky To: Andrew Morton , Minchan Kim Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Sergey Senozhatsky Subject: [PATCHv2 7/9] zram: permit reclaim in recompression handle allocation Date: Mon, 27 Jan 2025 16:29:18 +0900 Message-ID: <20250127072932.1289973-8-senozhatsky@chromium.org> X-Mailer: git-send-email 2.48.1.262.g85cc9f2d1e-goog In-Reply-To: <20250127072932.1289973-1-senozhatsky@chromium.org> References: <20250127072932.1289973-1-senozhatsky@chromium.org> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Recompression path can now permit direct reclaim during new zs_handle allocation, because it's not atomic anymore. Signed-off-by: Sergey Senozhatsky --- 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 046c80aa4310..10e4c6a7735c 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1988,17 +1988,11 @@ static int recompress_slot(struct zram *zram, u32 i= ndex, struct page *page, return 0; =20 /* - * 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 =3D 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); --=20 2.48.1.262.g85cc9f2d1e-goog