From: Petr Vandrovec <vandrove@vc.cvut.cz>
To: Hugh Dickins <hugh@veritas.com>
Cc: Nick Piggin <nickpiggin@yahoo.com.au>,
Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: Nick's core remove PageReserved broke vmware...
Date: Wed, 02 Nov 2005 19:06:55 +0100 [thread overview]
Message-ID: <4369003F.8020205@vc.cvut.cz> (raw)
In-Reply-To: <Pine.LNX.4.61.0511021208070.7300@goblin.wat.veritas.com>
Hugh Dickins wrote:
> On Wed, 2 Nov 2005, Petr Vandrovec wrote:
>
>>So we just marked vma VM_RESERVED, as it
>>did not hurt, and all pages in this vma have refcount > 1 anyway so there is
>>no point in trying to cleanup these page tables. Now rmap catches this by
>>page_count() != page_mapcount(), so VM_RESERVED is not needed anymore, but
>>there did not seem to be any reason to remove it.
>
>
> Well, beware. That "page_count() != page_mapcount() + 2" check in rmap.c
> went away in 2.6.13: the problem it was there to solve being solved
> instead by a can_share_swap_page based on page_mapcount instead of
> page_count (partly to fix a page migration progress problem).
>
> So, you may still be in trouble? But how do the pages you're concerned
> with come to be on the LRU in the first place? If they're not on the
> LRU, vmscanning will never try to take them away. Most drivers with
> special pages, and ->mapping unset, don't put the pages on the LRU.
No, we do not put pages on LRU. Older kernels were removing once
instantiated page entries from pagetables. It did not cause any
problems, but as VM cannot gain anything from this removal, we were
happy to find that VM did not clear page tables for VM_RESERVED vmas.
But primary motivation for VM_RESERVED was to get rid warning on SuSE
2.6.4. As one VMware instance uses 4 to 6 pages allocated this way,
it is really not big problem even if VM will try to remove them from
pagetables...
>>--- vmmon-only/linux/driver.c.orig 2005-11-02 02:00:46.000000000 +0100
>>+++ vmmon-only/linux/driver.c 2005-11-01 20:12:13.000000000 +0100
>>@@ -1283,9 +1283,13 @@
>>/*
>>* It seems that SuSE's 2.6.4-52 needs this. Hopefully
>>* it will not break anything else.
>>+ *
>>+ * It breaks on post 2.6.14 kernels, so get rid of it on them.
>> */
>> #ifdef VM_RESERVED
>>+# if LINUX_VERSION_CODE < KERNEL_VERSION(2, 6, 14)
>> vma->vm_flags |= VM_RESERVED;
>>+# endif
>>#endif
>> return 0;
>>}
>
>
> Nick's PageReserved/VM_RESERVED changes are not in 2.6.14 so I'd expect
> 2.6.15 there. Ah, you're trying to handle this awkward interval before
> 2.6.15-rc1 brings the numbering up to 2.6.15, okay.
For our purpose anything between 2.6.6 and 2.6.14 is fine as for us.
Allocated pages are normal memory pages, they just were allocated to
meet specific criteria - being allocated either from low 4GB (accessible in
32bit mode without paging), or being physically contiguous, so they all
have 'struct page' and can be happily refcounted.
Only really obscure thing we do is that we allocate order 1 or 2 (8/16KB)
regions, bump refcount by 1 on all pages except first one (if CONFIG_MMU
is set), and then pass independent pages from this region through nopage
handler to the VM to map them to the user level. It means that region
is allocated by alloc_pages(GFP_USER, 2), while it is released by 4 calls
to put_page(), for page+0...page+3.
It works on all Linux kernels with MMU I've tested, and it would be nice
if this could continue to work. Current kernels seems to provide PageCompound,
which would fit our needs as well after some changes, but as long as
PageCompound is build time option it is not possible to rely on it.
Best regards,
Petr Vandrovec
next prev parent reply other threads:[~2005-11-02 18:06 UTC|newest]
Thread overview: 52+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-11-01 19:30 Nick's core remove PageReserved broke vmware Petr Vandrovec
2005-11-02 0:34 ` Nick Piggin
2005-11-02 1:17 ` Petr Vandrovec
2005-11-02 2:09 ` Nick Piggin
2005-11-02 12:26 ` Hugh Dickins
2005-11-02 18:06 ` Petr Vandrovec [this message]
2005-11-02 21:04 ` Benjamin Herrenschmidt
2005-11-02 21:41 ` Hugh Dickins
2005-11-02 21:45 ` Benjamin Herrenschmidt
2005-11-02 22:02 ` Hugh Dickins
2005-11-02 22:22 ` Benjamin Herrenschmidt
2005-11-03 8:03 ` Gleb Natapov
2005-11-03 13:32 ` Hugh Dickins
2005-11-03 13:55 ` Gleb Natapov
2005-11-03 21:21 ` Benjamin Herrenschmidt
2005-11-02 22:39 ` Petr Vandrovec
2005-11-03 8:12 ` Gleb Natapov
2005-11-03 14:11 ` Hugh Dickins
2005-11-03 14:22 ` Gleb Natapov
2005-11-03 14:37 ` Michael S. Tsirkin
2005-11-03 14:59 ` Hugh Dickins
2005-11-03 15:09 ` Gleb Natapov
2005-11-03 15:14 ` Michael S. Tsirkin
2005-11-03 15:37 ` Hugh Dickins
2005-11-03 15:53 ` Gleb Natapov
2005-11-03 15:56 ` Michael S. Tsirkin
2005-11-08 21:34 ` Michael S. Tsirkin
2005-11-10 12:35 ` Gleb Natapov
2005-11-10 12:48 ` Michael S. Tsirkin
2005-11-10 12:49 ` Gleb Natapov
2005-11-10 13:16 ` Michael S. Tsirkin
2005-11-10 13:16 ` Gleb Natapov
2005-11-10 13:21 ` Hugh Dickins
2005-11-10 13:26 ` Gleb Natapov
2005-11-10 13:15 ` Hugh Dickins
2005-11-10 13:10 ` Hugh Dickins
2005-11-10 13:37 ` Michael S. Tsirkin
2005-11-10 13:55 ` Hugh Dickins
2005-11-10 14:12 ` Michael S. Tsirkin
2005-11-14 12:25 ` Michael S. Tsirkin
2005-11-14 12:27 ` Gleb Natapov
2005-11-14 12:34 ` Michael S. Tsirkin
2005-11-14 12:40 ` Hugh Dickins
2005-11-14 14:57 ` Michael S. Tsirkin
2005-11-14 15:07 ` Gleb Natapov
2005-11-14 12:41 ` Gleb Natapov
2005-11-14 14:52 ` Michael S. Tsirkin
2005-11-14 15:00 ` Gleb Natapov
2005-11-14 20:23 ` Michael S. Tsirkin
2005-11-15 9:26 ` Gleb Natapov
2005-11-14 15:58 ` Hugh Dickins
2005-11-14 21:17 ` Michael S. Tsirkin
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=4369003F.8020205@vc.cvut.cz \
--to=vandrove@vc.cvut.cz \
--cc=hugh@veritas.com \
--cc=linux-kernel@vger.kernel.org \
--cc=nickpiggin@yahoo.com.au \
/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