From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.128.51 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796145626; b=jPjeqVGO3lTVNwUXJhcZnTMWPMFkwHyH3dw1cc49ZqWqpzVd5UwsQdXt4pMHqOahaNki hb7SJEyuTyQ44q/93gZk9ZhOwzhb3fp9402X2If0rWNyP6lHgZzXygUSBp/iAqtzu3czy w3UdN3aIwmmNNA+nOn6EL2ZOmWUfw5ZaPTbJF1aM9DbKVKcK1zKjBLKx0ekXHRaIGnIDK V5Kt8frmZKmV02AUcUNMOsDdUtPSLtLaxKyVzgrJemKtLsQB64FWsyIVwXkdYe5cVllqm DN0f/jQUAlJ3bkxGoMiRQUswussoQSu/fd4BMSQHQWt6hXYUHp9k6rT6uuV8cjHXAtA== 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=kstWnLXcnv27C6ldSzUduppEKBYr1ZtLe8JTka8wNjsMQcyOwWV9m+ixD0E9pCFK+9Bs ltQMeUhWE+N23M56LdTJSLMvpZ0d1TBxHTG2hYGDGjTgOnUJxmlxXSq0qV6ZKuaQ6yJjT Bcn2hCuRffTQgp9zgg5PgzbXzXf3dnx5p2J912UkwSABklfre6AumnnrS5IKQk/FOiV7o YyQVnfoaGYTgXG59BDj3EKh5dAt+0U4TlUp6lQ/mt5TORMmErya1CpseNGhkSFF+qocMe 720vcvRAaJvOEZQvQNHdk1hyCWLizxBSDqx4PT6kq9ZIUxe9dWB9wvqqRsf8FXwQq/Q== 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=dndDZ0pD; arc=none smtp.remote-ip=209.85.128.51 Received: from mail-wm1-f51.google.com (mail-wm1-f51.google.com [209.85.128.51]) (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 DE2FA606A32A for ; Tue, 1 Dec 2026 17:20:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org DE2FA606A32A 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=dndDZ0pD Received: by mail-wm1-f51.google.com with SMTP id 5b1f17b1804b1-4bb64c99d2fso107334995e9.3 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=lists.linux.dev; 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=dndDZ0pDNgpG2kiTYbuPy7qAYfpdWr1dph+jRB/HWtrpdCHRCeB41wTO/Efb/BFJX3 IRQBxWFDBEPlm/kHXnaApSF9nv3gZf/hVkDUFo8xQKSyb0nUQVjDb/EsVjPZiZGhDXkm UqYKVR6De+/Wutr/NKk/v7wBcvKk3cKXJhsr58qfhpu1KQ6CMIVggR0VGQWujE7fvkLt a2S2JE2Uovz99zFYhjVC1HSHFdU9OluJJAytrLUdVhw8HlgDRGKNwF9JTpSvB3tktInz i+A8tZvgf+owIFPjcLM7v4MIdmO0P8R7mHkSlWhVtdMjVeKzylzUed6uNnAHVMbITVwt LF9w== 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=Z6f1iCbIK+vx1J1Yy9z9uJhyG4EjmammWuD/29QuzZSntQycQcwcLcmfovBjqPuZ3f JsMXf6wh0AnUuL1uRH+MadyQYX1utu3Fh4SfRQHwqGWEFq3P5jJe7QGyDrgVBCTe6QBi rIjsmTAT3KPX8z30mgCfrUACm74stEGqTdU6/6kQMLZvgIJXahblQ212plTc0d9W4+ep aJUh/1AdOIfas2oQql2mEexA4g3sHJsKaREUqPBj5GuCJPlUTbwHI4O+50y/PBb/nA+6 qd5ZaGwSSPKpwd/JDGHGD14Mvz4i2urMbjJu6pzFcGAo6bG+puzqfME63n03RgwgP0vm S2UA== X-Forwarded-Encrypted: i=1; AL+hErHs3QqpS4DzsCEJ/2sF3Ed+rGUQLsNOJLSibSss0D/gT7mc/DEyCx8nUaaGrdaRmjd0zdre8uVzvv8HJYjCAw==@lists.linux.dev X-Gm-Message-State: APuU4Z/H75tO5HfSFxT0xpcGt/mSGR6d4vVp4SL2awUXSmU2DBGrSdOM uZ21nTtrco/UAtzYY0Gk6NpAjkVMhxinFuKmbmHo6wbxlrMA1C8Prv4z X-Gm-Gg: AZFdTZfKfjuGTiFZZDFAUAAK1q1t6k5KotOoOQYTXx6zqxNfXlSjdd3YsMq4jVVwAuc ++kUFXtG279in+GmSFxEw6ta/pCQxxwGWMM65Ol45E8C2RKa7B2xBDmCmJu5sOZDXzm64TwF8KL 1950txFL1+rJSZ5Bl0qwFkUZWd+YeCdgmZ0xp08+ZvoQkYmBjgSRO+4ODobMPdjAI+fh6tRGuZp RnztB4s6SLTYf7g3uTjj2QUrdYsmt+91yk8UClO9SRy0RmpdxQvQOzl+ZNZllCjbIA+Lb4/iNaf dsQubeea93PuIU8iqBnL//oPINIzVlqdLu+Rc64vCgH+Gt7l45+e5a1flttZMgJltPNOhkT2JeW N9++QSzpigbwGZ74eTQx64RXZlaCUaWWsAFQfUjZDq6ERfX0oNI+JEWhsgR12ihxoaWkAVLj850 XeZATpvNTPq/NtgpIcQQd8f/OuxpokNssRL+mHCHlvy727E8wagjwA9nvL8y0VDZBVf/fnHxxos HmvzHlCa+rhSwWerCy+P80xktp4NMzNeDblpwrHV9obuL4+12lWhX11dSc9wpfY88DL1tUGsbci 3yy0+618Zw5WD9EWF6CSq8SxNm/S+PVh2ysakOxjODhqVugSHotDK6IX8MKoxUFa 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-rt-devel@lists.linux.dev 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 > >