From: Christoph Hellwig <hch@lst.de>
To: Linus Torvalds <torvalds@osdl.org>, Avi Kivity <avi@redhat.com>,
Marcelo Tosatti <mtosatti@redhat.com>,
Jan Kiszka <jan.kiszka@web.de>,
qemu-devel@nongnu.org, agraf@suse.de, kvm <kvm@vger.kernel.org>,
Paul Mackerras <paulus@samba.org>,
linux-kernel@vger.kernel.org
Subject: Re: [Qemu-devel] Fix refcounting in hugetlbfs quota handling
Date: Sat, 13 Aug 2011 00:20:03 +0200 [thread overview]
Message-ID: <20110812222003.GA8300@lst.de> (raw)
In-Reply-To: <20110811064059.GU6342@yookeroo.fritz.box>
On Thu, Aug 11, 2011 at 04:40:59PM +1000, David Gibson wrote:
> Linus, please apply
>
> hugetlbfs tracks the current usage of hugepages per hugetlbfs
> mountpoint. To correctly track this when hugepages are released, it
> must find the right hugetlbfs super_block from the struct page
> available in free_huge_page().
a superblock is not a mountpoint, it's a filesystem instance. You can happily
have a single filesystem mounted at multiple mount points.
> However, this usage is buggy, because nothing ensures that the
> address_space is not freed before all the hugepages that belonged to
> it are. In practice that will usually be the case, but if extra page
> references have been taken by e.g. drivers or kvm doing
> get_user_pages() then the file, inode and address space may be
> destroyed before all the pages.
>
> In addition, the quota functions use the mapping only to get the inode
> then the super_block. However, most of the callers already have the
> inode anyway and have to get the mapping from there.
>
> This patch, therefore, stores a pointer to the inode instead of the
> address_space in the page private data for hugepages.
What's sthe point? The lifetime of inode->i_mapping is exactly the
same as that of the inode, except for those few filesystem that use
one from a different inode (and then for the whole lifetime of the
inode), so I can't see how your patch will make a difference.
> More
> importantly it correctly adjusts the reference count on the inodes
> when they're added to the page private data. This ensures that the
> inode (and therefore the super block) will not be freed before we use
> it from free_huge_page.
That seems like the real fix. And even if you'd still do the other bits
it should be a separate patch/
prev parent reply other threads:[~2011-08-12 22:20 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-08-11 6:40 Fix refcounting in hugetlbfs quota handling David Gibson
2011-08-11 6:40 ` [Qemu-devel] " David Gibson
2011-08-12 0:48 ` Linus Torvalds
2011-08-12 0:48 ` [Qemu-devel] " Linus Torvalds
2011-08-12 0:48 ` Linus Torvalds
2011-08-12 4:34 ` Minchan Kim
2011-08-12 4:34 ` [Qemu-devel] " Minchan Kim
2011-08-12 4:34 ` Minchan Kim
2011-08-12 19:15 ` Hugh Dickins
2011-08-12 19:15 ` [Qemu-devel] " Hugh Dickins
2011-08-12 19:15 ` Hugh Dickins
2011-08-13 1:08 ` David Gibson
2011-08-13 1:08 ` [Qemu-devel] " David Gibson
2011-08-15 18:00 ` Hugh Dickins
2011-08-15 18:00 ` [Qemu-devel] " Hugh Dickins
2011-08-15 20:25 ` Andrew Barry
2011-08-15 20:25 ` [Qemu-devel] " Andrew Barry
2011-08-15 20:25 ` Andrew Barry
2011-08-16 3:47 ` David Gibson
2011-08-16 3:47 ` [Qemu-devel] " David Gibson
2011-08-16 3:47 ` David Gibson
2011-08-16 17:45 ` [RFC PATCH] mm/hugepages: Fix race between hugetlbfs umount and quota update Andrew Barry
2011-08-16 17:45 ` [Qemu-devel] " Andrew Barry
2011-08-16 17:45 ` Andrew Barry
2011-08-16 17:45 ` Fix refcounting in hugetlbfs quota handling Andrew Barry
2011-08-16 17:45 ` Andrew Barry
2011-08-16 17:45 ` [Qemu-devel] " Andrew Barry
2011-08-12 22:20 ` Christoph Hellwig
2011-08-12 22:20 ` Christoph Hellwig [this message]
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=20110812222003.GA8300@lst.de \
--to=hch@lst.de \
--cc=agraf@suse.de \
--cc=avi@redhat.com \
--cc=jan.kiszka@web.de \
--cc=kvm@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mtosatti@redhat.com \
--cc=paulus@samba.org \
--cc=qemu-devel@nongnu.org \
--cc=torvalds@osdl.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.