From patchwork Wed Dec 1 15:04:30 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SeongJae Park X-Patchwork-Id: 12650159 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id B1DA3C433F5 for ; Wed, 1 Dec 2021 15:11:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4DEAD6B0089; Wed, 1 Dec 2021 10:08:35 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 46A516B008A; Wed, 1 Dec 2021 10:08:35 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2BA1E6B008C; Wed, 1 Dec 2021 10:08:35 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0148.hostedemail.com [216.40.44.148]) by kanga.kvack.org (Postfix) with ESMTP id 16CDF6B0089 for ; Wed, 1 Dec 2021 10:08:35 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with ESMTP id C87BE1812E208 for ; Wed, 1 Dec 2021 15:08:24 +0000 (UTC) X-FDA: 78869556528.07.8FCDCE8 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by imf13.hostedemail.com (Postfix) with ESMTP id 751C6105B603 for ; Wed, 1 Dec 2021 15:05:04 +0000 (UTC) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0C694B81F6E; Wed, 1 Dec 2021 15:05:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 41BC5C53FCC; Wed, 1 Dec 2021 15:04:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1638371099; bh=LnVq1MEm2bCsu9Z8LA3AWGyf0J5QJ1npa9erK6XACwM=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=fKE1umMNcZcEJrZUq9xVufn4g8c2edh5yFbyvY6b4Wf8XDc0tMQP3s4H832Sk+k1j k1gt7arlHYl1vnDooDiRmdiB9y3E3zPE+9ZnmwmFr2OBksR15oA43V2sCaB0Hfr1Js 4LVeGCcAcTpTg0hqXVC1SYg+cClPnZ4AEt1FK9EEkVy2tshf9TAiejafEuFm3AZZYp 8Yo78c1orW2M2zl39yXwGG9e1mHS94RJtouxGGCq3ACk3K0ozczPMDjFsTHYyKtjaO rWd3DTtmaVARqtl2vbUwoOknnXoANg2BPmd7o+oGeZZqLODhzpZRgCM9hU3DHbu5RT dCcyfoS+w6++g== From: SeongJae Park To: akpm@linux-foundation.org Cc: shuah@kernel.org, brendanhiggins@google.com, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, SeongJae Park Subject: [PATCH 01/11] mm/damon/core: Use better timer mechanisms selection threshold Date: Wed, 1 Dec 2021 15:04:30 +0000 Message-Id: <20211201150440.1088-2-sj@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20211201150440.1088-1-sj@kernel.org> References: <20211201150440.1088-1-sj@kernel.org> X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: 751C6105B603 X-Stat-Signature: atzmqyjeza4yidz16aueuhs7w4kuna54 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=fKE1umMN; spf=pass (imf13.hostedemail.com: domain of sj@kernel.org designates 145.40.68.75 as permitted sender) smtp.mailfrom=sj@kernel.org; dmarc=pass (policy=none) header.from=kernel.org X-HE-Tag: 1638371104-802272 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: DAMON is using hrtimer if requested sleep time is <=100ms, while the suggested threshold[1] is <=20ms. This commit applies the threshold. [1] Documentation/timers/timers-howto.rst Fixes: ee801b7dd7822 ("mm/damon/schemes: activate schemes based on a watermarks mechanism") Signed-off-by: SeongJae Park --- mm/damon/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/mm/damon/core.c b/mm/damon/core.c index 8cd8fddc931e..ccc62479549a 100644 --- a/mm/damon/core.c +++ b/mm/damon/core.c @@ -978,7 +978,8 @@ static unsigned long damos_wmark_wait_us(struct damos *scheme) static void kdamond_usleep(unsigned long usecs) { - if (usecs > 100 * 1000) + /* See Documentation/timers/timers-howto.rst for the thresholds */ + if (usecs > 20 * USEC_PER_MSEC) schedule_timeout_idle(usecs_to_jiffies(usecs)); else usleep_idle_range(usecs, usecs + 1);