From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.44 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796145626; b=lNCCrUmFw74S5GH2eEpuZEbxjtPWmFmPRvYlCOmtGTKkDMWJzVnQ8O+/x+IJ5K0Jb/Dh sLgQmayGxpkUebfwSIoOWiUH7hUS3WZeMRJPIREIbggQXSO4qGRHZpvldKfMfVE6qJI4G sR8iGM9XUJyYYxG0dLuvue/YW8lnZwAf36Ab+coOpBuGeQm0SFRxMCy90W2C138yB9q0k w7qSc7TPhv4PDIwy2xs0javn9ii2PivlgVKcmuTlM4CzmRKnlLC31EXCZ/3dfgr8PuGrx lMBc/j6NQv9SIy+SYkt1Y/w1B8iEd8TNV/VkBBpmlOj+MHAMtC05hVN3FqibTySerrQ== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796145626; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: Date:From:To:Cc:Subject:Message-ID:In-Reply-To:References:X-Mailer: MIME-Version:Content-Type:Content-Transfer-Encoding; bh=5ztmzmNWSCTK98dcm1KTJ1ymZPtG40h+U8rv+VbsbiQ=; b=QlPmPcZlWQtwLcIMtFxbl7PXqQr1HYJqvIaMGKqQmDCNP5udORs2RHRriQItR79A9Mh+ 4qgcIbju9S31n8MocLhhSJyGh895tqWomN1uzW2CzzBrOBRMYwejs2xymGKRSDU8effO7 +dTvlesHSZbLdxJiysmImWKnh0XHM4xPMB7pQu0CQpGkMbFKn1MOr+DhtPCESy5gRaXrd DqxEf7v8riTfvmfudzZqv/7bvdCA0LMkEm9H1yml2YSvALp+WjKkUE+pheWDz98X1IujS jGpmzRqX+qrbrA2MZAc8gpHu6Eg59DwwBB05VtpF3K4g514lMShb2wTikR18e4LeV+A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b="sOp/4dmq"; arc=none smtp.remote-ip=209.85.128.44 Received: from mail-wm1-f44.google.com (mail-wm1-f44.google.com [209.85.128.44]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DFD9C606A32D for ; Tue, 1 Dec 2026 17:20:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DFD9C606A32D Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20260707 header.b=sOp/4dmq Received: by mail-wm1-f44.google.com with SMTP id 5b1f17b1804b1-4a3517554f7so108586215e9.2 for ; Tue, 01 Dec 2026 09:20:25 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20260707; t=1796145624; x=1796750424; darn=vger.kernel.org; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=5ztmzmNWSCTK98dcm1KTJ1ymZPtG40h+U8rv+VbsbiQ=; b=sOp/4dmq1H4YndczQI0VU4c+vB5Enq2t/BSfxbLHTWpGjCePquF5cUNiGOQxbJikIT xyX7HmhFimys6pLkM4BA+ezTmBeiIhzO/7REBPOdu/XIE7ugURVvcp1A1nSpyhQDHYcU PMsFf564nFpMUNkr+Sra6roxrkfF48ypDFvbLVuCFACEkjl8UsjsEq2E9Vk9awtKBsHs i2bXlUC3MTbBpPC8xmlzhnPabs8ALWz6xRt6wo1CHEK2eUGov/BXpPUsTzoUvsYtfOdq zxwHVrZS3Y76GRtRazW9Qeb1ALw8nF2A3upBEThZpPB0dEtryOvXkQABHcoxqrV8Alqp O4sg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796145624; x=1796750424; h=content-transfer-encoding:content-type:mime-version:references :in-reply-to: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=5ztmzmNWSCTK98dcm1KTJ1ymZPtG40h+U8rv+VbsbiQ=; b=Z/S29xwXyB30XJApyfIBb1BsTqJlhPgAB+ILHY2PCkL7MjIt1wM/oaMELS0q00kwe6 HNXnAqoxRqMjeM6gXPlSgNRI7ZHzzvT44qneyRR1DXiRGo4rt6ia0qX0JvhsMNbBeB5I 4B/buP5Swzn2y1GcF/yor45D9GvZJVgeGuegTC6MN4lprgarwoEEXFc5QI/aOWQf/Osh tKB2rokarqVtJzWfO4NmvI5N4WGuCDyMPg5c/+xj3eIzaXV8fVcxR4gcJtIIyG1SZos4 1lJuoE51d8/hOybI5K0or1leYbEp097rBVBEdPyO6+UTB2N8t6irxFlsDTfeekWpBJG+ LGdw== X-Forwarded-Encrypted: i=1; AL+hErHYOXbL4th6NmI4K6KvaC/jfbsMQXSmqstLF2OJUCc2bxaXQLN3JFnbsGTkadhbmqqL8jcnfVmkFO08Kgc=@vger.kernel.org X-Gm-Message-State: APuU4Z/9pyNN0Y3HFc6LXcBwGtPhdxYM+Hd+/UscIg+UE3915lpGFyaY RI1LNFjm2dzFf28fj6HWWYPtV7YRMZCnkNSxZZe/l5gqJkL9ZRvZddMQ X-Gm-Gg: AZFdTZd5ZezbTXgvyC2hd6pM+89vn+AOOQwovipAs1bRrz+oEjpZyghnV7v7gkGESea x5oEkq2oZ6WnVogJ0hpHd+keOpNTxSG/WMvJVNAn1PBwKZqsdqvdtx53furtaIUkDvpcIPoxrb5 94i1zHVR79sSX54A39xyXzn2hfR72Ftlq5aBm17zYGcL9uQi2Ddx3hP6w7CJC9mmXh9sjkCi1rN 0aKDKsWM0WQlflyBZEvmtpNQCTt9P8A7sMd46gFnXiUr6oxutpWDoneXwFDN/h6pS1u+4N/NU5x c/DbF8uqfk7gudrviLYHWSbenF0keNcKcB8nGpV86cKgKyUTje03iHtybPzHxRZsX22BtkBcDgE lC4ESSFaCxln8zWIZImXHzcrp1k1A5z11eTSSDs1GwnCKOPrG2uhvy7ylfwaBflWy+esg12olkn VwZNJwpyBuWillPWJkd/Lvbm+xtGxb5zJXJN3/ivfQleG9EMmWcYU+AM963gXXsohtb+NDJJ1g5 v024iOZzaM1yyXREhCH5en1pyZgQd1QyopUnLvpM2I1GKks7EakKOMIoXzmacubr8sDMRpTKydr bwBoekwrfGmNiuUkiX2yu+515DCK6LjoipPvVtT1yoBRFBNLwCh0fNhekJJ9d89K X-Received: by 2002:a05:600c:3103:b0:4bb:69d8:3e92 with SMTP id 5b1f17b1804b1-4bb8881f095mr784553825e9.29.1796145624154; Tue, 01 Dec 2026 09:20:24 -0800 (PST) Received: from pumpkin (82-69-66-36.dsl.in-addr.zen.co.uk. [82.69.66.36]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-4ab6b10b2c9sm74503265f8f.31.2026.12.01.09.20.21 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Dec 2026 09:20:22 -0800 (PST) Date: Tue, 1 Dec 2026 17:20:20 +0000 From: David Laight To: Mathieu Desnoyers Cc: juri.lelli@redhat.com, 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: <20261201172020.6e28cf8c@pumpkin> In-Reply-To: <3afce978-6ba3-4583-8a6c-181c0a8edf70@efficios.com> References: <3300daac81b2483e451bca006dfaa2da5b21fced.1795771148.git.mathieu.desnoyers@efficios.com> <20261130141225.1e78e5f2@pumpkin> <777f6ac1-d7e2-43cf-b9c0-19cd5bebf8a6@efficios.com> <20261130181642.23d46e0a@pumpkin> <20261201161454.61083505@pumpkin> <3afce978-6ba3-4583-8a6c-181c0a8edf70@efficios.com> X-Mailer: Claws Mail 4.1.1 (GTK 3.24.38; arm-unknown-linux-gnueabihf) 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-Transfer-Encoding: 7bit On Tue, 1 Dec 2026 11:27:55 -0500 Mathieu Desnoyers wrote: > On 2026-12-01 11:14, David Laight wrote: > > You need to get the casts in the right order. > > The quotient needs zero extending to 64bits before being negated. > > eg -(s64)((u32)task_by / cpus) > > or 0LL - (u32)task_bw / cpus. > > > > Although that is still only right for 4096 cpu. > > Right, with that order the negation is correct. The patch already > negates in that order, after a 64-bit divide: > > -(s64)div_u64(tsk_bw, cpus) > > It divides on 64 bits because of the limit of 4096 CPUs. A cpuset > attach reserves the sum of the bandwidths of the tasks it moves. That > sum can pass U32_MAX on a machine with more than 4096 CPUs. v13 will > keep this code as it is. I should stop arguing :-) That is only a 64 by 32 divide. My brain flags up people adding 64 by 64 divides because one of the build bots doesn't like a type and they haven't even considered the domain of the value. David > > > There is also the RCU_LOCKDEP check. > > rcu is usually used lists (or similar) that are followed often but > > relatively rarely modified. > > I've not even tried to see what that is about. > > The check asserts that the caller is in an RCU-sched read section. That > keeps the root domain alive while __dl_update() walks its span. It does > not stop two CPUs from writing the same extra_bw at once. > > > If this code is only executed when cpu 'move' then I'd have thought > > there would be minimal contention from a single global lock. > > This code would then hold the lock. > > __dl_update() runs at each change of total_bw, not only at a CPU move. > It runs from __dl_add() and __dl_sub(), on the paths listed in my > first reply. Two calls of __dl_update() can only meet on a CPU that > moves to another root domain. v13 will not fix this race. > > Thanks, > > Mathieu > >