From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=170.10.133.124 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796043416; b=RsCCO5cPmozXEZm4X102kIIaMSe90emJPf4C4lFHirn3rF8+BD2sKdZfTbZM4VGFB6oT VbqfZhrJP1omS7UXF9hnIPCfXLAd9XlFzrslj22jFQquR4KQDQOhQai4zhykLo1pwYElw H50cJpJ/yCn+0MHfkA/pmMwMpNrspCh9CgNw5iXWP/lBIlbxdJBcnBJVjJjmufOhMW8+x EefV0P+73VOBVkp26DGO6dZJzz8AdppSnFudq1rN7lRKzqBtjIl0FXiPwDTrFeCLgtShW Uo2eVH0JRHjBznDWNk/vBT+Sedi5eQ2E9So1Z62rk5WCreUBeLHOhziaU5P5+vlSwCw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796043416; h=DMARC-Filter:DKIM-Signature:Received:X-MC-Unique: X-Mimecast-MFC-AGG-ID:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received: X-Received:Received:Date:From:To:Cc:Subject:Message-ID:References: MIME-Version:Content-Type:Content-Disposition:In-Reply-To; bh=P3syI39eRSDc9Phd8X9UkUq6xsabyrWAg1aO7wN6oP4=; b=sVlVjunBh/DU0URh2xyjr/4MRA5PzrlkgTTy3wTuFGnQDx3hZG9SNY36jjfIRUOKH6zC qMIrZZsxSy53LfUeyXbjHpN0f+0jMDjf6a3ZmwmokfqfND9Oj3vl7tBPIM9WeFJSzRoIG /nF1GYxIUtZH0EoFAb89hjtfWzVVusaye640DeVkbIs3noPTnIEO/OPLTKSfBDl9XP1nA CPSCPUeIujwn+nIMN5n/SMChjMWsZ435ilvYbjyKYSdETBI+OKGhJofJ4CaKbbvuYNNd3 XbgSH9wgLZKS7VnJcbEM2/q/SUhMIL8KF7dpXTRN3UkXe0iZDUU3XdQsWvsaJL8QUlA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=redhat.com; spf=pass smtp.mailfrom=redhat.com; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WNq6liB0; dkim=pass header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b="cnrRS/SN"; arc=none smtp.remote-ip=170.10.133.124 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EB9D606A31C for ; Mon, 30 Nov 2026 12:56:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 9EB9D606A31C Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=quarantine dis=none) header.from=redhat.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=redhat.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=mimecast20190719 header.b=WNq6liB0; dkim=pass (2048-bit key) header.d=redhat.com header.i=@redhat.com header.a=rsa-sha256 header.s=google header.b=cnrRS/SN DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1796043414; 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: in-reply-to:in-reply-to:references:references; bh=P3syI39eRSDc9Phd8X9UkUq6xsabyrWAg1aO7wN6oP4=; b=WNq6liB06A24Z8vlYrKBXqx9dBclAjJ8q+g8vQ9YE1EH4eI6HeGowOqcXSjJmvgewou632 L+w7jG/027vYi00wY3e2aLIytO6KyugQySIZABGin8kfA223GB83vXDr54+SCnDNE9pbMF 8i/2SiHeawTfz6u1liwaeoVZocJ8cuk= Received: from mail-wm1-f70.google.com (mail-wm1-f70.google.com [209.85.128.70]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-606-7Ihuhk2INKSr24G58qWfRQ-1; Mon, 30 Nov 2026 12:56:53 +0000 X-MC-Unique: 7Ihuhk2INKSr24G58qWfRQ-1 X-Mimecast-MFC-AGG-ID: 7Ihuhk2INKSr24G58qWfRQ_1796043412 Received: by mail-wm1-f70.google.com with SMTP id 5b1f17b1804b1-4bb67b2c00cso58304705e9.1 for ; Mon, 30 Nov 2026 04:56:52 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=google; t=1796043412; x=1796648212; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=P3syI39eRSDc9Phd8X9UkUq6xsabyrWAg1aO7wN6oP4=; b=cnrRS/SNuIbh7y+dBB96T+tPu9nOb5YUkc++JHbSMcj96XTxX9CgFsGZZLluNLzM2B 6cCeltqVPyKMCuPfMQh1MAHNHvRkPa6RBxhgOfQhcBPo6pouM0TezSDgqNAgAj66qAUP bTyXvzkesPyPeGNe0pqrwYL7jd0RNjZkIkH+RH9L/sgfLvQGbcCFcmSYygw9admaTB3K P3Ssymvvn+W6siRQsRntxp21bZ/mv5H0wfAWPd+f8IHegiQt6TvISYZkBtKatrONvw6X axSSVyQoJVvxXabbRqwt4VYCeBnCv1+i3JpXQGFiuyeJG3ck+Pb7F/stp2V865BgWsgJ XZWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796043412; x=1796648212; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=P3syI39eRSDc9Phd8X9UkUq6xsabyrWAg1aO7wN6oP4=; b=RrBAIjfwe6+c5tFGml+Lfd0tktBl9N2Q0atL9/vXlc3sJQMmyaQv5oaZT5lgKmIxxU yO31a1hn7AJF3n/KmaXvo8zsll7VUG/jAo06shZpaiqApV9+Odgjp9cet3yf3fzD+d28 IF7pJENPLGWfVWHNoTuz4bsFZ8XQkf9uilyU2gda6ez79VDBVuwBz8HJ7vjgvtbXusSm +FWRS/3oq130TP+xBJ/ObLo1craSvlvMDW3MkXhvZDhM39dZS5rkwprsaXQiXsb2XgM4 FwCYIDD8eoHsq1nHcdsAJnFDr2vZODKT5QL0Pa9CCoJsLH4cyX9Qj8PVJVYb59RKRTdZ x/3g== X-Forwarded-Encrypted: i=1; AL+hErE2XCavRq96cUDtMf0hch1C2w+rG2PDkCQv+LPYCFFYSv7L2IFbwjc+LciKic5tmUGlb/wsTft6bbrnC9A=@vger.kernel.org X-Gm-Message-State: APuU4Z+jzja0Gbq3mPOiCBilzg9/Akm/qaI4sZxfy98lUTuVn5FOt/a2 sirEAalo1S3QneL7RXVo/Jhh+IRsMmaLu6jMsgUnIKUKfX0HTcsgHrUROauXwmvaEAq6CKQqJCS ZhB+mA7yYCWYBvRkfyk6W3J5DRfF6reURh7+gEpcpjRUOGRcmCoKSyoSmAl7GhzHYtg== X-Gm-Gg: AZFdTZdTAjvgf+tOkRQvwSZPoNEThavN6PnHhrBzMFIjLFhVMWm773+ZUA+wdD0AQPJ RGUptMMLaxgaNQbdcBLLB3rm6z90P3ZXw0vv87jPo3of47xQ+OYy6atQwCNuIKboAxaFGb8bYZU uCCfshy2LRz5HxfOxpIz5DI5cMUS65SBdEJTA55T5X1R9tVFlkl4CY/T52dWCmyOC2aqj3pd25S khHw2or9endatq2IpbPERWbyiB3eAH3ILwes2AMknRVtpb+4B6GDnJUzBBG1zB4SVEIKNqGdwHf s6+wn99/DE4Uu+tpxhEArLrLTOlG1pfUswf7vj3xEoHD793vVdlmiES/vB8dIZv+I9z8lk1pZ0N fcp6IYfFG7JEgTmaiK/siSb2EKqCivUuaGLJgLDqHuWNpKeh8vhJuS+RDam+YsZGfVqcSPvPnNj Vus6nz X-Received: by 2002:a05:600c:a085:b0:4bb:85d9:156e with SMTP id 5b1f17b1804b1-4bb8880fe46mr670972945e9.11.1796043411880; Mon, 30 Nov 2026 04:56:51 -0800 (PST) X-Received: by 2002:a05:600c:a085:b0:4bb:85d9:156e with SMTP id 5b1f17b1804b1-4bb8880fe46mr670972425e9.11.1796043411522; Mon, 30 Nov 2026 04:56:51 -0800 (PST) Received: from jlelli-thinkpadt14gen4.remote.csb ([151.29.146.153]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4bb884911e3sm1144497855e9.6.2026.11.30.04.56.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 04:56:50 -0800 (PST) Date: Mon, 30 Nov 2026 13:56:48 +0100 From: Juri Lelli To: Mathieu Desnoyers Cc: peterz@infradead.org, mingo@redhat.com, vincent.guittot@linaro.org, tglx@kernel.org, will@kernel.org, boqun@kernel.org, dietmar.eggemann@arm.com, rostedt@goodmis.org, bsegall@google.com, mgorman@suse.de, vschneid@redhat.com, kprateek.nayak@amd.com, luca.abeni@santannapisa.it, tommaso.cucinotta@gmail.com, mathieu.poirier@linaro.org, longman@redhat.com, ridong.chen@linux.dev, tj@kernel.org, hannes@cmpxchg.org, mkoutny@suse.com, shuah@kernel.org, bigeasy@linutronix.de, clrkwllms@kernel.org, parri.andrea@gmail.com, m.szyprowski@samsung.com, kayracizmeci@gmail.com, weihengqiuu@gmail.com, linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-rt-devel@lists.linux.dev, stable@vger.kernel.org Subject: Re: [PATCH v12 20/43] sched/deadline: Do not truncate a bandwidth to 32 bits in __dl_add/sub() Message-ID: References: <3300daac81b2483e451bca006dfaa2da5b21fced.1795771148.git.mathieu.desnoyers@efficios.com> X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3300daac81b2483e451bca006dfaa2da5b21fced.1795771148.git.mathieu.desnoyers@efficios.com> Hello, On 27/11/26 09:35, Mathieu Desnoyers wrote: > __dl_add() and __dl_sub() spread a change of total_bw over the extra_bw > of the active CPUs of the root domain. Commit daec57983670 > ("sched/deadline: Reclaim bandwidth not used by dl tasks") added this, > for the bandwidth of one task. That is at most 1 << 20, the bandwidth > of one CPU. > > But cpuset_can_attach() reserves the sum of the bandwidths of all the > deadline tasks it moves, with dl_bw_alloc(). __dl_add() and __dl_sub() > cast the bandwidth to s32 before the division. Past S32_MAX, more than > 2048 CPUs of deadline bandwidth, the cast flips its sign. The extra_bw > of each CPU then moves the wrong way. GRUB lets reclaiming tasks run > more than the free bandwidth, or less. This was found by reading. It > needs a machine with more than 2048 CPUs, so no case tests it. > > Fix this by dividing on 64 bits, with div_u64(). > > The Sashiko AI review of the first series found this. > > Fixes: daec57983670 ("sched/deadline: Reclaim bandwidth not used by dl tasks") > Signed-off-by: Mathieu Desnoyers > Cc: stable@vger.kernel.org > --- Reviewed-by: Juri Lelli Thanks, Juri