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 C9A23C021A4 for ; Mon, 24 Feb 2025 12:17:29 +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=fAh2OsloWo7kQYcbHysk3m5qcR SMfS1vNApPwz5wjkwx51bSBdEDpnBgATOkdvccg6J1y9HA0fZhZeBl6aEJ4txSAv+jM4MDgCBXHlf hrZwU17pM7gY6QYADo2LyUbwBaYrUHj8uo2t9vI+vyJXLgpfsH2V6SGvlpeS06ZidD44+UzUcCY9R VKClMr+SxC8tJbQcM5oos9PVBEFjcDjKBiwGkPtVDXFrrk0xn0BpdqWkSeVWRaRMMidQLa0HSukZI 195mh5NqZMUBgnQgCDsdKJZfzpldGS5h9bGzCkBifLFhIHdYJmOWh0R6A1g13VrjzooNAELgJrl42 ZNFWtheQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.98 #2 (Red Hat Linux)) id 1tmXOk-0000000Df9l-043C; Mon, 24 Feb 2025 12:17:22 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.98 #2 (Red Hat Linux)) id 1tmXCC-0000000Db8n-0n8j for linux-arm-kernel@lists.infradead.org; Mon, 24 Feb 2025 12:04:25 +0000 Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by dfw.source.kernel.org (Postfix) with ESMTP id 7330F5C6305; Mon, 24 Feb 2025 12:03:44 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 9BFB9C4CEE8; Mon, 24 Feb 2025 12:04:20 +0000 (UTC) Date: Mon, 24 Feb 2025 12:04:18 +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_040424_273871_C6DEFF17 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