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 X-Spam-Level: X-Spam-Status: No, score=-12.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F1C5CC4727E for ; Mon, 21 Sep 2020 22:46:37 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 706F923A65 for ; Mon, 21 Sep 2020 22:46:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="Fb/3jiqa" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 706F923A65 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 0082890000D; Mon, 21 Sep 2020 18:46:37 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id E831A900007; Mon, 21 Sep 2020 18:46:36 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CFB6290000D; Mon, 21 Sep 2020 18:46:36 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0130.hostedemail.com [216.40.44.130]) by kanga.kvack.org (Postfix) with ESMTP id BA789900007 for ; Mon, 21 Sep 2020 18:46:36 -0400 (EDT) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id 7D1C21EE6 for ; Mon, 21 Sep 2020 22:46:36 +0000 (UTC) X-FDA: 77288554392.07.smile92_0015a1e27148 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin07.hostedemail.com (Postfix) with ESMTP id 5F00C1803F9A3 for ; Mon, 21 Sep 2020 22:46:36 +0000 (UTC) X-HE-Tag: smile92_0015a1e27148 X-Filterd-Recvd-Size: 3589 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf08.hostedemail.com (Postfix) with ESMTP for ; Mon, 21 Sep 2020 22:46:35 +0000 (UTC) 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=19+dtww1aGUNEiGQP1W/amiaMHLfx0Q734F1r1AzV60=; b=Fb/3jiqanZ49Dm+0wD08pYCR1N lgIncSYKeYTujRcc2wcYZLSUpAl4sWmzNV1VIpuM+JeEYDzaHVoov+8uHKPbAdaYK1Bf0NozIRDL2 tLU2VfpVtD8jp3h3L887Sjt8dRoeG1Ec4rnpEJdttKNbAtAs/HYeXuO82jtZAjCvxoNouRiwlLtqq rejOwFhoMp8JKpQJHRwNKrLv1f5QvKZclmoua6wnXOTCKHBbKDPY+NNVvCHUDUXXrQ6KZ8C3VBdVT Nsstm9ofRG4gG8LlwrxXWa84Gk9bsfe4g7U0TPNU/XdV7GgKKIK2MzZO1wqpmFLcYUk4pNp5bPEem L91v3UAA==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKUZq-0005PD-K9; Mon, 21 Sep 2020 22:46:30 +0000 From: "Matthew Wilcox (Oracle)" To: Andrew Morton Cc: "Matthew Wilcox (Oracle)" , linux-mm@kvack.org, linux-kernel@vger.kernel.org, hch@lst.de, Uladzislau Rezki Subject: [PATCH 2/2] vfree: Update documentation Date: Mon, 21 Sep 2020 23:46:28 +0100 Message-Id: <20200921224628.20704-2-willy@infradead.org> X-Mailer: git-send-email 2.21.3 In-Reply-To: <20200921224628.20704-1-willy@infradead.org> References: <20200921224628.20704-1-willy@infradead.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: * Document that you can call vfree() on an address returned from vmap() * Remove the note about the minimum size -- the minimum size of a vmallo= c 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) --- mm/vmalloc.c | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/mm/vmalloc.c b/mm/vmalloc.c index 3893fc8915c4..942a44bdeec6 100644 --- a/mm/vmalloc.c +++ b/mm/vmalloc.c @@ -2313,20 +2313,20 @@ static void __vfree(const void *addr) } =20 /** - * 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. - * - * 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) + * obtained from vmalloc(), vmalloc_32() or __vmalloc(). If called + * on an @addr obtained from vmap(), it will put one refcount on each + * mapped page, which will free the page if this is the last refcount + * on the page. 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 >=3D sizeof(llist_n= ode) + * 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) { --=20 2.28.0