Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp1919959pxb; Fri, 24 Sep 2021 15:18:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzXdzOQKhYBw548nSGj6aMQ10AD1j86lQGWm9eenr0UNkpdAeGatOIVgI4ONe5Jk/ltZRV2 X-Received: by 2002:a92:cecf:: with SMTP id z15mr10391272ilq.96.1632521881249; Fri, 24 Sep 2021 15:18:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632521881; cv=none; d=google.com; s=arc-20160816; b=NH8JB8ZHeTX3adc6NUYmol8M7eP2dhEwUeG97191BLsGj+n9APerc6J7me0uMRaSAf FNN3mzyZ22u7NELwpG2bnNNH0KwEMF3CgodO0+huSS5PUxZo/nXOu6DdnKhRpftcEygI YoAkf80o2SawxJX/8e2KLWDssOwzUzX2kq7ucysG0pMAe9gHJH7Q/zcvccQuS3xY+iWX A4Zgucr+DIH2/eXjRm3DxLhYGp4uQBg9RllaDycV/U8dAGRwnD7XX6nu7CbsdV6sf2Oc hyok0hfs1NW6O+BIkGfCD5nlhE5Mx6uokPNHDZyrj90/goD8Ydo4MtmGButOhVKMokc0 AxsQ== 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:subject:cc:to:from:date :dkim-signature; bh=EmCdTdUc2eokZ22RTljKv93Xp4Qc9nm02Tq3z6O7iVM=; b=IfDYgSgaikXBr+QUH7I2Pi3qRKjc5iIE0sNQYB0jdrxtzDPwqGfGUgewadhOKh8qY0 +X763iiSVEYqyoN3r9RITYo3PAsWw79aCOTq2nsPjNnFsVNOSg5GouWBBEYU6IKQKTEO 09V2qtibjr8XjkuECFv0RqpJ4bx97Cqh/KMjsi2tLhNIXyXYs0OtMsH8o59YNEAKAfy0 RAYJvLX+Wp6x9eqWQkjuKd00WT1JRIqPd11qtR2VmMvCfpzTccJdFmc9X/3sYDYjddBX iTGs5v/GL77EuR52zt2z86hwke7Q6qFX0krlcscy7SVCEGfX8+BRJ7nMDlngEcUKYE3E FQ9w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="v5cJFMY/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 205si11514663ioa.52.2021.09.24.15.17.50; Fri, 24 Sep 2021 15:18:01 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b="v5cJFMY/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1348252AbhIXTz5 (ORCPT + 99 others); Fri, 24 Sep 2021 15:55:57 -0400 Received: from mail.kernel.org ([198.145.29.99]:41200 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345937AbhIXTz5 (ORCPT ); Fri, 24 Sep 2021 15:55:57 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id 5879F6103D; Fri, 24 Sep 2021 19:54:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1632513263; bh=ukP31P3ZCbd3SW/z+kSgzmpssJsR08rh0NSjW1DOuw0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=v5cJFMY/oHXiaLx/PcI7cSIIO/6F2NxdLW8DrNvjiHhR/MElw6W//OPe7WJU/DGG0 BnVE3pt774VkHH/X+CJ/WADPXKV8uP6kSqXS3s8z2y7ubybfxQPcCLZdJaWj2Kd1dy rHwQK0Lc8z1r0axPSQY52clYcoExli7fIYOFKEvc= Date: Fri, 24 Sep 2021 12:54:22 -0700 From: Andrew Morton To: Brian Geffon Cc: Minchan Kim , Nitin Gupta , Sergey Senozhatsky , Jonathan Corbet , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-block@vger.kernel.org, Suleiman Souhlal , Jesse Barnes Subject: Re: [PATCH v5] zram: Introduce an aged idle interface Message-Id: <20210924125422.358374d83cdb95db055a4467@linux-foundation.org> In-Reply-To: <20210924161128.1508015-1-bgeffon@google.com> References: <20210917210640.214211-1-bgeffon@google.com> <20210924161128.1508015-1-bgeffon@google.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, 24 Sep 2021 09:11:28 -0700 Brian Geffon wrote: > This change introduces an aged idle interface to the existing > idle sysfs file for zram. > > When CONFIG_ZRAM_MEMORY_TRACKING is enabled the idle file > now also accepts an integer argument. This integer is the > age (in seconds) of pages to mark as idle. The idle file > still supports 'all' as it always has. This new approach > allows for much more control over which pages get marked > as idle. > > v4 -> v5: > - Andrew's suggestions to use IS_ENABLED and > cleanup comment. Also this? --- a/drivers/block/zram/zram_drv.c~zram-introduce-an-aged-idle-interface-v5-fix +++ a/drivers/block/zram/zram_drv.c @@ -309,9 +309,8 @@ static void mark_idle(struct zram *zram, zram_slot_lock(zram, index); if (zram_allocated(zram, index) && !zram_test_flag(zram, index, ZRAM_UNDER_WB)) { -#ifdef CONFIG_ZRAM_MEMORY_TRACKING + if (IS_ENABLED(CONFIG_ZRAM_MEMORY_TRACKING)) is_idle = (!cutoff || ktime_after(cutoff, zram->table[index].ac_time)); -#endif if (is_idle) zram_set_flag(zram, index, ZRAM_IDLE); } _