Received: by 2002:a05:6358:3188:b0:123:57c1:9b43 with SMTP id q8csp420248rwd; Wed, 14 Jun 2023 18:39:19 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ4WHet4JPR7EtNRSENX5IyDpp91znTNSUZEoPV1NfWsScIP0622PZK3n2Va8KOq+19FdSzv X-Received: by 2002:a05:622a:4d2:b0:3f6:b1ad:97e with SMTP id q18-20020a05622a04d200b003f6b1ad097emr3990980qtx.7.1686793159307; Wed, 14 Jun 2023 18:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1686793159; cv=none; d=google.com; s=arc-20160816; b=S9Otlwh2NZHpAfasgLJ8/If2odwquY6ZksuyyPInAytJ26yO9vS7QugtBZYYjqFDcd K19GOrsr5hPMkKAR2nbq4wNtppCU6aNWAkLVOOnNS09xbI/fdwiFbJBBO1+/ZV/G8ahK kS66ETq79WAt3BTz3IGYGWz7/UEh4RNx7WrqfpyH7L5Une/YgKtcVAHJiY45nX1LG/vw 8IncX7WXby7u2O3gAPjM8kTuS+FR2Fien3CVCV30xIf0E7/+SszRbuY2YFpYGp3RzBhH bd87NItgXWXaEQ+BUbkLDgpz7Vogxg0Bcyk/rley+T4DhhjtHPIXBXml0BYVVGFGyk/2 7NRw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=hx/F41WmoagRHV/54mU3GIZ0Rr4r8+ldlSacsREhph0=; b=mgvvi3feXVO1Oz3rdGlToT9t2VPg+s8/C8cfdbCVfp2bCj/5D/5iRWjRR4alH0r26P kddya2+srAk6TUzjIw5yKO5YPRzhxzmv63hQ65ASnYtW0kUEGMrX2Vy8Dhz1fNEHmEay JStgG8NqYOkmKdbUS/AIifoe567EJH/BfoF9A9gS10Ytj8hBl5hYpvyZyJtvJX8Q+w6o +SzG2KknMfeloyLd7rMteX11LS1kz+AJ78qAFvHRjTLRPFTf8k8hRLrqBBqeg9CKVh9N pZYFyy2CIIa1kd0Z4ytPHhKb84O2loJHwThlr6Ft2L/Nr9KXCNmIcYFcyAgeLYHmxyAp atDA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="RlbJpt/L"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f10-20020a63de0a000000b00528ca427963si12108891pgg.709.2023.06.14.18.39.06; Wed, 14 Jun 2023 18:39:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b="RlbJpt/L"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S237015AbjFOBbd (ORCPT + 99 others); Wed, 14 Jun 2023 21:31:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:39766 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229527AbjFOBbc (ORCPT ); Wed, 14 Jun 2023 21:31:32 -0400 Received: from mail-pl1-x62d.google.com (mail-pl1-x62d.google.com [IPv6:2607:f8b0:4864:20::62d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63181212D for ; Wed, 14 Jun 2023 18:31:31 -0700 (PDT) Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-1b3dd3ca7adso28305915ad.3 for ; Wed, 14 Jun 2023 18:31:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; t=1686792691; x=1689384691; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=hx/F41WmoagRHV/54mU3GIZ0Rr4r8+ldlSacsREhph0=; b=RlbJpt/LYH+6wShImnDyT/vnic79PMh24HXKnIOo2SBShDTz6PgzaEV8qDJwyuSSwv Kv/C+msLxEQjsxmv+SScprcnneAD/ul0vJaLDiffndK/A1oVu5zvrrSRBVlcIeygc9It aEwsENZb0IstuPWrUi5VWjzEhHz1syRUYcrq8= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1686792691; x=1689384691; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=hx/F41WmoagRHV/54mU3GIZ0Rr4r8+ldlSacsREhph0=; b=fZ0Xcibuh+Esoemp4CrUyOxgf13JqPts5tCAalfBaC6dMnZ5Xnp+JNn8Fnc6h67KOd SYVzEO7KvBT/e8jPu0zcwBDST6XPUgtv+dLdMDoxqMFWEoJPCps51e81R6Jg+lNUUvhx YN2QBNvUEq27suYKIPb6k3+BnFtNHhCiWyqMdcHqLvtfw/FibkDJ9QW+6SKq0QJbTX1v qNCrB/qyvHBKOLDjN5kr9sCUINntTaAHrZA50jpB4YfxzPr84K6r0u9Eg8otdvuJfDNQ eQ/iARml04qJAqmvGX18gKuWXVgCaeWLkmSoT2f0YN9PvUo9KTWvOyun7JEuduNJcXTS XFpw== X-Gm-Message-State: AC+VfDxagfPcGl/vKjAlU+w7r+SWGxWH8rZJ0ut2t1cDJm/bxhLkXk/Q M1eNbFhLC+z81WE74LkmQxMYbg== X-Received: by 2002:a17:903:32c7:b0:1b0:4c32:5d6d with SMTP id i7-20020a17090332c700b001b04c325d6dmr18495150plr.31.1686792690899; Wed, 14 Jun 2023 18:31:30 -0700 (PDT) Received: from tigerii.tok.corp.google.com ([2401:fa00:8f:203:e1a3:812:fed0:eeab]) by smtp.gmail.com with ESMTPSA id w22-20020a170902d71600b001a64851087bsm3925829ply.272.2023.06.14.18.31.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 14 Jun 2023 18:31:30 -0700 (PDT) From: Sergey Senozhatsky To: Andrew Morton , Minchan Kim Cc: Jens Axboe , linux-kernel@vger.kernel.org, linux-block@vger.kernel.org, Sergey Senozhatsky , Brian Geffon Subject: [PATCHv2] zram: further limit recompression threshold Date: Thu, 15 Jun 2023 10:30:20 +0900 Message-ID: <20230615013122.3564479-1-senozhatsky@chromium.org> X-Mailer: git-send-email 2.41.0.162.gfafddb0af9-goog MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Recompression threshold should be below huge-size-class watermark. Any object larger than huge-size-class is a "huge object" and occupies a whole physical page on the zsmalloc side, in other words it's incompressible, as far as zsmalloc is concerned. Suggested-by: Brian Geffon Signed-off-by: Sergey Senozhatsky --- drivers/block/zram/zram_drv.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 1867f378b319..5676e6dd5b16 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1753,7 +1753,7 @@ static ssize_t recompress_store(struct device *dev, } } - if (threshold >= PAGE_SIZE) + if (threshold >= huge_class_size) return -EINVAL; down_read(&zram->init_lock); -- 2.41.0.162.gfafddb0af9-goog