[2/3]
But why isn't mem_used_max writable? (save tearing down and rebuilding device to reset max) static DEVICE_ATTR(mem_used_max, S_IRUGO, mem_used_max_show, NULL); static DEVICE_ATTR(mem_used_max, S_IRUGO | S_IWUSR, mem_used_max_show, NULL); with a check in the store() that the new value is positive and less than current max? I'm also a little puzzled why there is a new API zs_get_max_size_bytes if the data is accessible through sysfs? Especially if max limit will be (as you propose for [3/3]) through accessed through zsmalloc and hence zram needn't access. [3/3] I concur that the zram limit is best implemented in zsmalloc. I am looking forward to that revised code. > From: Minchan Kim <minchan <at> kernel.org> > Subject: [RFC 2/3] zsmalloc/zram: add zs_get_max_size_bytes and use it in > zram > <http://news.gmane.org/find-root.php?message_id=1407225723%2d23754%2d3%2dgit%2dsend%2demail%2dminchan%40kernel.org> > Newsgroups: gmane.linux.kernel.mm > <http://news.gmane.org/gmane.linux.kernel.mm>, gmane.linux.kernel > <http://news.gmane.org/gmane.linux.kernel> > Date: 2014-08-05 08:02:02 GMT (5 hours and 4 minutes ago) > > 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 so that gap between them could be > huge when memory pressure is really heavy. > > This patch adds new API zs_get_max_size_bytes in zsmalloc so > user(ex, zram) doesn't need to poll in short interval to get > exact value. > > User can just see max memory usage once his test workload is > done. It's pretty handy and accurate. -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/