Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp343718pxk; Thu, 24 Sep 2020 07:02:45 -0700 (PDT) X-Google-Smtp-Source: ABdhPJzYszhxvk6icntRJMA58d/WtdWEu0TUiqif7mkreKuPQt4tjttfnkcTg+KmwdhJHD5YUNtB X-Received: by 2002:a17:906:c0c4:: with SMTP id bn4mr26152ejb.27.1600956164828; Thu, 24 Sep 2020 07:02:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600956164; cv=none; d=google.com; s=arc-20160816; b=TiwZdOJG0FgsY0KNOSft4zLk8xi3OJG382VuvQ8byu3Kcc0qlnt8b4pnRdfcOov8Ty G/AorVh8yCZBggUkl2MEGqOaFMvYAp3rSHjt2EwcKNAGoyuo+6hL/ubqMZrh+JwSAjCn 8IGEs95X1XrBUND+EwbW7UiHphqGvyr2fHiUsiJiUG2O//zqXCILpgJyxufZlaGU9yHW lmNR80Em43+u7g0WhSIt83a1DZug+ZGy6C7YHDsqXmTOHOGhOeCXOZ7l8nNLVT+hG17G ZjUMtc3qAQl+jzEzRijFBXgB8NBTElNjIKJQ9BXnnvIQWckoLyRLybhlMo7RPyNFUEzv m2Cg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=EtVpkGxd0Kyhqnh/t2FVgPRi015JMv+YUxF5ITQDDnw=; b=ZqKHIyPickoOSnPpEyQ1qNsUeSzQdTXdSA3et4lPCnFbMwB+v4sKsvvU0UG4yLdO1L MEfqnjtKgblwDn1oHM7YaczGGoLmEkxAe9i5ACoxdoJ8Ph8K+l3WL5cEhRUJmsrtxc/D tbWLaGk7ckoYy3AMaGc35qljXy68xrgcOqvcV7zKlJn5AUoiRyTBGHEzs6hcWL1b/N73 ZG1G5u2nhAsRhK8aDtERn/1tPqrwVsZ6IESsWXMQ5FHskVUAL0+FUpBHsX/U0sye15qS VAcGkqlcMj6ZOfEOhQCBZ1qLsdbzaOEnqdSv18hAzb2bH649M5zb8/AoM8pFqOVbygrs 9YwA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=UBIv7roD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id f8si2142197edm.193.2020.09.24.07.02.16; Thu, 24 Sep 2020 07:02:44 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=casper.20170209 header.b=UBIv7roD; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728283AbgIXOAJ (ORCPT + 99 others); Thu, 24 Sep 2020 10:00:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53314 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728170AbgIXN7W (ORCPT ); Thu, 24 Sep 2020 09:59:22 -0400 Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A33E8C0613D7 for ; Thu, 24 Sep 2020 06:59:21 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: References:In-Reply-To:Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To: Content-Type:Content-ID:Content-Description; bh=EtVpkGxd0Kyhqnh/t2FVgPRi015JMv+YUxF5ITQDDnw=; b=UBIv7roDEfICpvkEV2sDX9ByQx t0CU6jQaZONhs8WijOUJW3Hf5OmlymEYMn670wqAEy6jMP84qCMuVfB1aNXU3DB8PZkOzHe0z5Q8E F8J6iF5qyiBSE0OmzjD8LNDZuERy9GCif22cGt1lgl60GXal+sV8G8wPwqvEKk2BzhDNFb+3tnsb4 50KCBLdQD7ck0FlSY6Uff1WVvMj1/IXCjBNKICstm4IcHwnMVDfin3Lg/IX/3OJ7TWRrcjpN8Nz8t PO5JuoBYtJuo7Bh8o6jw163sU+8byzMB0qEe8ObJoA+W753TWIiEEGtzbIafEew2XKZt/+B1erI// CS2YD4OQ==; Received: from p4fdb0c34.dip0.t-ipconnect.de ([79.219.12.52] helo=localhost) by casper.infradead.org with esmtpsa (Exim 4.92.3 #3 (Red Hat Linux)) id 1kLRlv-0003ut-HU; Thu, 24 Sep 2020 13:58:55 +0000 From: Christoph Hellwig To: Andrew Morton Cc: Peter Zijlstra , Boris Ostrovsky , Juergen Gross , Stefano Stabellini , Jani Nikula , Joonas Lahtinen , Tvrtko Ursulin , Chris Wilson , Matthew Auld , Rodrigo Vivi , Minchan Kim , Matthew Wilcox , Nitin Gupta , x86@kernel.org, xen-devel@lists.xenproject.org, linux-kernel@vger.kernel.org, intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org, linux-mm@kvack.org Subject: [PATCH 01/11] mm: update the documentation for vfree Date: Thu, 24 Sep 2020 15:58:43 +0200 Message-Id: <20200924135853.875294-2-hch@lst.de> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200924135853.875294-1-hch@lst.de> References: <20200924135853.875294-1-hch@lst.de> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SRS-Rewrite: SMTP reverse-path rewritten from by casper.infradead.org. See http://www.infradead.org/rpr.html Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: "Matthew Wilcox (Oracle)" * Document that you can call vfree() on an address returned from vmap() * Remove the note about the minimum size -- the minimum size of a vmalloc allocation is one page * Add a Context: section * Fix capitalisation * Reword the prohibition on calling from NMI context to avoid a double negative Signed-off-by: Matthew Wilcox (Oracle) Signed-off-by: Christoph Hellwig --- mm/vmalloc.c | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index be4724b916b3e7..8770260419af06 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2321,20 +2321,21 @@ static void __vfree(const void *addr) } /** - * vfree - release memory allocated by vmalloc() - * @addr: memory base address + * vfree - Release memory allocated by vmalloc() + * @addr: Memory base address * - * Free the virtually continuous memory area starting at @addr, as - * obtained from vmalloc(), vmalloc_32() or __vmalloc(). If @addr is - * NULL, no operation is performed. + * Free the virtually continuous memory area starting at @addr, as obtained + * from one of the vmalloc() family of APIs. This will usually also free the + * physical memory underlying the virtual allocation, but that memory is + * reference counted, so it will not be freed until the last user goes away. * - * Must not be called in NMI context (strictly speaking, only if we don't - * have CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG, but making the calling - * conventions for vfree() arch-depenedent would be a really bad idea) + * If @addr is NULL, no operation is performed. * + * Context: * May sleep if called *not* from interrupt context. - * - * NOTE: assumes that the object at @addr has a size >= sizeof(llist_node) + * Must not be called in NMI context (strictly speaking, it could be + * if we have CONFIG_ARCH_HAVE_NMI_SAFE_CMPXCHG, but making the calling + * conventions for vfree() arch-depenedent would be a really bad idea). */ void vfree(const void *addr) { -- 2.28.0