lkml.org 
[lkml]   [2020]   [Mar]   [11]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC PATCH 1/3] proc/meminfo: introduce extra meminfo
On Wed, Mar 11, 2020 at 12:44:39PM +0900, Jaewon Kim wrote:
> Provide APIs to drivers so that they can show its memory usage on
> /proc/meminfo.
>
> int register_extra_meminfo(atomic_long_t *val, int shift,
> const char *name);
> int unregister_extra_meminfo(atomic_long_t *val);

> + show_val_kb(m, memtemp->name_pad, nr_page);

I have 3 issues.

Can this be printed without "KB" piece and without useless whitespace,
like /proc/vmstat does?

I don't know how do you parse /proc/meminfo.
Do you search for specific string or do you use some kind of map[k] = v
interface?

2) zsmalloc can create top-level symlink and resolve it to necessary value.
It will be only 1 readlink(2) system call to fetch it.

3) android can do the same

For simple values there is no need to register stuff and create
mini subsystems.

/proc/alexey

\
 
 \ /
  Last update: 2020-03-11 18:36    [W:0.112 / U:0.452 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site