Re: [RFC][PATCH 07/10] zsmalloc: introduce auto-compact support

2015-06-04 Thread Sergey Senozhatsky
On (06/04/15 16:04), Minchan Kim wrote: [..] > How about using slab shrinker? > If there is memory pressure, it would be called by VM and we will > try compaction without user's intervention and excessive object > scanning should be avoid by your zs_can_compact. hm, interesting. ok, have a patch

Re: [RFC][PATCH 07/10] zsmalloc: introduce auto-compact support

2015-06-04 Thread Sergey Senozhatsky
On (06/04/15 15:27), Minchan Kim wrote: [..] > > The problem is migration/freeing old zspage/allocating new zspage is > not a cheap, either. > If the system has no problem with small fragmented space, there is > no point to keep such overheads. > > So, ideal is we should trigger compaction once we

Re: [RFC][PATCH 07/10] zsmalloc: introduce auto-compact support

2015-06-04 Thread Minchan Kim
On Thu, Jun 04, 2015 at 03:27:12PM +0900, Minchan Kim wrote: > On Thu, Jun 04, 2015 at 02:30:56PM +0900, Sergey Senozhatsky wrote: > > On (06/04/15 13:57), Minchan Kim wrote: > > > On Sat, May 30, 2015 at 12:05:25AM +0900, Sergey Senozhatsky wrote: > > > > perform class compaction in zs_free(), if

Re: [RFC][PATCH 07/10] zsmalloc: introduce auto-compact support

2015-06-03 Thread Minchan Kim
On Thu, Jun 04, 2015 at 02:30:56PM +0900, Sergey Senozhatsky wrote: > On (06/04/15 13:57), Minchan Kim wrote: > > On Sat, May 30, 2015 at 12:05:25AM +0900, Sergey Senozhatsky wrote: > > > perform class compaction in zs_free(), if zs_free() has created > > > a ZS_ALMOST_EMPTY page. this is the most

Re: [RFC][PATCH 07/10] zsmalloc: introduce auto-compact support

2015-06-03 Thread Sergey Senozhatsky
On (06/04/15 13:57), Minchan Kim wrote: > On Sat, May 30, 2015 at 12:05:25AM +0900, Sergey Senozhatsky wrote: > > perform class compaction in zs_free(), if zs_free() has created > > a ZS_ALMOST_EMPTY page. this is the most trivial `policy'. > > Finally, I got realized your intention. > > Actually

Re: [RFC][PATCH 07/10] zsmalloc: introduce auto-compact support

2015-06-03 Thread Minchan Kim
On Sat, May 30, 2015 at 12:05:25AM +0900, Sergey Senozhatsky wrote: > perform class compaction in zs_free(), if zs_free() has created > a ZS_ALMOST_EMPTY page. this is the most trivial `policy'. Finally, I got realized your intention. Actually, I had a plan to add /sys/block/zram0/compact_thresho