From patchwork Mon Nov 21 19:00:20 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexey Romanov X-Patchwork-Id: 23997 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:f944:0:0:0:0:0 with SMTP id q4csp1775314wrr; Mon, 21 Nov 2022 11:06:21 -0800 (PST) X-Google-Smtp-Source: AA0mqf6CAXuxG/kH/y/SYguyQl5e/ZVvkh4PKz5un88zBF58rryxR6RfB4sb2p9qcB5EJNVwRyeY X-Received: by 2002:aa7:8dd3:0:b0:573:4ae5:e475 with SMTP id j19-20020aa78dd3000000b005734ae5e475mr438850pfr.64.1669057580772; Mon, 21 Nov 2022 11:06:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669057580; cv=none; d=google.com; s=arc-20160816; b=DgukeeIU1d79C8tsV2AR90h3+89RDsaESd1nTGMYjvmcXw+Bhg+6BmODrxGRlZlndk ajC2H7xe3alPWkWxFMDDzpU70xebX51vohyyOTyh8Vi+tA3QMTFvR+zDzcH9edkQe/oa ceJgaNAKUFpoaBc8M5Y2dDkUaBLd0S2uW9yvS8JCwQRQ7aYp0G5uwKcEy8t+05U/tGv5 zLWgKYo893tmdxLiZ1TJy4uAatkbqv1+TXtSIn4avovnfdGmluO/tXA63JoV9woQutRi G+d1KSKEktXD5xZTXuzmwJZFFDhAsY38iXBSlHhbl/etDNRdDlXJtcjRUm25lDgzx+Z7 tuzA== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=tTM44IR5Faf10C/P1nfxsNgdug0WyLlkFkfRmk6dQz8=; b=BqB9MYIkXOQ6vDtddq7tdqVy0dCm2KpafkzvYf/FtuBtWIQj7w8dIg1cUrUoI052uZ XQ/ZmBtIXUHo0bOfVk3sIZ5kBBN/UpPbdG20U7lSbl4y1RPhg2PI3TPL3PAopw+sDQiE nPqiMrMsCjPQQs1DIY5rN6Vqy7ApkmV+hbrL0gcacapTk0jxvrkuj9+a0FsMDIY7S0bL NNcijsdS/Rq4LBTheZXMe7YblT4qZo7f2bruO2E/oDlK2w1p/+nqG8Y72drVwbYa3Sdc NhiQ13NE0/XpYPE5aUden+lJ1LB1B/sbINgdC67/xGHoPutL8/aiJkU1IRXPkfIarbh+ BvoQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=ZgPZzRvJ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id w185-20020a6382c2000000b00477328e3f17si9794362pgd.692.2022.11.21.11.05.52; Mon, 21 Nov 2022 11:06:20 -0800 (PST) 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=@sberdevices.ru header.s=mail header.b=ZgPZzRvJ; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230444AbiKUTBO (ORCPT + 99 others); Mon, 21 Nov 2022 14:01:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230425AbiKUTA6 (ORCPT ); Mon, 21 Nov 2022 14:00:58 -0500 Received: from mx.sberdevices.ru (mx.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0EDACCFE80 for ; Mon, 21 Nov 2022 11:00:56 -0800 (PST) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mx.sberdevices.ru (Postfix) with ESMTP id 6BD2B5FD0D; Mon, 21 Nov 2022 22:00:54 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1669057254; bh=tTM44IR5Faf10C/P1nfxsNgdug0WyLlkFkfRmk6dQz8=; h=From:To:Subject:Date:Message-ID:MIME-Version:Content-Type; b=ZgPZzRvJE29M4MUwixqY94klL086904XptaKyfBbZ2r0zNobazayO2F7pRoP9kY3F 5FUTHdEF2kVnf8QEJvqFG9CdwFShkARs239S88MgZl6Gucbb+ftJwCwrqHOkkTtBkG BPorMZxxQ4qQ3EQ3/Mz4jPfoTgpr0qQqUEUJf5M945USJXQ4EhhM0WHj7GvHweyxRa O/9jKeTOYMJLmAJSObuZn6LFGSL9oyx5LeBV/+ovuM/PhSF5x0i6QYWJskM2bnaw1U HMHzlu+XismWsdQN/V45vD5LFfjERfrHkLz/a6jT6n1ykjM8Zhu/AgwVmU+yEZwF3s JWihXUjKj9KJw== Received: from S-MS-EXCH01.sberdevices.ru (S-MS-EXCH01.sberdevices.ru [172.16.1.4]) by mx.sberdevices.ru (Postfix) with ESMTP; Mon, 21 Nov 2022 22:00:54 +0300 (MSK) From: Alexey Romanov To: , , , CC: , , , , Alexey Romanov Subject: [RFC PATCH v1 4/4] zram: recompression: add ZRAM_MERGED check Date: Mon, 21 Nov 2022 22:00:20 +0300 Message-ID: <20221121190020.66548-5-avromanov@sberdevices.ru> X-Mailer: git-send-email 2.33.0 In-Reply-To: <20221121190020.66548-1-avromanov@sberdevices.ru> References: <20221121190020.66548-1-avromanov@sberdevices.ru> MIME-Version: 1.0 X-Originating-IP: [172.16.1.6] X-ClientProxiedBy: S-MS-EXCH01.sberdevices.ru (172.16.1.4) To S-MS-EXCH01.sberdevices.ru (172.16.1.4) X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/11/21 16:41:00 #20594217 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE,SPF_PASS 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1750133721620870588?= X-GMAIL-MSGID: =?utf-8?q?1750133721620870588?= It is not possible to recompress merged pages in the current implementation. Although, in the future it is possible to add support for recompression of merged pages. Signed-off-by: Alexey Romanov --- drivers/block/zram/zram_drv.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 7a267b37e5db..07661283ea15 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -2211,7 +2211,8 @@ static ssize_t recompress_store(struct device *dev, if (zram_test_flag(zram, index, ZRAM_WB) || zram_test_flag(zram, index, ZRAM_UNDER_WB) || zram_test_flag(zram, index, ZRAM_SAME) || - zram_test_flag(zram, index, ZRAM_INCOMPRESSIBLE)) + zram_test_flag(zram, index, ZRAM_INCOMPRESSIBLE) || + zram_test_flag(zram, index, ZRAM_MERGED)) goto next; err = zram_recompress(zram, index, page, threshold,