Received: by 2002:a5d:9c59:0:0:0:0:0 with SMTP id 25csp1060224iof; Mon, 6 Jun 2022 19:30:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx195q1KWiPL4FPBp6ERXMDMuEKFJMGfESUJMkscPm/uVAdwsWBqp8CHFcSiMFiV7E8ms7F X-Received: by 2002:a17:907:7e83:b0:6fe:e929:ead0 with SMTP id qb3-20020a1709077e8300b006fee929ead0mr24592452ejc.286.1654569042368; Mon, 06 Jun 2022 19:30:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1654569042; cv=none; d=google.com; s=arc-20160816; b=ESDyEfrHq49XSfmRC7kKgpVLgG9x3KjJkMVWVMLWaWBNcq6f5AjmnMDqvPHTevtmdM TSdBGmMz+yukEf7S5wbY5Q5g/2cYziu4GXf6k5Q0JV5oHfLQYALn8jAYrwrV65XzX8kY jcaZa7O+yFzF1zVtUrV5s22ng64t2icmvpghvVKJZuQN/Hgbu95+rHLQy0ZUNvjI8axT 47c4Dh53lFfod9TaCqFPYC0hXfN9gVaBb5S8YnCU6fpubXrx2+9q/scF3V6tQnDibspg DMGL/3GLAwh7DpWA0Tbk/AD62k//dZw/wlSFXCgI39vp1fB1RyZHb4Hcz1AK611H4mI0 uJrg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:cc:to:subject:message-id :from:content-transfer-encoding:date:dkim-signature:mime-version; bh=DvSh/lnApLZcKG7ml4gGVvnxWq7dPGi/tcgfunRKmwo=; b=pK9zWUFklsjz0qD2TbNNIk6hDduX4+yd9POy0jkBmokvlWSmSgwqLFMakNpoTFq7Rj /K4MqLcVLpjZ+q63c0+5iKYddKF05mvKHAhq/Lu7B7o96PdPyg+tO7pPMPdI/4WRJn5u tk5YA/AirxnneyAfD729sqR6JwvCmGTRw7yz5z07hhWZyd5UjUuA5hifc03SriVRD4j2 yzxGWX30W5AZVUIcA29UXmFI3osG5fxxJyohCLWFLT9qHU7z6eYQcslXOrL4yVYMbq2+ KGUR/hZ78fH5fkEDzSaTv8KrHIFnYXrILRbjllXGHkIdJUS4yDYMNnTi+m5FCbm7COO6 VgbQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=JQQ0bahk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id f12-20020a0564021e8c00b0042e2a80eec2si16544239edf.369.2022.06.06.19.30.17; Mon, 06 Jun 2022 19:30:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linux.dev header.s=key1 header.b=JQQ0bahk; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linux.dev Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235672AbiFGBZ6 (ORCPT + 99 others); Mon, 6 Jun 2022 21:25:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41090 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235639AbiFGBZ5 (ORCPT ); Mon, 6 Jun 2022 21:25:57 -0400 Received: from out1.migadu.com (out1.migadu.com [IPv6:2001:41d0:2:863f::]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 380458FD54 for ; Mon, 6 Jun 2022 18:25:56 -0700 (PDT) MIME-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1654565154; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=DvSh/lnApLZcKG7ml4gGVvnxWq7dPGi/tcgfunRKmwo=; b=JQQ0bahkSHPXrmX6aoCRYarRtCtIBtfwfsaHak+oG8hHOjLO6p2qqFoP8jw+u8sHeQmias MVbVi+LeBfhpLU/8gSJb8TIV/xB9a3k6SrbXO7zTOVl3nHI6ghomWmCpIHRPMpJ6P7g2li 57lq8XmdbG7nX4afMC3uRGSNW8uYZW4= Date: Tue, 07 Jun 2022 01:25:48 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Yajun Deng" Message-ID: Subject: Re: [PATCH v4] sched/rt: fix the case where sched_rt_period_us is negative To: "Valentin Schneider" , 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 Cc: linux-kernel@vger.kernel.org In-Reply-To: References: <20220517062918.104482-1-yajun.deng@linux.dev> X-Migadu-Flow: FLOW_OUT X-Migadu-Auth-User: linux.dev X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_PASS,SPF_PASS, T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Ping.=0A=0A=0A=0AMay 18, 2022 12:08 AM, "Valentin Schneider" wrote:=0A=0A> On 17/05/22 14:29, Yajun Deng wrote:=0A> =0A>> Th= e proc_dointvec() is for integer, but sysctl_sched_rt_period is a=0A>> un= signed integer, proc_dointvec() would convert negative number into=0A>> p= ositive number. So both proc_dointvec() and sched_rt_global_validate()=0A= >> aren't return error even if we set a negative number.=0A>> =0A>> Use p= roc_dointvec_minmax() instead of proc_dointvec() and use extra1=0A>> limi= t the minimum value for sched_rt_period_us/sched_rt_runtime_us.=0A>> =0A>= > Make sysctl_sched_rt_period integer to match proc_dointvec_minmax().=0A= > =0A> How about:=0A> =0A> While sysctl_sched_rt_runtime is a signed inte= ger and=0A> sysctl_sched_rt_period is unsigned, both are handled in sched= _rt_handler()=0A> via proc_dointvec(), so negative inputs can be fed into= =0A> sysctl_sched_rt_period. However, per sched-rt-group.rst:=0A> =0A> * = sched_rt_period_us takes values from 1 to INT_MAX.=0A> * sched_rt_runtime= _us takes values from -1 to (INT_MAX - 1).=0A> =0A> Use proc_dointvec_min= max() instead of proc_dointvec() and use the .extra1=0A> parameter to enf= orce a minimum value.=0A> =0A> Make sysctl_sched_rt_period a signed integ= er as this matches the expected=0A> upper boundary and the expected type = of proc_dointvec_minmax().=0A> =0A>> v4:=0A>> - Make sysctl_sched_rt_peri= od integer (Valentin Schneider)=0A> =0A> Even if v3 was bogus, it's good = not to skip it in the version log.=0A> Also, the version logs should be a= fter the "---" marker line:=0A> =0A> Documentation/process/submitting-pat= ches.rt=0A> """=0A> Please put this information **after** the ``---`` lin= e which separates=0A> the changelog from the rest of the patch. The versi= on information is=0A> not part of the changelog which gets committed to t= he git tree. It is=0A> additional information for the reviewers. If it's = placed above the=0A> commit tags, it needs manual interaction to remove i= t. If it is below=0A> the separator line, it gets automatically stripped = off when applying the=0A> patch=0A> """=0A> =0A>> v2:=0A>> - Remove sched= _rr_timeslice_ms related changes (Valentin Schneider)=0A>> =0A>> Fixes: d= 0b27fa77854 ("sched: rt-group: synchonised bandwidth period")=0A>> Signed= -off-by: Yajun Deng =0A> =0A> Reviewed-by: Valentin= Schneider