Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp2174314pxb; Fri, 24 Sep 2021 23:25:00 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwXe+1dHvX3vvGvmX8GSTWk7da1ak2+pb8XIb1SVN1KsucVreS/HkovVkiljxJVpVl5I3Uj X-Received: by 2002:a6b:fe18:: with SMTP id x24mr12423205ioh.119.1632551100380; Fri, 24 Sep 2021 23:25:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632551100; cv=none; d=google.com; s=arc-20160816; b=k1h1jjWU99bzuWN5+dNSKPeG8nRFminxd6dUt3FNVq/t9XuvC/ZlUMU/IZ6z0fheFq 4Au+1Yrx8s7scIKK5TzPC2Xz3fYqpQj1Q5wBqLz8iiagshfvqkz8GlceZuW5Ei26DYDy TIveJsieFTcFJEWgALsv3jxCvCJDvkqU9hTRXYspaCpszAP4K0KFgQ7kOePX+ZcIM9or pn6AcOo5UO5kF7SFEMLeijtHbzvkzg3RbP+/swM1uUPNXZgWl68NJCYh7Qym34xc9XYh egyQ5DvXZeoMWeUWIhAiY7BI9ws/NModRmAWJgT8dGmy+QPCacZYiuqxzHr9sKAwMjcF igRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=dma3ODYRAwAqQNgxjoPPmrM71vwSjvGubtDE6+J/Uj4=; b=gT9sAr8l5EefW8Cv6rL1bbJn1gAqFE6Vh2B27IyRMzo7WVuphWLhpmeMY/gvy5bwT2 0YXy8O7ucwxefJx5LJegxUZkzGVYIzbiEDjbwDPMDCm63pTY35bxRGAVtuEFW7vCO4RL Lyy+K7lTrGCjX9BngqYNS4gB30IDUrbVfK7WpMLm33+j4SfEgQ7kP4ivpN2jM0JDSvrV mISBA+jMbKKaHs4U6ofbF6QPLTB+YIK3uktZ2ZOYohYY8ElK4cRfYHYTIvtX+9hJ3+rI xOS8rhn1JI0lUYpicCj+LjinQI9ZdidOChFz51J2SnNeK+77DlvoNPEbtOD13wf2evKX k7XA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=TCKaE7TN; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m3si13440210jaa.33.2021.09.24.23.24.49; Fri, 24 Sep 2021 23:25:00 -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=@google.com header.s=20210112 header.b=TCKaE7TN; 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; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1346158AbhIXURi (ORCPT + 99 others); Fri, 24 Sep 2021 16:17:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33938 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345611AbhIXURh (ORCPT ); Fri, 24 Sep 2021 16:17:37 -0400 Received: from mail-ed1-x529.google.com (mail-ed1-x529.google.com [IPv6:2a00:1450:4864:20::529]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EE17C06161E for ; Fri, 24 Sep 2021 13:16:04 -0700 (PDT) Received: by mail-ed1-x529.google.com with SMTP id y12so4315765edo.9 for ; Fri, 24 Sep 2021 13:16:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=dma3ODYRAwAqQNgxjoPPmrM71vwSjvGubtDE6+J/Uj4=; b=TCKaE7TNX17wekyhEJMq0Q25AVyKWiZRP+g/+Gp/8PWclgr/jK3NrgttQdr7wcLdXR Q7Vui+5HdK/XtCPVLRA1f3pBVqdfXx9tpC6sVw/nnEysSkKizl2mQK1SQUekXcJnHoZb iKS9R9k/fhu93FJDzD8w8K1oJinhGnJ23XrS0RrTKDPGUkbMcQkqosdn1u9ndrmaqYVX aY+QtdNzVtWH36uUWKCcNE6ZOBnMcRs/Ux8HSJmt9kBinzOvcfA/PBdBGjSEj4T5I68L agEiE1FY6qB/1zx1Jyhcyw1sMqbjO4VrSZY6VVVg4ZwmbJQMY9JC9tCVJhGtQbWB3EHK KETg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=dma3ODYRAwAqQNgxjoPPmrM71vwSjvGubtDE6+J/Uj4=; b=3M8vq66FHuOhLOA0DkFQBaJiSrKE2SYu7lybi62FejDgDHlRx7fxVWqs2q5qL02Xlu j6ynfe+EQTd9pOeZo7TuMiFggxmdd9JxQy32Do5ylqD7jjMHozlaDRRwRf19wFeWkbnz UhZuFxFF8M/s6pEU5EsaR8oWxfBK8d0eLi5TUQirDv6meXUnp5l2APlxsIYybLEDEQOa Zq14rviOvR4EVuvlm/WIBSXXz0Z+D/sKiQqxF4B2LbbvbRPOqu5FugjsgGIS4V0XN4wO eCKi4TnhGGO+a8PXzcFy9Vd0ztj37a9k6mZXe0z0hH4UwW+YpHlar6FhEXebUE5uqiY1 0Avw== X-Gm-Message-State: AOAM5330DCjhCYgUp/BeRjmj4fkXpzNYoOi06NpgxG3cCRC3e26QH20M MqbfHtOzwN7AA/pASYfkRBkI9ako3gj7aOAsKt6bJg== X-Received: by 2002:a17:906:2bc3:: with SMTP id n3mr13014432ejg.548.1632514562127; Fri, 24 Sep 2021 13:16:02 -0700 (PDT) MIME-Version: 1.0 References: <20210917210640.214211-1-bgeffon@google.com> <20210924161128.1508015-1-bgeffon@google.com> <20210924125422.358374d83cdb95db055a4467@linux-foundation.org> In-Reply-To: <20210924125422.358374d83cdb95db055a4467@linux-foundation.org> From: Brian Geffon Date: Fri, 24 Sep 2021 16:15:26 -0400 Message-ID: Subject: Re: [PATCH v5] zram: Introduce an aged idle interface To: Andrew Morton Cc: Minchan Kim , Nitin Gupta , Sergey Senozhatsky , Jonathan Corbet , LKML , linux-doc@vger.kernel.org, linux-block@vger.kernel.org, Suleiman Souhlal , Jesse Barnes Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > 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); > } > _ > Hi Andrew, As written that patch won't compile when CONFIG_ZRAM_MEMORY_TRACKING=n, my guess is that the compiler pass that removes the dead branch only happens after it attempts to compile the branch itself. So it appears that even though IS_ENABLED(..) always evaluates to 0, the compile will fail because table[index].ac_time does not exist. You should get an error like this: drivers/block/zram/zram_drv.c:314:57: error: no member named 'ac_time' in 'struct zram_table_entry' (!cutoff || ktime_after(cutoff, zram->table[index].ac_time))) Brian