From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f47.google.com (mail-wm1-f47.google.com [209.85.128.47]) (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 C6D8B3C7696 for ; Tue, 2 Jun 2026 08:44:45 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.47 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780389887; cv=none; b=PS7fSJaBQPDYHdYkYvDvqmHiRgyzc7SDbuhBrYfJVLRiIpUxB3PzIIifklN0EptcdvmR9mI+BYKEeqDPaxBLC1VhpygbaZHNsObb+2TWDBG4RFP+ja5AG+pYgVnU8UUcI/f5TL7GWl5zaNmYJxVLWJHNwwKkcUVnrpjCajMnK1E= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1780389887; c=relaxed/simple; bh=1ehVhlzmJROiX2e+n+LZNczRiFgH3ZPLWk3mO/SSVgQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Re4lbgLnvSjylSRGuh0Lu+Wi54+94CPqgYOidsUZsmluLHa9bGcAjCgrCi961ZprrmfqeHv9aHqgCDeB/uyxz34NgGVC9UIsU9m0KUZ8j83aziQPV9FfKLrdaLjgWsewS8wb550kf7nU6lMihUbfA49zJ6minUGflxW0OU/VGrk= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=c02LPeY/; arc=none smtp.client-ip=209.85.128.47 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="c02LPeY/" Received: by mail-wm1-f47.google.com with SMTP id 5b1f17b1804b1-49050bfe053so79832145e9.3 for ; Tue, 02 Jun 2026 01:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1780389884; x=1780994684; darn=vger.kernel.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=EvSBfn8hnh3Fa3q9m3Os7/1FymexHNztWBt1PtbsT9o=; b=c02LPeY/BDYAGQwsRI+nWgcusO9f1O+x16EOPfjWYtTyJymSkFZwArJOJyCf/KmT2E Dn7H+44N1pYn4LZx0znsZwWRdj5vOnhhM90Llf5BkkLP0c/V/QOuwaLhy7D2KOR7OWtf n+aIwwUSqD92ebKuHFb/V+XqOJ9T22VKphflqu8gDhpP4nhTKC6ITcAdZdvmPcyZpoZm YHCAsWGX7t1zGdZWoOLg68yQgO833AvIA0cRa2Ior3W1HgiZLoIZyO/DnVi7AfYS/t9t nQVFKyG753rbJhU2ZMZ5dN3IRyTwusKnum1Cicd7af+JRcR1e5qbAg7fzgmt6Tz3rZjp Jtuw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780389884; x=1780994684; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=EvSBfn8hnh3Fa3q9m3Os7/1FymexHNztWBt1PtbsT9o=; b=fDhrNQejc2dvfhJCeksDbC+m03tl2OPVeNsDbAeFIBlUuSB/EnDbpist+uubiUp52x B5KHHwDFSY/WxuzypgIsXN/Pr96H0PBiTOIwKztqchx9DvTNyUpFFVsC2B2NdPD0lB4f vQDNemCpYBSmu+Cs5SqTkFxn8XRZVGqg12Sr2zd1yT5X/EdIdW3pMciD3Ixnc7qw37/b 2X2XVuZMP8rNBd2J+XKsKukQrAXnY+kqfk4PVIZdBK6bLaXOSg1q0RQUV0bFotcUtfED L/0vo/hNGMMPAqXIkUKdSTWlosyIIqULgFo09OZchwTqZEyB1e+i/wQZ6/NY4LJdxQOe p2yQ== X-Forwarded-Encrypted: i=1; AFNElJ/roe79q3BaZfJxl0fz/wi48wqoQxZr91k53NrfCL3M62SMTs1h15dQXUK3Zf9Yi7Dj646whPZPgUOKT4Y=@vger.kernel.org X-Gm-Message-State: AOJu0YyFpa3nJQ66ATgFv3ACAH8CkSDqBjJUsVHniHW7wv/A8V04FE6n 2tXbO43fTNSloGMW/XBsJqMtJDsEbP2nYOlLTtunizS6QJQ+Rk1/yAYxcFS1MBNyPm0= X-Gm-Gg: Acq92OF8+zDpzNOI0ZqHAG9p9j2uGTKgeGuQjCeymFec3HTgftpdPXFVBTxlV4q8agu tBei8n9R4MaLz7uwyqpW5mFPuwzlyN5qFUVA1ELGuI4VTF3dZsOIgjDYGO5FU0UfeaL0w+iL6j8 kmOQG4Y6dFwUxCm9Az4B15Uw7LZAM1lp6H5e60LyN4jo3ZnKFBFzCiBMEKF2FKoFMN6fKhDq6si YIs8mtCF2wAGCrbt9SkZWq/3yo1L55zRsP+R4IPOjJ8SlkmTUdwq5Uz7Ov+eY62uYnywGpd1A/w vEkLvM9/8sIdtvuXDVeXk4N1FU9fNlJ4bzjgYTSVZUpMxNH62Myf4h2epUOJX7UpdiZ/2+s1LYz C6I/QbtYEYnG8u4Ik/n/1yMcatysGaBXAa1ELxzLnX2YbAnoUdIxr4nr7vmv5GZ/5z6+HgskG7s KS0kwS2uicc743HYJLBL+1TEn+HwoQ5aQ= X-Received: by 2002:a05:600c:190b:b0:48f:f64c:c2fe with SMTP id 5b1f17b1804b1-490a298f29bmr64095055e9.22.1780389883984; Tue, 02 Jun 2026 01:44:43 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F ([2620:10d:c092:500::6:6dc9]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-490b1006988sm22198595e9.5.2026.06.02.01.44.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 02 Jun 2026 01:44:43 -0700 (PDT) Date: Tue, 2 Jun 2026 09:44:41 +0100 From: Gregory Price To: "David Hildenbrand (Arm)" Cc: Yury Norov , Joshua Hahn , Andrew Morton , Zi Yan , Matthew Brost , Rakie Kim , Byungchul Park , Ying Huang , Alistair Popple , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Farhad Alemi , Waiman Long , Rasmus Villemoes , cgroups@vger.kernel.org Subject: Re: [PATCH] mm: don't allow empty relative nodemask in mpol_relative_nodemask() Message-ID: References: <20260528124133.c88c27b11a8ea0ef05e494f7@linux-foundation.org> <20260529152616.2308736-1-joshua.hahnjy@gmail.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: On Mon, Jun 01, 2026 at 04:32:25PM +0200, David Hildenbrand (Arm) wrote: > >> > >> Thank you for taking a shot at fixing the bug report, please let me know what > >> you think! Have a great day : -) > > > > Hi Joshua. > > > > Indeed, quick and dirty shot. > > > > The problem is that nodes_fold() can't work with the sz == 0. In > > other words, folding to a 0-bit bitmap is an error. We don't check > > that on bitmaps level because it's an internal helper, and it's a > > caller's responsibility to validate the parameters. > > > > nodes_onto(), or more specifically bitmap_onto(), is a different > > story. In case of empty relmap, the function actually clears all the > > bits in dst and returns. > > It's very weird that mpol_new_nodemask() (->create() callback) disallows empty > nodemasks, but mpol_rebind_nodemask() (->rebind() callback) would allow empty > nodemasks. > Was this actually observed? mpol_rebind_nodemask() happens when cgroup.cpuset changes, and cgroup.cpuset cannot be empty. cpuset only changes with sysfs twiddles or offlining. In either case, cpuset *guarantees* that cpuset.mems will never be empty. So... is this an observed bug or just a statically discovered "bug" that can't actually be reached? ~Gregory