Re: [PATCH] zsmalloc: fix zs_can_compact() integer overflow

2016-05-09 Thread Sergey Senozhatsky
Hello, On (05/09/16 17:07), Minchan Kim wrote: [..] > > Depending on the circumstances, OBJ_ALLOCATED can become less > > than OBJ_USED, which can result in either very high or negative > > `total_scan' value calculated in do_shrink_slab(). > > So, do you see pr_err("shrink_slab: %pF negative obj

Re: [PATCH] zsmalloc: fix zs_can_compact() integer overflow

2016-05-09 Thread Minchan Kim
Hello Sergey, On Mon, May 09, 2016 at 04:35:33PM +0900, Sergey Senozhatsky wrote: > zs_can_compact() has two race conditions in its core calculation: > > unsigned long obj_wasted = zs_stat_get(class, OBJ_ALLOCATED) - > zs_stat_get(class, OBJ_USED); > > 1) classes ar