[lkml]   [2020]   [Sep]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: [PATCH 2/2] vfree: Update documentation
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.

 \ /
  Last update: 2020-09-22 17:09    [W:0.032 / U:2.208 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site