Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp420655rwl; Fri, 4 Nov 2022 01:56:05 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5sM1zo4tsb7kFA1LcgJ5rcqFbfDUqHG7OZkjAqtRB1EcX40S5S/uKv6mtzO8XzrQjqAgA1 X-Received: by 2002:aa7:9298:0:b0:56b:b6dc:988a with SMTP id j24-20020aa79298000000b0056bb6dc988amr34904843pfa.5.1667552164846; Fri, 04 Nov 2022 01:56:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667552164; cv=none; d=google.com; s=arc-20160816; b=udlAlEmEH20sJY4tGXxeV15JxU0Lbg+xZNiCmykl2kqHKYCDuoD6Br7y6n4KJU6dWW ABun+9tsyzbfLKwBZCdoKR4Vdk0HAJS6Tpypquz/3+LGkFhpRdIA5lZZFt+zWvprNNmZ DpGQ5g1P/+2xsY5q8M/crsWxJrLo8SOa1r0V8mhS9gKSE0ZHdWpxc1leFhCZ60/t8CCe vryXV/aNGcOLpm+hxKm/vqYiJdp5ZvBKfmcCX9FInKYEvQ6XnDx7ZIEfHWG2ejhKnFAG Zf/fXw4+M9pA7gmvrVs+4vhJpgFNqKHEw8NJaZwurXHFioDWixtRBJm7dK2EgHc2IhD1 qQgA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=PNE4/+TJdC1epwove+2dQ4MoIHCeASG45k2ERB81ttk=; b=qH4gKWn4Xj4c6cP2kzqyn0iG4W3vZ6hTqWP2pnmC1iVElCqw5NQicT5N/3NqiFMKU5 IiqHUXeweGPLByRRVZ7yNcwWDxU4WAPq77jxVpg8FN4BcNy+PsdL3VD6Tx+wYQccz4iy ZWu1e4gT863DY0BuEl4E6R6V/GandRiSMT6YuYwiD5N+iX8LBQhYd6ep1Z5RqDRpJxBU UAy4/LZrkEy0vXS0c6pizCJsB3gMSTrrD4giBpZ6W/dMS/9eBgZp+RyBSyxKhr2xwli8 td1hRtnWUK32qaysChekuHLBumnSTl0lv1fZwVbnwx5A9rvJ+YUuIwULLGYN1HS6WYMt EP0w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=jvLgUz81; 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 d24-20020a170902729800b0017a007f3d3esi3115068pll.421.2022.11.04.01.55.50; Fri, 04 Nov 2022 01:56:04 -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=jvLgUz81; 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 S230254AbiKDIJA (ORCPT + 96 others); Fri, 4 Nov 2022 04:09:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43794 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230098AbiKDII7 (ORCPT ); Fri, 4 Nov 2022 04:08:59 -0400 Received: from mail-pj1-x1031.google.com (mail-pj1-x1031.google.com [IPv6:2607:f8b0:4864:20::1031]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1094221266 for ; Fri, 4 Nov 2022 01:08:58 -0700 (PDT) Received: by mail-pj1-x1031.google.com with SMTP id l22-20020a17090a3f1600b00212fbbcfb78so7506334pjc.3 for ; Fri, 04 Nov 2022 01:08:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=PNE4/+TJdC1epwove+2dQ4MoIHCeASG45k2ERB81ttk=; b=jvLgUz81AaSsUkBBNw0rIxUTwkDsPsfJL3yG+Q1m8hvoPabQL3jYMLIHvnL7o7efM3 OY4nL5C0ezKDjMbaN1oOKBgisiYuuOa9cEfHiNNi8n/U42tdRMolODVyLArAL1D6BSVZ mwhHI06OIgV6rTHDni7jzcchwxds0UearMStA= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=PNE4/+TJdC1epwove+2dQ4MoIHCeASG45k2ERB81ttk=; b=LL+Hn3pOFgA4F5nrNt30kbim6oUEnsjh21WiEGXx4MoYGl/Weie1fimJvll92t96nZ t8iM477hpPrqXPnc6L9nWR8q0uXOa4AJqMFDbe/SFtiqW+q/mxWTbhlOm9JkqqARNkKz JI97NVHkBdKFyvbQTzlinaf/edpfzJOykPnK7J5y/69ks9FFHv7Jru9nSSbgYSXNq8Gk mBY9DY1rzMoDOVbtwMInwJVvWvXYkK0+uyHy8RFTHfPZyJrHT8bbuwyD7KX5Cs8nIWIK 7W4dBxZPGWGljnurkdjzl+MP2eiQru9/80GWdfkoe1DaIkZbJ62UQIB54/JJxUTOQm0P RPWA== X-Gm-Message-State: ACrzQf31K2wovCtddStPGvL+FXY8ox6eGn/jd2QK/SWqSgYcetuu6O87 YJeqS4CjS+EItHuGy1AVUyQOJw== X-Received: by 2002:a17:902:d4cc:b0:186:f57d:ba61 with SMTP id o12-20020a170902d4cc00b00186f57dba61mr34296152plg.97.1667549337608; Fri, 04 Nov 2022 01:08:57 -0700 (PDT) Received: from google.com ([240f:75:7537:3187:f2f6:8f5:87c8:3aeb]) by smtp.gmail.com with ESMTPSA id d8-20020a170902654800b00172f6726d8esm1901198pln.277.2022.11.04.01.08.55 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 04 Nov 2022 01:08:57 -0700 (PDT) Date: Fri, 4 Nov 2022 17:08:53 +0900 From: Sergey Senozhatsky To: Minchan Kim Cc: Andrew Morton , Nitin Gupta , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sergey Senozhatsky Subject: Re: [PATCHv4 4/9] zram: Introduce recompress sysfs knob Message-ID: References: <20221018045533.2396670-1-senozhatsky@chromium.org> <20221018045533.2396670-5-senozhatsky@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FSL_HELO_FAKE, RCVD_IN_DNSWL_NONE,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 On (22/11/04 16:53), Sergey Senozhatsky wrote: [..] > +static inline void zram_set_priority(struct zram *zram, u32 index, u32 prio) > +{ > + prio &= ZRAM_COMP_PRIORITY_MASK; > + zram->table[index].flags &= (prio << ZRAM_COMP_PRIORITY_1); > +} Uh... Something like this, sorry. +static inline void zram_set_priority(struct zram *zram, u32 index, u32 prio) +{ + prio &= ZRAM_RECOMP_PRIO_MASK; + zram->table[index].flags &= ~(ZRAM_RECOMP_PRIO_MASK << + ZRAM_RECOMP_PRIORITY_1); + zram->table[index].flags |= (prio << ZRAM_RECOMP_PRIORITY_1); +}