From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751657AbbFRDBS (ORCPT ); Wed, 17 Jun 2015 23:01:18 -0400 Received: from mail-pa0-f54.google.com ([209.85.220.54]:33619 "EHLO mail-pa0-f54.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750921AbbFRDBM (ORCPT ); Wed, 17 Jun 2015 23:01:12 -0400 Date: Thu, 18 Jun 2015 12:01:36 +0900 From: Sergey Senozhatsky To: Sergey Senozhatsky Cc: Minchan Kim , Sergey Senozhatsky , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [RFC][PATCHv2 8/8] zsmalloc: register a shrinker to trigger auto-compaction Message-ID: <20150618030136.GD3422@swordfish> References: <1433505838-23058-1-git-send-email-sergey.senozhatsky@gmail.com> <1433505838-23058-9-git-send-email-sergey.senozhatsky@gmail.com> <20150616144730.GD31387@blaptop> <20150616154529.GE20596@swordfish> <20150618015028.GA2370@bgram> <20150618023906.GC3422@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150618023906.GC3422@swordfish> User-Agent: Mutt/1.5.23+89 (0255b37be491) (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (06/18/15 11:41), Sergey Senozhatsky wrote: [..] > > My concern is not a compacion overhead but higher memory footprint > > consumed by zram in reserved memory. > > It might hang system if zram used up reserved memory of system with > > ALLOC_NO_WATERMARKS. With auto-compaction, userspace has a higher chance > > to use more memory with uncompressible pages or file-backed pages > > so zram-swap can use more reserved memory. We need to evaluate it, I think. > > a couple of _not really related_ ideas that I want to voice. (a) I'm thinking of extending zramX/compact attr. right now it's WO, and I think it makes sense to make it RW: ->write will trigger compaction ->read will return estimated number of bytes "zs_can_compact() * pages per zspage * page_size" that can be freed. so user-space will have at least minimal idea whether compaction is reasonable. but sure, this is racy and in general case things may change between `cat compact` and `echo 1 > compact`. (b) adding a knob (yeah, like we don't have enough knobs already :-)) that will allow 'enable/disable auto compaction'. -ss From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) by kanga.kvack.org (Postfix) with ESMTP id 8F0BD6B0074 for ; Wed, 17 Jun 2015 23:01:12 -0400 (EDT) Received: by pdjn11 with SMTP id n11so55486323pdj.0 for ; Wed, 17 Jun 2015 20:01:12 -0700 (PDT) Received: from mail-pa0-x232.google.com (mail-pa0-x232.google.com. [2607:f8b0:400e:c03::232]) by mx.google.com with ESMTPS id rl7si9175268pab.173.2015.06.17.20.01.11 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Jun 2015 20:01:11 -0700 (PDT) Received: by pacyx8 with SMTP id yx8so50516497pac.2 for ; Wed, 17 Jun 2015 20:01:11 -0700 (PDT) Date: Thu, 18 Jun 2015 12:01:36 +0900 From: Sergey Senozhatsky Subject: Re: [RFC][PATCHv2 8/8] zsmalloc: register a shrinker to trigger auto-compaction Message-ID: <20150618030136.GD3422@swordfish> References: <1433505838-23058-1-git-send-email-sergey.senozhatsky@gmail.com> <1433505838-23058-9-git-send-email-sergey.senozhatsky@gmail.com> <20150616144730.GD31387@blaptop> <20150616154529.GE20596@swordfish> <20150618015028.GA2370@bgram> <20150618023906.GC3422@swordfish> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150618023906.GC3422@swordfish> Sender: owner-linux-mm@kvack.org List-ID: To: Sergey Senozhatsky Cc: Minchan Kim , Sergey Senozhatsky , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org On (06/18/15 11:41), Sergey Senozhatsky wrote: [..] > > My concern is not a compacion overhead but higher memory footprint > > consumed by zram in reserved memory. > > It might hang system if zram used up reserved memory of system with > > ALLOC_NO_WATERMARKS. With auto-compaction, userspace has a higher chance > > to use more memory with uncompressible pages or file-backed pages > > so zram-swap can use more reserved memory. We need to evaluate it, I think. > > a couple of _not really related_ ideas that I want to voice. (a) I'm thinking of extending zramX/compact attr. right now it's WO, and I think it makes sense to make it RW: ->write will trigger compaction ->read will return estimated number of bytes "zs_can_compact() * pages per zspage * page_size" that can be freed. so user-space will have at least minimal idea whether compaction is reasonable. but sure, this is racy and in general case things may change between `cat compact` and `echo 1 > compact`. (b) adding a knob (yeah, like we don't have enough knobs already :-)) that will allow 'enable/disable auto compaction'. -ss -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org