From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.221.50 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796145626; b=dmN7z7Fbss1HSsLXQfRBiQNcsnQOZ1Uy78qk6mq8XLHNI6bEbAvGG3Q+hbIJQ/KHtauj oV9PXXTGcdTwahn6nUzkBCFNflcSsmt2QAlyof+trPDAby1Xk+vuEoM9ZUoz1a05WZMgd dB/H53AWjHnc1emIVFNFaMfi3oFZPPK01fbTwKsPtJjuDgXKkiq/H0FqaTFMh0PO5AmhV lIgsyZznm+9HF1bWbi4++BzyP3xhFWgj3JynxVGKFKdkDxk/KcgZ8BGEkWBYKJB+EmaeP ArWbXW212Vwe/Zgcl2UkjU+tlyyCPYdT261XANBewu/EOKtIthsVpchH+Mvr/bs4TEw== 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=hqEWBKcdin9qKI84TvbBSYsxuSfHkG2ry6fJO+Qv3aIJ7P7nxYRhFsh2f8GQm0ahbH4K KSIN/hd7JyzeuS4M30l43+kxaZzJTiPbTLUtPM49nENbkempK2+66L0bA6apRvzYbsiYN AQFAIx7AKMymESJ4lbf2uzWfo7GmREFvf8jrgZKDGLl1NXN7z55jx8XfP0vV/zx0LefKn f9R1g4nPq7e51I/E8V9mQBYW3UgFHSOYBTN8LDV8t3LMUBzc4qhuijzx38mGnPJ4mo90c /mNgCt2lqjRezf1GGuWJgJx6h+hxRYHny3rxV4UZWqOsP5r0iKebGCtidfmuwjKvhZQ== 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.221.50 Received: from mail-wr1-f50.google.com (mail-wr1-f50.google.com [209.85.221.50]) (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 E5061606A32E for ; Tue, 1 Dec 2026 17:20:25 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E5061606A32E 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-wr1-f50.google.com with SMTP id ffacd0b85a97d-492690dd5daso9352848f8f.1 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=DVgJhIBZ4M0S+vO3wFyG7S87nUEybP3l0z88QfP0QjJ8E9tHAO2CB1Nv4Myv+PbDJL t/4FtRiWBh7NyFcG/YeVqwO0rtmdbdrB57yMsH3rnAMq4bGeCNp5BqQRvGi+STmZcofR KnXZ8V7wP1Tyr7foLgVf/E4ojIa+5uMFm+7kQ8ZDFTeLuH8rZ+/NvUYXiC62+uACyI9l ImecxyhLNLT+CNVjrnRhsaHTeKVYaBW1a3CWrb4/hOxI+7CYnoowipZcysl+Yo6Xj9r8 SvQm6L2J3SUVHRirX3gOL79hDSaGuZLminFQk5djxd+YS22awjsbFXuhjCAmdrv3ycRM zHZA== X-Forwarded-Encrypted: i=1; AL+hErFaZyus8GhcFbHzfYgD0PdH3TaXViRI88/7/rrcO2cyoVYTRStdEAPH67IqTnUTS8U/XeyvRk9g@vger.kernel.org X-Gm-Message-State: APuU4Z9Uuw6uqCJWhUN7QNXG4uTvIqbUWQspG9dfUFm1jQwl3cE/7Jxk DG5lcd3SBd2E589IiK9si5br/8968xCkju1j+OYMxadEqB+4Ie7UjWlB X-Gm-Gg: AZFdTZeduXaufW2x/Fp95ut1EIddNFf4e3P9f19nzTesfyte/7uEfNtX2frEc1it94G 30l7dOgyFClNGcXoln3A22DmliA51I68GotMEXYBp7buTIdL4I8+AFSsyrpz8yInZz7smQSnecy VYSU+KnXalY7bqJfvUU8C2eClGs0C2HKahhEH0eOVryNN54mdVFw4n82eaJmjnm1XuSUdHMsl0E bbctoHiR+a8lYHVxGNZHSB7HFNf5uC3K/NXNG9hCdDnZR+jK9UqoLSvgO+ivfqS6aqWWnQLfHqK C6YrUX5G6XdnVLvnoQje9EuUCS1jY7oP2p65INw6mFqC3R7Jrew9VenDa8lSSWqaKXYYW7oRCt4 A2sMvi9yVSONGHZJyjwNMwzTMmHj4Fl5rwHGe3TNl8omKeZ+64eHl2Xe1m9y2ZBK5mQNeZ15at+ ofyKpH6zjoEjUhF8QtQCyun6xhlEc+uVcs1IpGpTpPUG3mZqWxC5bFsf6kAVMhLjnDcyVqM5wA+ IapVnACu6Nbn7eGcTU+lcS4evmF9btca/GKNdo0hP6+u46K6CYK06b6aNCHitfHVy39HUL2nI7d 6g2hcOu50AemlNCBLbgZ3uyoFO+1hIQ6JJP4i598sr/ZdXhAbb8eSu92gIY2W7SQ 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: cgroups@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 > >