From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=209.85.219.46 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796067862; b=wNYF91AMd56uyg6zv79ujRNpYKA5CTt8MS5j79x4SMEn2JPiaDJUzsuGVSxbKhDdNhYV YCsu+5Gs+0q8N9vAv3JQDjp9fTD2XOL55vQpZVHdj3Nw4Fw4EiexGxa1K9W5jp+NlS8oH e7nvRuKN5bUYh8whs/0+L5D963gJG0hYXepkJ48D471yjlBkYa7jnC+Ot2CZ5Pmk8ERCQ K6dV6++IsN9KTfbBAawVKBYiJPSiB0Qr9Lx0UA5/MBKUQtiN715k0Xb8jL+MivlVccHUo 6N+SkwN50AI9zyuV7AxnAMiojPatrgxwenKNsihMBp9cwC1QKCfPEcHQsPyhAjscGvw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796067862; h=DMARC-Filter:Received:DKIM-Signature:X-Google-DKIM-Signature: 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=LjtUeufZ+OOYgMivXJ2jZf8z82Ifhlrm+/jjbseXwbI=; b=weoxz4w6nSFQoQWzQipQRlcMErqAuHXdSe1aJcBTgBYg+Xk7Vsa5PCKMZKernegBL+wI Tm31HZF125TlXkYt9i45CP/cPGtSFa16hkezYJ3QgJe3iDOWNGXHDI49eHTR6rzE0+53v HMOdLkcOGyCzJSq+SBP8VF6XNUaQkTVuHgUtz3QzAW7DGYYcLir6dy7R9fEyZWKfylSaA LvMusBCij/BeLh5lkRzgwMvGsACt+d8n3SEeWhLnW1HnK1ogKbyBPKb0/MYlcZH68Ejvl XcodXSJOkKfmahTkmeU/k/qj9rKWLmYQjaoEwT88IstJM6Hkuu1n74k+bq1Akjsehxw== 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=koU4ndb4; arc=none smtp.remote-ip=209.85.219.46 Received: from mail-qv1-f46.google.com (mail-qv1-f46.google.com [209.85.219.46]) (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 38F75606A327 for ; Mon, 30 Nov 2026 19:44:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.2 smtp.subspace.kernel.org 38F75606A327 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=koU4ndb4 Received: by mail-qv1-f46.google.com with SMTP id 6a1803df08f44-92123971d1bso81386726d6.1 for ; Mon, 30 Nov 2026 11:44:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1796067861; x=1796672661; 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=LjtUeufZ+OOYgMivXJ2jZf8z82Ifhlrm+/jjbseXwbI=; b=koU4ndb4k+B8k88hd9HhWnGJYV60APqA7+gZIFPfVbTmjnrxB9RPqcPizKeLYD/vtq QiuGajt48M2TGr6ExdcZtKrS6kipWoAfY10GsYhlhcKw08bLaqEaVT0wljhJmivcJlvs vuKJE37tmOxwWp99n4Ikv7zMieBHIuppNRmi6VW32OkV3EikCPd2t9IaTBZ87Dnpm+v8 h3kxc4nsmF9j2Yaf/MklA/BdgK6kETnN71eBWFNqefqdzvDUedk+ybmDzDPMBPA7pjUY 2FHpnwPcsiWaPn/5fhyk0LFEMxNFb1RHsHkO3AEk971jr9E0//1hxC+MnIgL07W8L4GV NhFg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20260707; t=1796067861; x=1796672661; 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=LjtUeufZ+OOYgMivXJ2jZf8z82Ifhlrm+/jjbseXwbI=; b=mH45I8eM5NyGUTPx+nA0WQYRCZYDLlWKR7xUddZOrwyBa0XxrJMsFWtNx/p+sMNJrI qDTznU7mVFCmGZaAvN6n7D5URbZNswjWR+2C68e2b9yEiIwlK4LKLznyGdQQ7g+s0RmI qN8D5LD0y96hDyz1hV9SNiHsTfrkEYBGAw+yb3Z5kbCkS/jUndt8+01IhRCZ+PfPbmqM 3ekZuZW6y8tJpKdS/T2J9TkZgXSCxEEjLzVN4qXseAIOWCCnPXRtomFVNyhukpCOYzzg uSGHPHctMFMYi02sQ3oVmrYTS7Z8+/dRPwr8S/JqhUit1WwZVZGXTsXYPGt/f0c7jukf 5i8A== X-Gm-Message-State: APuU4Z/hVy9jk28AvK9aFT1oiqhmHIAUDpybBD0ZJEbWNn2aYNfB6w5a zYEgMyG9qqNjRe5N4y+UIZu01pldturbsSXRNF5Ba4uyLgNTpaUXY2p1trk9KID+lQ8= X-Gm-Gg: AZFdTZflAhUKOO2tSV9Uwb2IaKJrbwsxK33dYhtS2veXFXvhyTX89rxAYhDKvAJxp/m vaWbSxIPTrzfyTDK739juLyQ1yKTAjPD25cw14t3VX2e0sh5Yd0Q+RuLwe93qLQxifJh63sqQTb tTIIoGKSuWzDWRH+IqVwMEQm16AeU0tLRXLggP7VECeex/zS5nbDWcb57B3SmpuMT87TtnY3LGz xShWDBBp3UBnbEx1+EQACJ89LmZWxXGhVgdb8BIzojrFDjJT8nx0R4D5o12XYyD5pcMfG5XID9r Pg15asFU9uDaSNutbMFTjiXaVfVRaRRDQIUcIl6ZYFTd64ZbfMMdwJszfMcuDTSoFUK5cRVtDbE QG3ggkdxKsUcsXvcjsTFE8JuUZ4vboi/jRCZZ2zqSJmRD1UG4y/bVQObOU+hA5LP7JMvCmBaUF1 sgfUyzZ5Rn4eLO0SGL6eymxE5PKtR4TuNtH2SwCIPTyWTAVJeCXWt09Mo/RANYWQ+loZhEtxsqa 5ZeoUAcNKEuxEmxkYT2jjPLSyMXd/lGMP1xuCgVhkUAowNpsY8oSmND5luor/Z1pa3I93vpBi7o aswtU5r4MBpKnB3/oAA77StiZcZAstun2Z1DAf6miGwtHNYF9IN9hn+k5wZkz2PvTsUxqPbMgVk HhOjaRrFy20kAa1LBF5x034F7yxqd X-Received: by 2002:a05:6214:5904:b0:921:a41c:8c5c with SMTP id 6a1803df08f44-921a41ca2eamr146460876d6.38.1796067861223; Mon, 30 Nov 2026 11:44:21 -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 6a1803df08f44-921349b50besm300319356d6.9.2026.11.30.11.44.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 30 Nov 2026 11:44:20 -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 03/11] mm/mempolicy: reject migrate_pages source IDs beyond nr_node_ids From: "Gregory Price (Meta)" To: Yury Norov Cc: linux-kernel@vger.kernel.org, Andrew Morton , linux-mm@kvack.org, Rasmus Villemoes , David Hildenbrand , Gregory Price , 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: <20261127230128.111933-4-ynorov@nvidia.com> References: <20261127230128.111933-1-ynorov@nvidia.com> <20261127230128.111933-4-ynorov@nvidia.com> Date: Mon, 30 Nov 2026 14:44:17 -0500 Message-Id: <179606785774.412063.4544398580306436192.b4-reply@b4> X-Mailer: b4 0.17-dev On 2026-11-27 18:01 -0500, Yury Norov wrote: > The runtime nodemask conversion limits source iteration and weight > calculations in do_migrate_pages() to the runtime node range. Reject > userspace source masks containing node IDs at or above nr_node_ids > instead of silently ignoring those bits during migration selection. > So previously a migrate_pages() call with: nr_node_ids = 2 possible_nodes = {0,1} source_nodes = {0,65} dest_nodes = {1} Would have successfully migrated memory from node0 to node1, and this change now returns -EINVAL. > Check the full MAX_NUMNODES-wide mask after copying old_nodes and return > -EINVAL if any source bit lies outside the runtime range. Keep the > existing destination permission checks and the do_migrate_pages() API. Can we just strip those nodes from 'old' instead? That would keep userspace behavior the same. -- ~Gregory