From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 64EA8C021A6 for ; Mon, 24 Feb 2025 12:12:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:In-Reply-To:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=+ryFhl8+XSjDn6mgJa7GSQexAYqewTfKXy0rTXVoLUU=; b=ErbhenBvjBWgaBZziA1QG5R93z D75gIEuF7uAC0Fq9mubjBCGS7+vakt9ZuxgFruD+IrBtR+xsNxZvYxnkmdY42U4HoOcfmzL9KhkmM J0Lg447abUZN3xaxxnznKEDwyJlMgLugZqBQx5kGhDNtB7cmZlCKwBPuDnk19xISmihOOnrle+1Rz /eZ3RBUHULSZ2e7+1xuRdUzC5yiU6RCEiMMI8Otr8jF2czuAbvnqZI3ro2JLHtqmGrIvnf8jR8Yy9 5/2gY05JzjTy4CtrbqX8blM/L3Gk0GuFIT8NROt9DB7WlqCvrggGuKyBRYdgdBq7kAxf+XgsjoYf8 UhWIpvnA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tmXKM-0000000DdiW-3wMv; Mon, 24 Feb 2025 12:12:50 +0000 Received: from dfw.source.kernel.org ([139.178.84.217]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tmXB8-0000000Dai0-28Lk for linux-arm-kernel@lists.infradead.org; Mon, 24 Feb 2025 12:03:19 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 6CDB15C62FE; Mon, 24 Feb 2025 12:02:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8AA39C4CED6; Mon, 24 Feb 2025 12:03:14 +0000 (UTC) Date: Mon, 24 Feb 2025 12:03:12 +0000 From: Catalin Marinas To: Ryan Roberts Cc: Will Deacon , Pasha Tatashin , Andrew Morton , Uladzislau Rezki , Christoph Hellwig , David Hildenbrand , "Matthew Wilcox (Oracle)" , Mark Rutland , Anshuman Khandual , Alexandre Ghiti , Kevin Brodsky , linux-arm-kernel@lists.infradead.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 08/14] mm/vmalloc: Warn on improper use of vunmap_range() Message-ID: References: <20250217140809.1702789-1-ryan.roberts@arm.com> <20250217140809.1702789-9-ryan.roberts@arm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20250217140809.1702789-9-ryan.roberts@arm.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20250224_040318_585733_D2C3C5B6 X-CRM114-Status: GOOD ( 15.72 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Feb 17, 2025 at 02:08:00PM +0000, Ryan Roberts wrote: > A call to vmalloc_huge() may cause memory blocks to be mapped at pmd or > pud level. But it is possible to subsequently call vunmap_range() on a > sub-range of the mapped memory, which partially overlaps a pmd or pud. > In this case, vmalloc unmaps the entire pmd or pud so that the > no-overlapping portion is also unmapped. Clearly that would have a bad > outcome, but it's not something that any callers do today as far as I > can tell. So I guess it's just expected that callers will not do this. > > However, it would be useful to know if this happened in future; let's > add a warning to cover the eventuality. > > Signed-off-by: Ryan Roberts Reviewed-by: Catalin Marinas