Re: [PATCH 3/3] zram: add mem_used_max via sysfs

2014-08-17 Thread Minchan Kim
On Thu, Aug 14, 2014 at 11:32:36AM -0400, David Horner wrote: > On Thu, Aug 14, 2014 at 11:09 AM, Dan Streetman wrote: > > On Wed, Aug 13, 2014 at 9:12 PM, Minchan Kim wrote: > >> - if (zram->limit_bytes && > >> - zs_get_total_size_bytes(meta->mem_pool) > > >> zram->limit_byt

Re: [PATCH 3/3] zram: add mem_used_max via sysfs

2014-08-17 Thread Minchan Kim
Hello Dan, On Thu, Aug 14, 2014 at 11:09:05AM -0400, Dan Streetman wrote: > On Wed, Aug 13, 2014 at 9:12 PM, Minchan Kim wrote: > > Normally, zram user can get maximum memory zsmalloc consumed via > > polling mem_used_total with sysfs in userspace. > > > > But it has a critical problem because us

Re: [PATCH 3/3] zram: add mem_used_max via sysfs

2014-08-17 Thread Minchan Kim
Hi David, On Thu, Aug 14, 2014 at 06:29:17AM -0400, David Horner wrote: > The introduction of a reset can cause the stale zero value to be > retained in the show. > Instead reset to current value. It's better. I will do. Thanks! > > On Wed, Aug 13, 2014 at 9:12 PM, Minchan Kim wrote: > > Norma

Re: [PATCH 3/3] zram: add mem_used_max via sysfs

2014-08-14 Thread David Horner
On Thu, Aug 14, 2014 at 3:11 PM, Dan Streetman wrote: > On Thu, Aug 14, 2014 at 12:23 PM, David Horner wrote: >> On Thu, Aug 14, 2014 at 11:32 AM, David Horner wrote: >>> On Thu, Aug 14, 2014 at 11:09 AM, Dan Streetman wrote: On Wed, Aug 13, 2014 at 9:12 PM, Minchan Kim wrote: > -

Re: [PATCH 3/3] zram: add mem_used_max via sysfs

2014-08-14 Thread Dan Streetman
On Thu, Aug 14, 2014 at 12:23 PM, David Horner wrote: > On Thu, Aug 14, 2014 at 11:32 AM, David Horner wrote: >> On Thu, Aug 14, 2014 at 11:09 AM, Dan Streetman wrote: >>> On Wed, Aug 13, 2014 at 9:12 PM, Minchan Kim wrote: - if (zram->limit_bytes && - zs_get_total

Re: [PATCH 3/3] zram: add mem_used_max via sysfs

2014-08-14 Thread David Horner
On Thu, Aug 14, 2014 at 11:32 AM, David Horner wrote: > On Thu, Aug 14, 2014 at 11:09 AM, Dan Streetman wrote: >> On Wed, Aug 13, 2014 at 9:12 PM, Minchan Kim wrote: >>> - if (zram->limit_bytes && >>> - zs_get_total_size_bytes(meta->mem_pool) > >>> zram->limit_bytes) { >>> +

Re: [PATCH 3/3] zram: add mem_used_max via sysfs

2014-08-14 Thread David Horner
On Thu, Aug 14, 2014 at 11:09 AM, Dan Streetman wrote: > On Wed, Aug 13, 2014 at 9:12 PM, Minchan Kim wrote: >> - if (zram->limit_bytes && >> - zs_get_total_size_bytes(meta->mem_pool) > zram->limit_bytes) >> { >> + total_bytes = zs_get_total_size_bytes(meta->mem_pool);

Re: [PATCH 3/3] zram: add mem_used_max via sysfs

2014-08-14 Thread Dan Streetman
On Wed, Aug 13, 2014 at 9:12 PM, Minchan Kim wrote: > Normally, zram user can get maximum memory zsmalloc consumed via > polling mem_used_total with sysfs in userspace. > > But it has a critical problem because user can miss peak memory > usage during update interval of polling. For avoiding that,

Re: [PATCH 3/3] zram: add mem_used_max via sysfs

2014-08-14 Thread David Horner
The introduction of a reset can cause the stale zero value to be retained in the show. Instead reset to current value. On Wed, Aug 13, 2014 at 9:12 PM, Minchan Kim wrote: > Normally, zram user can get maximum memory zsmalloc consumed via > polling mem_used_total with sysfs in userspace. > > But i

[PATCH 3/3] zram: add mem_used_max via sysfs

2014-08-13 Thread Minchan Kim
Normally, zram user can get maximum memory zsmalloc consumed via polling mem_used_total with sysfs in userspace. But it has a critical problem because user can miss peak memory usage during update interval of polling. For avoiding that, user should poll it frequently with mlocking to avoid delay w