From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 2C75E13212A for ; Wed, 18 Dec 2024 16:10:18 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734538220; cv=none; b=RejQY3uqooD5m8dn5KOF06/54/ZJ0P44rmKl44qvkRHzkPHSDD/pNehDh7PS8si8qF31SPeWNvSkA9dbMF+hweu35InJE9Ih+Jd7HVa1maO0qyEDH12x2Nqon/WWnIESgg6CwJncATpjRrVtwuaueR3t9Po7FeW0z0aRVYU+XBk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1734538220; c=relaxed/simple; bh=fj37w+NjZotTpff5+wGTSNAkOm801RNgN/t382Vu2E4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=WL74PG8Md+0GOmVTTw5Y8NvEFvt3fjdgcpLSKMTK5Uv81IkD5BFLC+HSI+iaQ2rvLYyhnSlRzgPmGlLdJr/CgK2TL263/gjy0h+3GzFSzh53i3BrrwXnXuKuoBo42Bdo4Z7hxIDWQidv0rYll3m0vg4FoQ12BQbBG+EjbjX4rKg= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=uvmpDxlV; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="uvmpDxlV" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9400CC4CECD; Wed, 18 Dec 2024 16:10:18 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1734538218; bh=fj37w+NjZotTpff5+wGTSNAkOm801RNgN/t382Vu2E4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uvmpDxlVjxdE6AYMDuL+3hC48fYs4uqKk6xHHQsvHvd+H4kNDbsrIq37q6Xgck93E +CnpocHJzFWcMb/Sn82oC4XkFrk7sagCmBSNiqXiV96pUIZmUNgwH0UDWekBNg9oWj tusHVbzQS0Zhbfj5lh0nxuzk6QR+au1Z7s11OZXcJiGJraW73hKXMTK8p0u4y9nTu0 XazXuszAn7hAwc14jJgc2Vlwj53DgBCF+xKqOIf6V+Y5TqE9h50rHNo7i9s8icMpEY XbChOCdcauBqCCHU1sVFn2X+AChmGAgQEqRk0D10LJ8K17D5/8sfDuD4bQJoMwAzsw +oxHyPx/sJGnQ== Date: Wed, 18 Dec 2024 06:10:17 -1000 From: Tejun Heo To: Andrea Righi Cc: David Vernet , Changwoo Min , Yury Norov , Ingo Molnar , Peter Zijlstra , Juri Lelli , Vincent Guittot , Dietmar Eggemann , Steven Rostedt , Ben Segall , Mel Gorman , Valentin Schneider , linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/6] sched_ext: Introduce per-node idle cpumasks Message-ID: References: <20241217094156.577262-1-arighi@nvidia.com> <20241217094156.577262-4-arighi@nvidia.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Hello, On Wed, Dec 18, 2024 at 11:21:30AM +0100, Andrea Righi wrote: ... > > Are node IDs guaranteed to be consecutive? Shouldn't it be `node >= > > nr_node_ids`? Also, should probably add node_possible(node)? > > Or even better add node_online(node), an offline NUMA node shouldn't be > used in this context. That can be too but then we'd have to worry about synchronizing against going on/offline. Looks like that's protected by mem_hotplug_lock, so we'd have to require get_online_mems() around these iterations, which might not be worth it. Besides, if we want to triger abort on incorrect input, we'd have to call sched_ext ops under mem_hotplug_lock, which we probably can't do. ... > > Is rcu_read_lock() necessary? Does lockdep warn if the explicit > > rcu_read_lock() is dropped? > > Good point, the other for_each_numa_hop_mask() iterator requires it, but > only to access the cpumasks via rcu_dereference(). Since we are iterating > node IDs I think we can get rid of rcu_read_lock/unlock() here. I'll double > check if lockdep complains without it. Yeah, this function should always be called with preemption disabled, so even if rcu_read_lock() is required, it should already be implied by the context. Thanks. -- tejun