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 6C60B749C; Thu, 26 Mar 2026 10:44:56 +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=1774521896; cv=none; b=Ta8SJcKU5m5kErwyHvWdOcQTfT/pvZmx4dnG6ynUJjBjK/rxE9zb/BJ2vg5TNOsML3QCvURPejh15K3mfTiKLzt3jJXTR4Mb2ePeTh0eULmebl0OxITcJlvR9y+6DrmkmXZZKvnkA4SjYBbbRANmaeZtR5zyksi0CkNWDW/S2NA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1774521896; c=relaxed/simple; bh=RpHr2+xHkvht2/Kh3sSH7GYvx2wP6yqls3YE2NUO0rs=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=L+ySH7VldE7IM/sxtcv08E+x2t4YK6Z86pAKCYNk9vYXTqpmIpoTZlmcpHhmLwtWSOL94Hdtb9DVIl5cJh+oxBC6ScbEmCUAUyHTGBddjJW6nlbDNf4WaPqIa338ES8dJ78J2StmNQ+5Ar/sSgzN140J5HpLciYI8k26S9SBtAI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=oZaElY+x; 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="oZaElY+x" Received: by smtp.kernel.org (Postfix) with ESMTPSA id AE3B6C116C6; Thu, 26 Mar 2026 10:44:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1774521895; bh=RpHr2+xHkvht2/Kh3sSH7GYvx2wP6yqls3YE2NUO0rs=; h=Date:Subject:To:Cc:References:From:In-Reply-To:From; b=oZaElY+xwfixyAcqHZhLjm1kzqhHtlPlUH7GKOTLKXANwHDqMaG1z6XwK+kEQeLOE SYtBHHg37QOb54eq+UD8GrKX9hQ+eyixSzkh57jRU/1t5ChhlFDoLNFrhlvAUfv7T6 sZWCKLLb7jN89LctiPPnWlgN5y78Qjx+/QHgsyWC0CQN+IMFUPMFgtvHlpiyUt+V5w LeoibiKN4Zw4L9hawiOfwt1apacVFOXRxXyuXI0ZqDVTae+0tk1tn7+8FIAI0IkO+2 USwrP2P6UszCTljgKzyfk42RQc6SWYWgX+jwYahwV6HqPPop4F/WNeF9Jm9BcDKhq/ SWL3RmCPKNuZQ== Message-ID: <0b479256-1266-4c9c-a565-6e2a68573ddd@kernel.org> Date: Thu, 26 Mar 2026 11:44:45 +0100 Precedence: bulk X-Mailing-List: linux-fsdevel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v4 20/21] mm: add mmap_action_map_kernel_pages[_full]() Content-Language: en-US To: "Lorenzo Stoakes (Oracle)" , Andrew Morton Cc: Jonathan Corbet , Clemens Ladisch , Arnd Bergmann , Greg Kroah-Hartman , "K . Y . Srinivasan" , Haiyang Zhang , Wei Liu , Dexuan Cui , Long Li , Alexander Shishkin , Maxime Coquelin , Alexandre Torgue , Miquel Raynal , Richard Weinberger , Vignesh Raghavendra , Bodo Stroesser , "Martin K . Petersen" , David Howells , Marc Dionne , Alexander Viro , Christian Brauner , Jan Kara , David Hildenbrand , "Liam R . Howlett" , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , Jann Horn , Pedro Falcato , linux-kernel@vger.kernel.org, linux-doc@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-mtd@lists.infradead.org, linux-staging@lists.linux.dev, linux-scsi@vger.kernel.org, target-devel@vger.kernel.org, linux-afs@lists.infradead.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, Ryan Roberts References: <926ac961690d856e67ec847bee2370ab3c6b9046.1774045440.git.ljs@kernel.org> From: "Vlastimil Babka (SUSE)" In-Reply-To: <926ac961690d856e67ec847bee2370ab3c6b9046.1774045440.git.ljs@kernel.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 3/20/26 23:39, Lorenzo Stoakes (Oracle) wrote: > A user can invoke mmap_action_map_kernel_pages() to specify that the > mapping should map kernel pages starting from desc->start of a specified > number of pages specified in an array. > > In order to implement this, adjust mmap_action_prepare() to be able to > return an error code, as it makes sense to assert that the specified > parameters are valid as quickly as possible as well as updating the VMA > flags to include VMA_MIXEDMAP_BIT as necessary. > > This provides an mmap_prepare equivalent of vm_insert_pages(). We > additionally update the existing vm_insert_pages() code to use > range_in_vma() and add a new range_in_vma_desc() helper function for the > mmap_prepare case, sharing the code between the two in range_is_subset(). > > We add both mmap_action_map_kernel_pages() and > mmap_action_map_kernel_pages_full() to allow for both partial and full VMA > mappings. > > We update the documentation to reflect the new features. > > Finally, we update the VMA tests accordingly to reflect the changes. > > Reviewed-by: Suren Baghdasaryan > Signed-off-by: Lorenzo Stoakes (Oracle) Acked-by: Vlastimil Babka (SUSE)