From patchwork Sun Oct 8 02:15:38 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yajun Deng X-Patchwork-Id: 149674 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:a888:0:b0:403:3b70:6f57 with SMTP id x8csp1183275vqo; Sat, 7 Oct 2023 19:16:31 -0700 (PDT) X-Google-Smtp-Source: AGHT+IEV96rG+GJVctVOH3wlzbyJEShMjHoBU2xG+0KQKAFV08swNAnj8gSKNCLNq5b3Ji2VpjcA X-Received: by 2002:a17:902:904b:b0:1b9:e241:ad26 with SMTP id w11-20020a170902904b00b001b9e241ad26mr11162481plz.9.1696731391293; Sat, 07 Oct 2023 19:16:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696731391; cv=none; d=google.com; s=arc-20160816; b=qBCeIv3qkmuxuapmDEkudf4KhFWYFKd5CLrgKMeg34vni5JBn7WWx6gq1PVI586ws+ WxDbpxyEa3iSSSLY1R7+wujuAEm5JQjN3coa++3VnT1oqww9Rs3zJWUpLPlKhY8EyZUK wCeAStbqhkLPCSc9UVfN7r+FdeMitPkbDER0fBKpWJCYuZaDqyj5W7e7RDSJ2DrX5Zhn iV0xZxjPn0cXLbBdiV5vMr31n/BKJwK3DAw4PM9vCmrNL56BN78ObAJoeE5AgkbsIJya YInE7DOVDKuyVFUlLtTopWfg81X9InuCTbeuvUo+t8kTVFCwlolzp3FuZzaKe2L8QLqw JFjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=GKh09dwIHSZXs0/OglyxLBStxYXOe4hyzNoRqfAtIFw=; fh=kY5sJNvn29qhEh2SatEVpXE2cTkcQ8AnU+xu9Bnn8Ic=; b=K0EMNrTLW0+XVKRIvHoIIf/M6hVSsKwNSSeYWKvphfoy9WuKJ1d+lnqixmSYXxjjC/ 6CKqY4CIc8lvCoOJWLvjv+BvvhFS95ogrGfS5ZO7h+thGtvx4/WMr9M6izARFJRzQYx3 JAoSDcTUM+ikvVIBJEBhVfmXB9Y0qNI1qS77iyd8E8iGgcn2aj5qlxZGyWIkzJQODCEe q8IezrUOtdXsbw9b6/Nym/ix9vrAqI0wh8Gc5uPFg+ZUwG3Xm29k2Y/VsQ4QbbTI6uNr H2rLQkj5K7rUz8yOb2kGXW386Dk/MKPI5rf/iBGNiAduB+18JUSvPlsEpVeDE/UAvFMG B9oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="QcXbAuy/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id q18-20020a170902dad200b001b8c4021be9si7398939plx.397.2023.10.07.19.16.31 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 07 Oct 2023 19:16:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b="QcXbAuy/"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by morse.vger.email (Postfix) with ESMTP id A21C980B8226; Sat, 7 Oct 2023 19:16:22 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1344303AbjJHCQC (ORCPT + 17 others); Sat, 7 Oct 2023 22:16:02 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43682 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1344249AbjJHCQB (ORCPT ); Sat, 7 Oct 2023 22:16:01 -0400 Received: from out-208.mta0.migadu.com (out-208.mta0.migadu.com [91.218.175.208]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 85A2BB9 for ; Sat, 7 Oct 2023 19:15:57 -0700 (PDT) X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1696731355; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=GKh09dwIHSZXs0/OglyxLBStxYXOe4hyzNoRqfAtIFw=; b=QcXbAuy/yj6jmA70nZBJhmO0lKL0Meriu/+PCHme6D1DuYMx8m3bKfWL4vwuzP0YmsXgyf FkoWDVTMgJ8n2NNbvMvKL8injeKHt1+xFI9JiR8a/QmH9HAW6qOS1DhBPN79Mho+cMsn+L Zf1+iqqF8qpZJQrFwJ5tN49NMXp9OtI= From: Yajun Deng To: mingo@redhat.com, peterz@infradead.org, juri.lelli@redhat.com, vincent.guittot@linaro.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, bristot@redhat.com, vschneid@redhat.com Cc: linux-kernel@vger.kernel.org, Yajun Deng Subject: [PATCH] sched/rt: case sysctl_sched_rt_period to integer Date: Sun, 8 Oct 2023 10:15:38 +0800 Message-Id: <20231008021538.3063250-1-yajun.deng@linux.dev> MIME-Version: 1.0 X-Migadu-Flow: FLOW_OUT X-Spam-Status: No, score=2.7 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (morse.vger.email [0.0.0.0]); Sat, 07 Oct 2023 19:16:22 -0700 (PDT) X-Spam-Level: ** X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1779151815316035421 X-GMAIL-MSGID: 1779151815316035421 proc_dointvec_minmax is for integer, but sysctl_sched_rt_period is an unsigned integer. And sysctl_sched_rt_period takes values from 1 to INT_MAX, so sysctl_sched_rt_period doesn't have to be an unsigned integer. Case sysctl_sched_rt_period to integer. Also, change the maximum value of sysctl_sched_rt_runtime to sysctl_sched_rt_period. Signed-off-by: Yajun Deng --- kernel/sched/rt.c | 6 +++--- kernel/sched/sched.h | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/kernel/sched/rt.c b/kernel/sched/rt.c index 88fc98601413..76d82a096e03 100644 --- a/kernel/sched/rt.c +++ b/kernel/sched/rt.c @@ -16,7 +16,7 @@ struct rt_bandwidth def_rt_bandwidth; * period over which we measure -rt task CPU usage in us. * default: 1s */ -unsigned int sysctl_sched_rt_period = 1000000; +int sysctl_sched_rt_period = 1000000; /* * part of the period that we allow rt tasks to run in us. @@ -34,7 +34,7 @@ static struct ctl_table sched_rt_sysctls[] = { { .procname = "sched_rt_period_us", .data = &sysctl_sched_rt_period, - .maxlen = sizeof(unsigned int), + .maxlen = sizeof(int), .mode = 0644, .proc_handler = sched_rt_handler, .extra1 = SYSCTL_ONE, @@ -47,7 +47,7 @@ static struct ctl_table sched_rt_sysctls[] = { .mode = 0644, .proc_handler = sched_rt_handler, .extra1 = SYSCTL_NEG_ONE, - .extra2 = SYSCTL_INT_MAX, + .extra2 = (void *)&sysctl_sched_rt_period, }, { .procname = "sched_rr_timeslice_ms", diff --git a/kernel/sched/sched.h b/kernel/sched/sched.h index 649eb9ec0657..515eb4cffd5e 100644 --- a/kernel/sched/sched.h +++ b/kernel/sched/sched.h @@ -105,7 +105,7 @@ extern long calc_load_fold_active(struct rq *this_rq, long adjust); extern void call_trace_sched_update_nr_running(struct rq *rq, int count); -extern unsigned int sysctl_sched_rt_period; +extern int sysctl_sched_rt_period; extern int sysctl_sched_rt_runtime; extern int sched_rr_timeslice;