From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-ot1-f48.google.com (mail-ot1-f48.google.com [209.85.210.48]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 84D431547EE for ; Wed, 31 Dec 2025 15:30:43 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.48 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767195046; cv=none; b=Sf3X/Ruql7mQIPeyI1VEDflf7ffiqb9OWzQsIpn2jLlrSLba5uJdLHEZqNcBrh20zwgOZ4k3cOvq36uiINeyy04swt1dJREZsO1YU5AFyRHIY5xj3Gd/Fs9+5glxnFZa6O7CqyOg8IW+OaZY92O7Nd+9jt4zjXzvSWtAtk4CZCE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1767195046; c=relaxed/simple; bh=KWWp0xZSY8+36QmbdtqFRXm7XYgM59788IrwS+osbBU=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=DMIvJOZt1zNy5xj7l9HyL8Wi3XyG5IYwiZTfjv07JIq3UXGdfr9KRJ80f6tiLbS+fuAxTDYGHayntT53+To9GVwBBKLOtlXHXXqfxdW2z9ZhJOVxuSbB/+rcQZnwWQ2tYfvb8aNnFgHFF1PX3/+VLWnaFWTVBuunPXEP7bjcmck= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=x8OwmftH; arc=none smtp.client-ip=209.85.210.48 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="x8OwmftH" Received: by mail-ot1-f48.google.com with SMTP id 46e09a7af769-7c7503c73b4so5815220a34.3 for ; Wed, 31 Dec 2025 07:30:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1767195042; x=1767799842; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=7QzVSYweQj11hd6fs/gbMsc1XDMFllelUQ/hmQuDpYw=; b=x8OwmftHU/+vIzflRkIlBL9PBd4FFU4oN4oaPJLiejCcBHDi6ET0ImTG96EFKG980P xxDU9YOYcEnywTVXKtLZdO6O8k4Ag/M/VU7CuHiA4YHqfu/CJuL7a+8X5v3n234NEcid 3e8MSlNiQE2dMTnyyZ6OwdfOcODlsFD+GFtkD0UXv2Iw5139MuQAYSbjHnI8p5b652Ui Mgmll7eOLrEEiW2RuEOWjS5uUqHuOrdFG2c7UOpx6XIxKxGjxy+uO3fIGwxhkbwUfCwm cqSsdijxt2Q/EhQcbcFkEHPsKGbt+lG3kfSZ0+WYdEioIxZQhi0MFpCmnHzO18aRQ1o3 Mhaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1767195042; x=1767799842; h=content-transfer-encoding:in-reply-to:from:content-language :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=7QzVSYweQj11hd6fs/gbMsc1XDMFllelUQ/hmQuDpYw=; b=gC5ycUt5l8bO+jQv7vUjbfAiI7auUSYC3T8PL5fldak6Nf/23+AXw5BO21Iq6OaNFM yWoZjOMUFqz+ipGVpAz6fPZ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== X-Received: by 2002:a4a:e252:0:b0:659:9a49:8fcc with SMTP id 006d021491bc7-65d0ebdd6e8mr11816060eaf.69.1767195042368; Wed, 31 Dec 2025 07:30:42 -0800 (PST) Received: from [192.168.1.150] ([198.8.77.157]) by smtp.gmail.com with ESMTPSA id 006d021491bc7-65d0f4cd66csm20954575eaf.7.2025.12.31.07.30.40 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 31 Dec 2025 07:30:41 -0800 (PST) Message-ID: <4156bbde-754b-470e-9dfb-a1e45bee81fb@kernel.dk> Date: Wed, 31 Dec 2025 08:30:39 -0700 Precedence: bulk X-Mailing-List: cgroups@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 09/33] block: Protect against concurrent isolated cpuset change To: Frederic Weisbecker Cc: LKML , =?UTF-8?Q?Michal_Koutn=C3=BD?= , Andrew Morton , Bjorn Helgaas , Catalin Marinas , Chen Ridong , Danilo Krummrich , "David S . Miller" , Eric Dumazet , Gabriele Monaco , Greg Kroah-Hartman , Ingo Molnar , Jakub Kicinski , Johannes Weiner , Lai Jiangshan , Marco Crivellari , Michal Hocko , Muchun Song , Paolo Abeni , Peter Zijlstra , Phil Auld , "Rafael J . Wysocki" , Roman Gushchin , Shakeel Butt , Simon Horman , Tejun Heo , Thomas Gleixner , Vlastimil Babka , Waiman Long , Will Deacon , cgroups@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-block@vger.kernel.org, linux-mm@kvack.org, linux-pci@vger.kernel.org, netdev@vger.kernel.org References: <20251224134520.33231-1-frederic@kernel.org> <20251224134520.33231-10-frederic@kernel.org> <0f65c4fe-8b10-403d-b5b6-ed33fc4eb69c@kernel.dk> Content-Language: en-US From: Jens Axboe In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/31/25 7:02 AM, Frederic Weisbecker wrote: > Le Mon, Dec 29, 2025 at 05:37:29PM -0700, Jens Axboe a ?crit : >> On 12/24/25 6:44 AM, Frederic Weisbecker wrote: >>> The block subsystem prevents running the workqueue to isolated CPUs, >>> including those defined by cpuset isolated partitions. Since >>> HK_TYPE_DOMAIN will soon contain both and be subject to runtime >>> modifications, synchronize against housekeeping using the relevant lock. >>> >>> For full support of cpuset changes, the block subsystem may need to >>> propagate changes to isolated cpumask through the workqueue in the >>> future. >>> >>> Signed-off-by: Frederic Weisbecker >>> --- >>> block/blk-mq.c | 6 +++++- >>> 1 file changed, 5 insertions(+), 1 deletion(-) >>> >>> diff --git a/block/blk-mq.c b/block/blk-mq.c >>> index 1978eef95dca..0037af1216f3 100644 >>> --- a/block/blk-mq.c >>> +++ b/block/blk-mq.c >>> @@ -4257,12 +4257,16 @@ static void blk_mq_map_swqueue(struct request_queue *q) >>> >>> /* >>> * Rule out isolated CPUs from hctx->cpumask to avoid >>> - * running block kworker on isolated CPUs >>> + * running block kworker on isolated CPUs. >>> + * FIXME: cpuset should propagate further changes to isolated CPUs >>> + * here. >>> */ >>> + rcu_read_lock(); >>> for_each_cpu(cpu, hctx->cpumask) { >>> if (cpu_is_isolated(cpu)) >>> cpumask_clear_cpu(cpu, hctx->cpumask); >>> } >>> + rcu_read_unlock(); >> >> Want me to just take this one separately and get it out of your hair? >> Doesn't seem to have any dependencies. > > The patch could be applied alone but the rest of the patchset needs it, > otherwise it may dereference freed memory. So I fear it needs to stay > within the lot. > > I appreciate the offer though. But an ack would help, even if I must admit > this single patch (which doesn't change current behaviour) leaves a > bitter taste because complete handling of cpuset isolated partition change > will require more work. That's fine too: Acked-by: Jens Axboe > Speaking of, is there a way that I missed to define/overwrite the above > hctx->cpumask on runtime? Only spot where it's set/manipulated right now is as part of setting up the hctx <-> ctx queue mappings, when the queue is configured (or reconfigured). -- Jens Axboe