From: Matthew Wilcox <willy@infradead.org>
To: Christoph Hellwig <hch@lst.de>
Cc: Andrew Morton <akpm@linux-foundation.org>,
linux-mm@kvack.org, linux-kernel@vger.kernel.org,
Uladzislau Rezki <urezki@gmail.com>
Subject: Re: [PATCH 2/2] vfree: Update documentation
Date: Tue, 22 Sep 2020 16:22:40 +0100 [thread overview]
Message-ID: <20200922152240.GI32101@casper.infradead.org> (raw)
In-Reply-To: <20200922150910.GA29302@lst.de>
On Tue, Sep 22, 2020 at 05:09:10PM +0200, Christoph Hellwig wrote:
> 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.
I've been thinking about somethng like:
void *vmap_mapping(struct address_space *mapping, pgoff_t start,
unsigned long len);
but it doesn't quite work for the shmem cases because they need to use
shmem_read_mapping_page_gfp() instead of ->readpage. I'd also want it
to work for DAX, but I don't have a user for that yet so it's hard to
justify adding it.
I have ideas for making shmem/tmpfs work more like other filesystems,
so we don't need shmem_read_mapping_page_gfp() but there are only so
many hours in the day.
next prev parent reply other threads:[~2020-09-22 15:22 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-21 22:46 [PATCH 1/2] vmalloc: Free pages as a batch Matthew Wilcox (Oracle)
2020-09-21 22:46 ` [PATCH 2/2] vfree: Update documentation Matthew Wilcox (Oracle)
2020-09-22 14:35 ` Christoph Hellwig
2020-09-22 15:06 ` Matthew Wilcox
2020-09-22 15:09 ` Christoph Hellwig
2020-09-22 15:22 ` Matthew Wilcox [this message]
2020-09-22 15:31 ` Christoph Hellwig
2020-09-22 16:42 ` Matthew Wilcox
2020-09-23 8:35 ` [PATCH 1/2] vmalloc: Free pages as a batch Michal Hocko
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200922152240.GI32101@casper.infradead.org \
--to=willy@infradead.org \
--cc=akpm@linux-foundation.org \
--cc=hch@lst.de \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=urezki@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox