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=-3.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS autolearn=no 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 D69D5C4727C for ; Tue, 22 Sep 2020 15:06:09 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 65757206DC for ; Tue, 22 Sep 2020 15:06:09 +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="PveBM4gY" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 65757206DC 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 9C152900052; Tue, 22 Sep 2020 11:06:08 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 9718B90000F; Tue, 22 Sep 2020 11:06:08 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 86156900052; Tue, 22 Sep 2020 11:06:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0239.hostedemail.com [216.40.44.239]) by kanga.kvack.org (Postfix) with ESMTP id 6DC3F90000F for ; Tue, 22 Sep 2020 11:06:08 -0400 (EDT) Received: from smtpin05.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay01.hostedemail.com (Postfix) with ESMTP id 1A0FC180AD80F for ; Tue, 22 Sep 2020 15:06:08 +0000 (UTC) X-FDA: 77291022816.05.smoke21_430d3b32714e Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin05.hostedemail.com (Postfix) with ESMTP id E5DE11801D421 for ; Tue, 22 Sep 2020 15:06:07 +0000 (UTC) X-HE-Tag: smoke21_430d3b32714e X-Filterd-Recvd-Size: 3427 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf22.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Sep 2020 15:06:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=In-Reply-To:Content-Type:MIME-Version: References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=pNa1Xk8X0S/o0XcV8ZzSziz1T35+mr1/P3jDsDxbxTg=; b=PveBM4gYCSnMMhKvJ58NnflkxB WTxYSSN6ly35Ngsz1Fk/WgcMXUEvGOnUcMo/ov8f0X54L6pQygSattXaLdbob2KmhIu9YZ6aPVguh gJnN3SIREDE4DB8P58xt9H+h6AHKWiZfdLZ9BvErZ0cotJnM7vD/B3Azf6R6V4AuNBwQzajAOzEeH Cff0QZlZ+paANqXnZVsxkmNP6IyMMMSA5gbuXDxuu62ne8XD+EGe1oU6n7akKCqIdkAGAHvueW6rO +Je+0t7+y8DjSf+mpobFsNrWscvmVd7qsJjJ5bqNjhh1wAVvvXsF8bCYrIQgMSqQgBuiVQGYqpO6A nF0NcDPw==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1kKjrn-0002sC-Vm; Tue, 22 Sep 2020 15:06:04 +0000 Date: Tue, 22 Sep 2020 16:06:03 +0100 From: Matthew Wilcox To: Christoph Hellwig Cc: Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Uladzislau Rezki Subject: Re: [PATCH 2/2] vfree: Update documentation Message-ID: <20200922150603.GH32101@casper.infradead.org> References: <20200921224628.20704-1-willy@infradead.org> <20200921224628.20704-2-willy@infradead.org> <20200922143506.GA26664@lst.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200922143506.GA26664@lst.de> 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: On Tue, Sep 22, 2020 at 04:35:06PM +0200, Christoph Hellwig wrote: > > /** > > - * 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 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. > > This reads a little confusing. First it only allows vmalloc* and > then it mentions vmap in the next sentence. And what about > vmalloc_32_user, vzalloc_node, vmalloc_node, vmalloc_user, vzalloc and > __vmalloc_node? In my defence, I didn't write that sentence; you snipped: - * obtained from vmalloc(), vmalloc_32() or __vmalloc(). If @addr is - * NULL, no operation is performed. I don't think it makes sense to list all vmalloc-style allocators here. It won't be updated by people who add new variations. How about this? * 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. * * If @addr is NULL, no operation is performed. I'm trying to strike a balance between being accurate and not requiring device driver authors to learn all about struct page. I may be too close to the implementation to write good documentation for it.