lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 21 Apr 2007 02:55:28 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Peter Zijlstra <a.p.zijlstra@...llo.nl>
Cc:	linux-mm@...ck.org, linux-kernel@...r.kernel.org,
	miklos@...redi.hu, neilb@...e.de, dgc@....com,
	tomoki.sekiyama.qu@...achi.com, nikita@...sterfs.com,
	trond.myklebust@....uio.no, yingchao.zhou@...il.com
Subject: Re: [PATCH 09/10] mm: expose BDI statistics in sysfs.

On Fri, 20 Apr 2007 17:52:03 +0200 Peter Zijlstra <a.p.zijlstra@...llo.nl> wrote:

> Expose the per BDI stats in /sys/block/<dev>/queue/*
> 
> Signed-off-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> ---
>  block/ll_rw_blk.c |   32 ++++++++++++++++++++++++++++++++
>  1 file changed, 32 insertions(+)
> 
> Index: linux-2.6-mm/block/ll_rw_blk.c
> ===================================================================
> --- linux-2.6-mm.orig/block/ll_rw_blk.c
> +++ linux-2.6-mm/block/ll_rw_blk.c
> @@ -3976,6 +3976,15 @@ static ssize_t queue_max_hw_sectors_show
>  	return queue_var_show(max_hw_sectors_kb, (page));
>  }
>  
> +static ssize_t queue_nr_reclaimable_show(struct request_queue *q, char *page)
> +{
> +	return sprintf(page, "%lld\n", bdi_stat(&q->backing_dev_info, BDI_RECLAIMABLE));
> +}

We try to present memory statistics to userspace in bytes or kbytes rather
than number-of-pages.  Because page-size varies between architectures and
between .configs.  Displaying number-of-pages is just inviting people to write
it-broke-when-i-moved-it-to-ia64 applications.

Plus kbytes is a bit more user-friendly, particularly when the user will
want to compare these numbers to /proc/meminfo, for example.

Using %llu might be more appropriate than %lld.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ