From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id B707EC43441 for ; Wed, 28 Nov 2018 23:30:24 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 78FF62081B for ; Wed, 28 Nov 2018 23:30:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 78FF62081B Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726918AbeK2Kdl (ORCPT ); Thu, 29 Nov 2018 05:33:41 -0500 Received: from mail.linuxfoundation.org ([140.211.169.12]:39106 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726635AbeK2Kdk (ORCPT ); Thu, 29 Nov 2018 05:33:40 -0500 Received: from akpm3.svl.corp.google.com (unknown [104.133.8.65]) by mail.linuxfoundation.org (Postfix) with ESMTPSA id 54D73A92; Wed, 28 Nov 2018 23:30:22 +0000 (UTC) Date: Wed, 28 Nov 2018 15:30:21 -0800 From: Andrew Morton To: Minchan Kim Cc: LKML , Sergey Senozhatsky Subject: Re: [PATCH v2 6/7] zram: add bd_stat statistics Message-Id: <20181128153021.3f125ed82df68a29e25ce428@linux-foundation.org> In-Reply-To: <20181127020754.GB237537@google.com> References: <20181126082813.81977-1-minchan@kernel.org> <20181126082813.81977-7-minchan@kernel.org> <20181126125833.e95a21088ae60ccc6fd55022@linux-foundation.org> <20181127020754.GB237537@google.com> X-Mailer: Sylpheed 3.6.0 (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 Tue, 27 Nov 2018 11:07:54 +0900 Minchan Kim wrote: > On Mon, Nov 26, 2018 at 12:58:33PM -0800, Andrew Morton wrote: > > 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. > > zram works based on page so I used that term but I agree it's rather > vague. If there is no objection, I will use (Unit: 4K) instead of > (Unit: pages). Is that still true if PAGE_SIZE=64k?