linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Chintan Pandya <cpandya@codeaurora.org>
Cc: tglx@linutronix.de, john.stultz@linaro.org, peterz@infradead.org,
	mingo@redhat.com, hughd@google.com, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org
Subject: Re: [PATCH v2 2/2] ksm: Provide support to use deferrable timers for scanner thread
Date: Wed, 30 Jul 2014 14:47:52 -0700	[thread overview]
Message-ID: <20140730144752.8c931d9ed997324632d5f2fd@linux-foundation.org> (raw)
In-Reply-To: <1406299698-6357-2-git-send-email-cpandya@codeaurora.org>

On Fri, 25 Jul 2014 20:18:18 +0530 Chintan Pandya <cpandya@codeaurora.org> wrote:

> KSM thread to scan pages is scheduled on definite timeout. That wakes
> up CPU from idle state and hence may affect the power consumption.
> Provide an optional support to use deferrable timer which suites
> low-power use-cases.
> 
> Typically, on our setup we observed, 10% less power consumption with
> some use-cases in which CPU goes to power collapse frequently. For
> example, playing audio while typically CPU remains idle.
> 
> To enable deferrable timers,
> $ echo 1 > /sys/kernel/mm/ksm/deferrable_timer

This could not have been the version which you tested.  What's up?

--- a/mm/ksm.c~ksm-provide-support-to-use-deferrable-timers-for-scanner-thread-fix-fix-2
+++ a/mm/ksm.c
@@ -1720,8 +1720,6 @@ static int ksmd_should_run(void)
 
 static int ksm_scan_thread(void *nothing)
 {
-	signed long to;
-
 	set_freezable();
 	set_user_nice(current, 5);
 
@@ -1735,7 +1733,9 @@ static int ksm_scan_thread(void *nothing
 		try_to_freeze();
 
 		if (ksmd_should_run()) {
-			timeout = msecs_to_jiffies(ksm_thread_sleep_millisecs);
+			signed long to;
+
+			to = msecs_to_jiffies(ksm_thread_sleep_millisecs);
 			if (use_deferrable_timer)
 				schedule_timeout_deferrable_interruptible(to);
 			else
_

--
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>

  parent reply	other threads:[~2014-07-30 21:47 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-25 14:48 [PATCH v2 1/2] timer: provide an api for deferrable timeout Chintan Pandya
2014-07-25 14:48 ` [PATCH v2 2/2] ksm: Provide support to use deferrable timers for scanner thread Chintan Pandya
2014-07-29 22:03   ` Andrew Morton
2014-07-30 21:47   ` Andrew Morton [this message]
2014-07-31  5:37     ` Chintan Pandya

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=20140730144752.8c931d9ed997324632d5f2fd@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=cpandya@codeaurora.org \
    --cc=hughd@google.com \
    --cc=john.stultz@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.org \
    --cc=tglx@linutronix.de \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox