Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp432659imu; Mon, 26 Nov 2018 12:59:45 -0800 (PST) X-Google-Smtp-Source: AFSGD/X6s6jzG44d4dGZmNNrqhClAOqbUnIWAKCFN/i2kMEuu4JC51v/YUoTfhA/rjASl2q019Dw X-Received: by 2002:a17:902:a03:: with SMTP id 3mr17111026plo.112.1543265985309; Mon, 26 Nov 2018 12:59:45 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543265985; cv=none; d=google.com; s=arc-20160816; b=jUK29/pdrxqY/PoW0i8ST8LqRo+nv4IdB1OQO4ssH8s+eRy1v7P16HztHkyI6qnBVV xqxgwOxMGvyq5Kd3GF3zA1rjqOGCGN7y7Vjx6ykLbbJTICkpUERYZ0piz6rIGH40LsCe UglMJsnxiIQKCgOmAsLBhqY4KBYc4MZYFipl3Mvh5aeP74eYzTP2qiXIH1annhb1OMib ZwrFbVSGDDd9L/u8NnCl8i7UNnJgws8ZUrelS5rus/STwYFebzTo3rgW6EeKmrDt2TOC sk63tUsww7Mo517Cw7TN4lDNp5YJc5bnUNq1pCYEuqX/Mn4ZZEcQo8x9Qy8HYamlW1zc k63g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=gqSd0hTDSJb60jVgGVXRRMxV8CuzKk+I4QKszV31Y+c=; b=JpFTBX/0k6jl8ftQy7IN4VoD4UicuHS1coPxUXW3AlXquFaY73+7czCpwJxwo2pVJ5 BhRUkGApn5+18WC1Bo5e1wt5VJAxY2NsnyQ9+GlN3lCtRcoQHOi4Jqkad3Z2yaT3d7YF LIU0LeZq7GPL7vIVoDsFsxEpREPq8mapvZyYeS5ciIrGJCaT0MQjxW4j0CU4OnlpcGiV VCBmApH9sL0aH2u4Rjh4TMJqBDQql29h/X44aGJvYfjUOeL1Mih6kD/SrbAYP0pc75i4 YhfgFWQ3qqfl/kiTHfsd25oKFcbJd7Z1LbkWAGqJWq1elpUqCizujnjnTLqsqQpbWQE9 noXw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id n67si1466564pfk.34.2018.11.26.12.59.30; Mon, 26 Nov 2018 12:59:45 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727372AbeK0Hx6 (ORCPT + 99 others); Tue, 27 Nov 2018 02:53:58 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39512 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727105AbeK0Hx5 (ORCPT ); Tue, 27 Nov 2018 02:53:57 -0500 Received: from localhost.localdomain (c-24-6-170-16.hsd1.ca.comcast.net [24.6.170.16]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 70798723; Mon, 26 Nov 2018 20:58:34 +0000 (UTC) Date: Mon, 26 Nov 2018 12:58:33 -0800 From: Andrew Morton To: Minchan Kim Cc: LKML , Sergey Senozhatsky Subject: Re: [PATCH v2 6/7] zram: add bd_stat statistics Message-Id: <20181126125833.e95a21088ae60ccc6fd55022@linux-foundation.org> In-Reply-To: <20181126082813.81977-7-minchan@kernel.org> References: <20181126082813.81977-1-minchan@kernel.org> <20181126082813.81977-7-minchan@kernel.org> 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 26 Nov 2018 17:28:12 +0900 Minchan Kim wrote: > +File /sys/block/zram/bd_stat > + > +The stat file represents device's backing device statistics. It consists of > +a single line of text and contains the following stats separated by whitespace: > + bd_count size of data written in backing device. > + Unit: pages > + bd_reads the number of reads from backing device > + Unit: pages > + bd_writes the number of writes to backing device > + Unit: pages Using `pages' is a bad choice. And I assume this means that writeback_limit is in pages as well, which is worse. Page sizes are not constant! We want userspace which was developed on 4k pagesize to work the same on 64k pagesize. Arguably, we could require that well-written userspace remember to use getpagesize(). However we have traditionally tried to avoid that by performing the pagesize normalization within the kernel.