Re: [PATCH v2] mm/zsmalloc: simplify shrinker init/destroy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 





On 12/19/2017 06:58 PM, Michal Hocko wrote:
On Wed 20-12-17 00:25:36, Sergey Senozhatsky wrote:
Hi Michal,

On (12/19/17 16:13), Michal Hocko wrote:
On Tue 19-12-17 13:49:12, Aliaksei Karaliou wrote:
[...]
@@ -2428,8 +2422,8 @@ struct zs_pool *zs_create_pool(const char *name)
  	 * Not critical, we still can use the pool
  	 * and user can trigger compaction manually.
  	 */
-	if (zs_register_shrinker(pool) == 0)
-		pool->shrinker_enabled = true;
+	(void) zs_register_shrinker(pool);
+
  	return pool;
So what will happen if the pool is alive and used without any shrinker?
How do objects get freed?
we use shrinker for "optional" de-fragmentation of zsmalloc pools. we
don't free any objects from that path. just move them around within their
size classes - to consolidate objects and to, may be, free unused pages
[but we first need to make them "unused"]. it's not a mandatory thing for
zsmalloc, we are just trying to be nice.
OK, it smells like an abuse of the API but please add a comment
clarifying that.

Thanks!
I can update the existing comment to be like that:
        /*
         * Not critical since shrinker is only used to trigger internal
         * de-fragmentation of the pool which is pretty optional thing.
         * If registration fails we still can use the pool normally and
         * user can trigger compaction manually. Thus, ignore return code.
         */

Sergey, does this sound well to you ? Or not clear enough, Michal ?

Best regards,
    Aliaksei

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]
  Powered by Linux