All of lore.kernel.org
 help / color / mirror / Atom feed
From: Aliaksei Karaliou <akaraliou.dev@gmail.com>
To: Michal Hocko <mhocko@kernel.org>,
	Sergey Senozhatsky <sergey.senozhatsky@gmail.com>
Cc: minchan@kernel.org, ngupta@vflare.org,
	sergey.senozhatsky.work@gmail.com, linux-mm@kvack.org,
	Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH v2] mm/zsmalloc: simplify shrinker init/destroy
Date: Tue, 19 Dec 2017 20:45:17 +0300	[thread overview]
Message-ID: <15c19718-c08e-e7f6-8af9-9651db1b11cc@gmail.com> (raw)
In-Reply-To: <20171219155815.GC2787@dhcp22.suse.cz>



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@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-12-19 17:45 UTC|newest]

Thread overview: 27+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-19  9:21 [PATCH] mm/zsmalloc: simplify shrinker init/destroy Aliaksei Karaliou
2017-12-19 10:22 ` Sergey Senozhatsky
2017-12-19 10:49   ` [PATCH v2] " Aliaksei Karaliou
2017-12-19 11:04     ` Sergey Senozhatsky
2017-12-19 11:56       ` Sergey Senozhatsky
2017-12-19 15:13     ` Michal Hocko
2017-12-19 15:25       ` Sergey Senozhatsky
2017-12-19 15:41         ` Aliaksei Karaliou
2017-12-19 15:58         ` Michal Hocko
2017-12-19 17:45           ` Aliaksei Karaliou [this message]
2017-12-19 23:27             ` Andrew Morton
2017-12-20  1:00               ` Sergey Senozhatsky
2017-12-20  1:00             ` Sergey Senozhatsky
2017-12-20  7:15           ` Sergey Senozhatsky
2017-12-20  8:29             ` A K
2017-12-20  8:34               ` Sergey Senozhatsky
2017-12-20  8:53                 ` A K
2017-12-20  9:08                 ` Michal Hocko
     [not found]                   ` <20171220091653.GE11774@jagdpanzerIV>
2017-12-20  9:25                     ` Michal Hocko
2017-12-20  9:30                       ` A K
2017-12-20 10:21                         ` [PATCH v3] " Aliaksei Karaliou
2017-12-21  2:29                           ` Minchan Kim
2017-12-20 11:05                       ` [PATCH v2] " Tetsuo Handa
2017-12-20 11:38                         ` Michal Hocko
2017-12-20 11:57                           ` Michal Hocko
2017-12-20 21:20                             ` Aliaksei Karaliou
2017-12-21  7:25                               ` Michal Hocko

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=15c19718-c08e-e7f6-8af9-9651db1b11cc@gmail.com \
    --to=akaraliou.dev@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=minchan@kernel.org \
    --cc=ngupta@vflare.org \
    --cc=sergey.senozhatsky.work@gmail.com \
    --cc=sergey.senozhatsky@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.