Linux-mm Archive on lore.kernel.org
 help / color / Atom feed
* Re: [PATCH] ksm: React on changing "sleep_millisecs" parameter faster
@ 2018-12-11 10:03 Cyrill Gorcunov
  2018-12-11 10:26 ` [PATCH v2] " Kirill Tkhai
  0 siblings, 1 reply; 5+ messages in thread
From: Cyrill Gorcunov @ 2018-12-11 10:03 UTC (permalink / raw)
  To: Kirill Tkhai; +Cc: akpm, mhocko, linux-mm, linux-kernel, gorcunov

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!

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, back to index

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-11 10:03 [PATCH] ksm: React on changing "sleep_millisecs" parameter faster Cyrill Gorcunov
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

Linux-mm Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-mm/0 linux-mm/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-mm linux-mm/ https://lore.kernel.org/linux-mm \
		linux-mm@kvack.org
	public-inbox-index linux-mm

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kvack.linux-mm


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git