All of lore.kernel.org
 help / color / mirror / Atom feed
From: Charan Teja Reddy <charante@codeaurora.org>
To: akpm@linux-foundation.org, vbabka@suse.cz, corbet@lwn.net,
	mcgrof@kernel.org, keescook@chromium.org, yzaikin@google.com,
	osalvador@suse.de, rientjes@google.com,
	mchehab+huawei@kernel.org, lokeshgidra@google.com,
	andrew.a.klychkov@gmail.com, xi.fengfei@h3c.com,
	nigupta@nvidia.com, dave.hansen@linux.intel.com,
	famzheng@amazon.com, mateusznosek0@gmail.com,
	oleksandr@redhat.com, sh_def@163.com
Cc: linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
	Charan Teja Reddy <charante@codeaurora.org>
Subject: [PATCH V4 3/3] mm: compaction: fix wakeup logic of proactive compaction
Date: Fri, 18 Jun 2021 20:48:55 +0530	[thread overview]
Message-ID: <89e90b9c13566e7c28d70e5d6aa048ee3ec41757.1624028025.git.charante@codeaurora.org> (raw)
In-Reply-To: <cover.1624028025.git.charante@codeaurora.org>
In-Reply-To: <cover.1624028025.git.charante@codeaurora.org>

Currently, proactive compaction tries to get triggered for every
HPAGE_FRAG_CHECK_INTERVAL_MSEC(=500msec) even when proactive compaction
is disabled with sysctl.compaction_proactiveness = 0. This results in
kcompactd thread wakes up and goes to sleep for every 500msec with out
the need of doing proactive compaction. Though this doesn't have any
overhead, few cpu cycles can be saved by avoid of waking up kcompactd
thread for proactive compaction when it is disabled.

Signed-off-by: Charan Teja Reddy <charante@codeaurora.org>
---
 -- Changes in V4:
       o No functional changes from V3.
 -- Changes in V3:
       o Fix wake up logic in proactive compaction.
 -- Changes in V2 through V2 doesn't exist.

 mm/compaction.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/mm/compaction.c b/mm/compaction.c
index 7672be3..44a232a 100644
--- a/mm/compaction.c
+++ b/mm/compaction.c
@@ -2928,6 +2928,8 @@ static int kcompactd(void *p)
 	while (!kthread_should_stop()) {
 		unsigned long pflags;
 
+		if (!sysctl_compaction_proactiveness)
+			timeout = MAX_SCHEDULE_TIMEOUT;
 		trace_mm_compaction_kcompactd_sleep(pgdat->node_id);
 		if (wait_event_freezable_timeout(pgdat->kcompactd_wait,
 			kcompactd_work_requested(pgdat), timeout) &&
-- 
QUALCOMM INDIA, on behalf of Qualcomm Innovation Center, Inc. is a
member of the Code Aurora Forum, hosted by The Linux Foundation


  parent reply	other threads:[~2021-06-18 15:22 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-18 15:18 [PATCH V4,0/3] mm: compaction: proactive compaction trigger by user Charan Teja Reddy
2021-06-18 15:18 ` [PATCH V4 1/3] mm: compaction: optimize proactive compaction deferrals Charan Teja Reddy
2021-06-18 15:18 ` [PATCH V4 2/3] mm: compaction: support triggering of proactive compaction by user Charan Teja Reddy
2021-06-18 15:18 ` Charan Teja Reddy [this message]
2021-07-03 10:22 ` [PATCH V4,0/3] mm: compaction: proactive compaction trigger " Charan Teja Kalla
2021-07-16  4:27   ` Andrew Morton
2021-07-16 10:44     ` Charan Teja Kalla

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=89e90b9c13566e7c28d70e5d6aa048ee3ec41757.1624028025.git.charante@codeaurora.org \
    --to=charante@codeaurora.org \
    --cc=akpm@linux-foundation.org \
    --cc=andrew.a.klychkov@gmail.com \
    --cc=corbet@lwn.net \
    --cc=dave.hansen@linux.intel.com \
    --cc=famzheng@amazon.com \
    --cc=keescook@chromium.org \
    --cc=linux-doc@vger.kernel.org \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=lokeshgidra@google.com \
    --cc=mateusznosek0@gmail.com \
    --cc=mcgrof@kernel.org \
    --cc=mchehab+huawei@kernel.org \
    --cc=nigupta@nvidia.com \
    --cc=oleksandr@redhat.com \
    --cc=osalvador@suse.de \
    --cc=rientjes@google.com \
    --cc=sh_def@163.com \
    --cc=vbabka@suse.cz \
    --cc=xi.fengfei@h3c.com \
    --cc=yzaikin@google.com \
    --subject='Re: [PATCH V4 3/3] mm: compaction: fix wakeup logic of proactive compaction' \
    /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

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.