From: Cyrill Gorcunov <gorcunov@gmail.com>
To: Kirill Tkhai <ktkhai@virtuozzo.com>
Cc: akpm@linux-foundation.org, mhocko@suse.com, linux-mm@kvack.org,
linux-kernel@vger.kernel.org, gorcunov@virtuozzo.com
Subject: Re: [PATCH] ksm: React on changing "sleep_millisecs" parameter faster
Date: Tue, 11 Dec 2018 13:03:46 +0300 [thread overview]
Message-ID: <20181211100346.GE2342@uranus.lan> (raw)
In-Reply-To: <db19c148-b375-b6f2-dbf5-9e78f5e46c04@virtuozzo.com>
On Tue, Dec 11, 2018 at 12:23:11PM +0300, Kirill Tkhai wrote:
...
> > Kirill, can we rather reuse @ksm_thread variable from ksm_init
> > (by moving it to static file level variable).
>
> I've considered using it, but this is not looks good for me.
> The problem is ksm thread may be parked, or it even may fail
> to start. But at the same time, parallel writes to "sleep_millisecs"
> are possible. There is a place for races, so to use the local
> variable in ksm_init() (like we have at the moment) looks better
> for me. At the patch the mutex protects against any races.
>
> > Also wakening up
> > unconditionally on write looks somehow suspicious to me
> > though I don't have a precise argument against.
>
> The conditional wait requires one more wait_queue. This is
> the thing I tried to avoid. But. I also had doubts about
> this, so you are already the second person, who worries :)
> It looks like we really need to change this.
>
> How are you about something like the below?
I see. The code below looks a way better for me, thanks!
next prev parent reply other threads:[~2018-12-11 10:03 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-12-10 16:06 [PATCH] ksm: React on changing "sleep_millisecs" parameter faster Kirill Tkhai
2018-12-10 20:10 ` Cyrill Gorcunov
2018-12-11 9:23 ` Kirill Tkhai
2018-12-11 10:03 ` Cyrill Gorcunov [this message]
2018-12-11 10:26 ` [PATCH v2] " Kirill Tkhai
2018-12-11 11:13 ` Cyrill Gorcunov
2018-12-11 12:22 ` Kirill Tkhai
2018-12-11 12:34 ` Cyrill Gorcunov
2018-12-11 14:15 ` Kirill Tkhai
2018-12-11 15:11 ` [PATCH v3] " Kirill Tkhai
2018-12-11 15:19 ` Cyrill Gorcunov
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=20181211100346.GE2342@uranus.lan \
--to=gorcunov@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=gorcunov@virtuozzo.com \
--cc=ktkhai@virtuozzo.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=mhocko@suse.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.