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=-5.3 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS, USER_AGENT_SANE_1 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 9897BC4363D for ; Tue, 22 Sep 2020 15:09:15 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 62AC02399A for ; Tue, 22 Sep 2020 15:09:15 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726686AbgIVPJO (ORCPT ); Tue, 22 Sep 2020 11:09:14 -0400 Received: from verein.lst.de ([213.95.11.211]:45060 "EHLO verein.lst.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726579AbgIVPJN (ORCPT ); Tue, 22 Sep 2020 11:09:13 -0400 Received: by verein.lst.de (Postfix, from userid 2407) id B3CFE67373; Tue, 22 Sep 2020 17:09:10 +0200 (CEST) Date: Tue, 22 Sep 2020 17:09:10 +0200 From: Christoph Hellwig To: Matthew Wilcox Cc: Christoph Hellwig , Andrew Morton , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Uladzislau Rezki Subject: Re: [PATCH 2/2] vfree: Update documentation Message-ID: <20200922150910.GA29302@lst.de> References: <20200921224628.20704-1-willy@infradead.org> <20200921224628.20704-2-willy@infradead.org> <20200922143506.GA26664@lst.de> <20200922150603.GH32101@casper.infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200922150603.GH32101@casper.infradead.org> User-Agent: Mutt/1.5.17 (2007-11-01) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Sep 22, 2020 at 04:06:03PM +0100, Matthew Wilcox wrote: > 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. I think the above is sensible, but not enough. vmap really needs to be treated special, as by default area->pages for vmap is NULL. So for vfree to be useful on a vmap mapping, the callers needs to manually set it up by poking into the internals. Actually, I think we really want another API rather than vmap for that. Let me respin my series to include that.