From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.222.176 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796355408; b=Ecgyiwxtewr5V9i/sSBgP7QKMxfgpM0QR2wWmymBu8mUqe2Ub8Ta6O18LEYaH3kuETjJ t92MDZ69CtoAZHTiDdlGMZlEwFNhQepbfYDm3mSgBhUZ/p0PKpLdc0dxY6GVvZscbORyV //InZjmtXNNfJt2eNgHzRsW9sjrU0ryF+JvhrgIq26P9MSngK8/6N1IJjH05Wy7kjuvOR DV3KDZkcNSagd4o11rCQQSto5uQVRO03gWtrqPQ9HU49daAhlgq4VVtAcQIXi6MI/g8bg NaOFC8yAaOV+GZvUPOkZjFp/7/DEG2TdboQOIDvjZSkmwLMCGIG34R+W4aAiMomBxlw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796355408; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: X-Forwarded-Encrypted:X-Gm-Message-State:X-Gm-Gg:X-Received:Received: MIME-Version:Content-Type:Content-Transfer-Encoding:Subject:From:To: Cc:In-Reply-To:References:Date:Message-Id:X-Mailer; bh=6yLebVXJp/ePLhL0uuPU2fmdYrSuDfYSef8WY/aeNXE=; b=oeq4QETlZ6qShRHWD3AvoQysEFmgpnZakGWwqQpdtiOoIl9wSOzmQjMuWAVCjXVOiJE0 yO5YxaV3P4rxPuZyMEkMSYyGapoX32RRJqR623VyYQohvHj/fQ/etZkUhs64cwnHbIVej sBBItIVERTGtBhPEoPAjw7EV09gUpr4qmsjy5MU1u9NvTnf2zq9ASYTHQ2ertysLhSDzN PgfDDv5sHGZqP9OFyfGHiYXVcWlh/XBsp/d04D1vE2E6MwvEDqrk2c3b8tf39/KXEDssN Ubpl/EgIXb9dYLWNMxezaJxNILun1zixfKDviu9tLS60Z24sx7ml8oHRljrhntGpG+A== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass header.d=gourry.net header.i=@gourry.net header.a=rsa-sha256 header.s=google header.b=m13MSw3u; arc=none smtp.remote-ip=209.85.222.176 Received: from mail-qk1-f176.google.com (mail-qk1-f176.google.com [209.85.222.176]) (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 E33D2606A682 for ; Fri, 4 Dec 2026 03:36:47 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org E33D2606A682 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.a=rsa-sha256 header.s=google header.b=m13MSw3u Received: by mail-qk1-f176.google.com with SMTP id af79cd13be357-949657a20d7so37108085a.1 for ; Thu, 03 Dec 2026 19:36:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1796355407; x=1796960207; darn=vger.kernel.org; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:content-type:mime-version:from:to:cc :subject:date:message-id:reply-to:content-type; bh=6yLebVXJp/ePLhL0uuPU2fmdYrSuDfYSef8WY/aeNXE=; b=m13MSw3uXDlyZRuJYpmDlap8AOOzu1SvH7kSFsUzdFg/klrgA9abskZp1+P4nDPZUk OVYTx7xr++NKc+j9xWuR/iKkTLdKEPtmSuHEpU97+eEXr/68GaUjh9f9oIaJYGwtV8Kg 2xDpCTlrsdwmPHO3Hcphy8ZG6UN3Fy49TaH98NIRGEqHTSH1TCxQX7ydBJdEfwyP7W0I 3rXPP38/bQaxOJ2YMNjhu9fOibT8BPbcKpBHQV2WO0ZcpPSQWzsvhUwDCzOvmPxcI2lq 4WSo3MS7lX21q4seS/u+ZHRr+hoqoOnlnNwYMFYJahx88Utj26QHez+2fVfNR51KnyZv W3Jw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796355407; x=1796960207; h=message-id:date:references:in-reply-to:cc:to:from:subject :content-transfer-encoding:content-type:mime-version:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=6yLebVXJp/ePLhL0uuPU2fmdYrSuDfYSef8WY/aeNXE=; b=LavF/a6Vq2npfq6zwCeA1+LMzP7j0M0nfb/8U8/r3npJgGJEUusTTBioTbzFNXez/h sUS3yoz7sI80fCE4CVE6nrgdfY2qNXNEpA8FhbkYK1SvvtaCoCScIwVPVOZpbCbzW2AZ BPfnlpycYD+qDoxBdeQmF3hc+giI2+1sI88KnUTQHA1WHqiMBGikncFidfQ8S3+t0eQD 06NLPLhQ2Di0WARdj8fk0gw+MB81k43sTo5/YEOfZt3cxh2nytnuueiVEBkvPiTgOSKK r+bt5wKVzzPJ0L9eDfhoRLELHqlTS8Ue6O8/GmxCFJcBGDPqCcKjmlovsF+n50nrHWSO O+cQ== X-Forwarded-Encrypted: i=1; AL+hErEeOQsDzXkl+MaNm8cZQLvO/RN81RnaFgBLHReWLYBl7zWw55OnEymEu8DDHPlJ8HjE8CxjTCXVep51DqM=@vger.kernel.org X-Gm-Message-State: APuU4Z+qroOuTcI6ONLnP2M/20pWO2nzq3RXqDNm6iM9wpKLF5cqDeuK ZTZpGHt3DSQNyQN/8we88cSfKQ7eH30MiaXOD5+zN9vPcjttc1ixK74oQAa6mBuoOtM= X-Gm-Gg: AZFdTZcfkcBEKjf4akcF7SKYqnmD5YvIP6uZfE+FC59b84jHOHgLUQfQ4D1SRQ6ajIP iBnfGxMP5DFDjYojWgQ6VEV7E+hN5hVARPtPm6leQJSlZCJ9IeI4uOcInuE1qvXf98rSRF2wlbH QVSkDRaHlbOP/SJYbba5bnlte0sijuxsfuTK8iJ9B1Bid1T9GVKOyswPhHgny98QlBGwimy3Dx1 pQMbmtTmmfD16XdkztDMYJCzG67U6+JjneYExCQWZ76/5uKFUbCMzSGmzisf5knaxFZE8Y3B12x 9l97u8zKBpt1TfJamHQtCPqc1/uXE9EqOJJVefr7Ztgpq/0/iJbjbja2usY5VpRSS/VbrCSemMH 9onirSbgz20YpAhfb/1L4YtUalrz2zJZsst/xTrdtsC1LIgiSe8Zr0d1nc4ZxPtbAdgnZ1SpH5+ hjQ8tODUPKuXmm9IoGT0E9RF483MwIiq7a1VH/DuHML7b15cuKaWaMaic4ECDHqmCcDhNClGMCS GI1WSVuFlZGyt3dXB/8lRQpxmXCNF6PD1AS3kplHxsidqoPsfBurDuMe8ZOML/ec9NrbcfS9Ue8 28hziSAQJSjkPpzCfyQEJDFmsmCTPhT1ZahGGNBPr4jusaS3fwllQ+Rmrz8Q71GlubXnWPlHrPH /otMzgvE= X-Received: by 2002:a05:620a:4889:b0:93c:a191:88fe with SMTP id af79cd13be357-94a82690380mr117680885a.8.1796355406678; Thu, 03 Dec 2026 19:36:46 -0800 (PST) Received: from [192.168.50.231] (pool-71-191-145-202.washdc.fios.verizon.net. [71.191.145.202]) by smtp.gmail.com with ESMTPSA id af79cd13be357-94a7f5166c5sm131422285a.37.2026.12.03.19.36.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Dec 2026 19:36:46 -0800 (PST) X-Mailing-List: linux-kernel@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="utf-8" Content-Transfer-Encoding: 7bit Subject: Re: [PATCH 11/11] nodemask: add cpumask-style operation size bounds From: "Gregory Price (Meta)" To: Yury Norov Cc: "Gregory Price (Meta)" , linux-kernel@vger.kernel.org, Andrew Morton , linux-mm@kvack.org, Rasmus Villemoes , David Hildenbrand , Zi Yan , Joshua Hahn , Rakie Kim , Ying Huang , Muchun Song , Oscar Salvador , Johannes Weiner , Kairui Song , Thomas Bogendoerfer , "Rafael J. Wysocki" , Len Brown , Jens Axboe , Peter Zijlstra , Mel Gorman , Steven Rostedt , Masami Hiramatsu , Mathieu Desnoyers , linux-mips@vger.kernel.org, linux-acpi@vger.kernel.org, linux-block@vger.kernel.org, linux-trace-kernel@vger.kernel.org, "Liam R. Howlett" , Axel Rasmussen , Baolin Wang , Baoquan He , Barry Song , Linus Torvalds , Lorenzo Stoakes , Michal Hocko , Mike Rapoport , Qi Zheng , Shakeel Butt , Suren Baghdasaryan , Vlastimil Babka , Wei Xu , Yuanchu Xie , Yury Norov In-Reply-To: References: <20261127230128.111933-1-ynorov@nvidia.com> <20261127230128.111933-12-ynorov@nvidia.com> <179606877701.412063.14508847057119050581.b4-reply@b4> Date: Thu, 03 Dec 2026 22:36:45 -0500 Message-Id: <179635540504.2841792.2005044088717378533.b4-reply@b4> X-Mailer: b4 0.17-dev On 2026-12-01 19:01 -0500, Yury Norov wrote: > > This breaks cpuset.mems : > > > > 2 node host - {0,1} > > > > echo 0-3:1/4 > cpuset.mems > > before: succeeds - result: {0} > > now: ERANGE > > Here user explicitly refers non-existing nodes 2 and 3. So, as for the > patch #3, it's unclear, do we erroneously accept the invalid input? > You assume they're non-existing. They're not presently hotplugged. cpuset.mems can contain valid but empty nodes, and this is allowed. > Any example with explicit boundaries is vulnerable. The above 0-3:1/4 > would work fine for 2-node machine with MAX_NUMNODES == 1024. But if I > will recompile my kernel with MAX_NUMNODES == 2, it will return ERANGE. > It already happens on master, and nobody complains. > > > echo 0-1:1/_ > cpuset.mems > > before: succeeds - result: {0} > > now: {0,1} > > Did you mean 0-1:1/N? > > I'm one of those who invented that N notation, and I'm pretty > confident that "2 nodes and 0-1:1/N" simply means all node". > Before the patch, cpuset.mems parsed range endpoints against MAX_NUMNODES, then checked which nodes the pattern actually selected. After the patch, it rejects anything in [nr_node_ids, MAX_NUMNODES) before applying the pattern. For example MAX_NUMNODES=1024 and nr_node_ids=2, 0-3:1/4 used to succeed and selected only {0}. Now it fails with ERANGE because the endpoint on the range is 3. Maybe we want that, maybe we don't. We should be open about the change. Another scan, this can also affect the tmpfs mpol= mount option. At the very least, please note this in the changelog and make it obvious. I will likely test this all a bit further. > I asked AI to find an example of using N in the group part of nodelist > description, and it found nothing deployed. I asked to check all distros > and major apps that would immediately observe this switch to runtime > nr_node_ids, and it found nothing again. > "clanker says this breaks nothing in distro code" is not good evidence because we don't know else is using these interfaces. It's good data, but not itself an argument to go forcefully changing the ABI without discussion. I'm otherwise ok with the overall direction of this, I just don't want to overlook these rough edges. -- ~Gregory