linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [patch 0/6] Guest page hinting version 6.
@ 2008-03-12 13:21 Martin Schwidefsky
  2008-03-12 13:21 ` [patch 1/6] Guest page hinting: core + volatile page cache Martin Schwidefsky
                   ` (7 more replies)
  0 siblings, 8 replies; 54+ messages in thread
From: Martin Schwidefsky @ 2008-03-12 13:21 UTC (permalink / raw)
  To: linux-kernel, linux-s390, virtualization
  Cc: akpm, nickpiggin, hugh, zach, frankeh

Greetings,
I've dedusted the guest page hinting patches and ported them to todays
upstream git tree. There is one reject if applied to 2.6.24-rc5-mm1 but
that is easy to fix. The code stills works as expected on my test system.

Our z/VM performance team recently published a report on guest page
hinting vs. the ballooner approach on SLES10 for a farm of web servers.
The code on SLES10 differs a bit from the upstream variant but the
performance results should be still valid.  You will find the report
here:

  http://www.vm.ibm.com/perf/reports/zvm/html/530cmm.html

(the VMRM-CMM the web page speaks about is the balloon approach,
 CMMA is the guest page hinting).

Both approaches to the memory overcommit problem show comparable benefits
for this workload, with an advantage for guest page hinting for large
number of guests. For other workloads your mileage may vary.

The main benefit for guest page hinting vs. the ballooner is that there
is no need for a monitor that keeps track of the memory usage of all the
guests, a complex algorithm that calculates the working set sizes and for
the calls into the guest kernel to control the size of the balloons.
The host just does normal LRU based paging. If the host picks one of the
pages the guest can recreate, the host can throw it away instead of writing
it to the paging device. Simple and elegant.
The main disadvantage is the added complexity that is introduced to the
guests memory management code to do the page state changes and to deal
with discard faults.

The last versions of the patches do not differ much, I consider the code
to be stable. My question now is how to proceed with the code. I sure
would love to see the code going upstream some day but that depends on
the mm developers as the code adds complexity that needs to be supported.
If the general feeling is that the advantages of this approach do not
warrent for the added complexity this will likely be the last time you
will hear about guest page hinting. 

--
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.

^ permalink raw reply	[flat|nested] 54+ messages in thread
* [patch 0/6] Guest page hinting version 7.
@ 2009-03-27 15:09 Martin Schwidefsky
  2009-03-27 15:09 ` [patch 2/6] Guest page hinting: volatile swap cache Martin Schwidefsky
  0 siblings, 1 reply; 54+ messages in thread
From: Martin Schwidefsky @ 2009-03-27 15:09 UTC (permalink / raw)
  To: linux-mm, linux-kernel, virtualization
  Cc: frankeh, akpm, nickpiggin, hugh, riel

Greetings,
the circus is back in town -- another version of the guest page hinting
patches. The patches differ from version 6 only in the kernel version,
they apply against 2.6.29. My short sniff test showed that the code
is still working as expected.

To recap (you can skip this if you read the boiler plate of the last
version of the patches):
The main benefit for guest page hinting vs. the ballooner is that there
is no need for a monitor that keeps track of the memory usage of all the
guests, a complex algorithm that calculates the working set sizes and for
the calls into the guest kernel to control the size of the balloons.
The host just does normal LRU based paging. If the host picks one of the
pages the guest can recreate, the host can throw it away instead of writing
it to the paging device. Simple and elegant.
The main disadvantage is the added complexity that is introduced to the
guests memory management code to do the page state changes and to deal
with discard faults.


Right after booting the page states on my 256 MB z/VM guest looked like
this (r=resident, p=preserved, z=zero, S=stable, U=unused,
P=potentially volatile, V=volatile):

<state>|--tot--|---r---|---p---|---z---|
    S  |  19719|  19673|      0|     46|
    U  | 235416|   2734|      0| 232682|
    P  |      1|      1|      0|      0|
    V  |   7008|   7008|      0|      0|
tot->  | 262144|  29416|      0| 232728|

about 25% of the pages are in voltile state. After grepping through the
linux source tree this picture changes:

<state>|--tot--|---r---|---p---|---z---|
    S  |  43784|  43744|      0|     40|
    U  |  78631|   2397|      0|  76234|
    P  |      2|      2|      0|      0|
    V  | 139727| 139727|      0|      0|
tot->  | 262144| 185870|      0|  76274|

about 75% of the pages are now volatile. Depending on the workload you
will get different results.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.


^ permalink raw reply	[flat|nested] 54+ messages in thread
* [patch 0/6] resend: guest page hinting version 5.
@ 2007-06-28 16:40 Martin Schwidefsky
  2007-06-28 16:40 ` [patch 2/6] Guest page hinting: volatile swap cache Martin Schwidefsky
  0 siblings, 1 reply; 54+ messages in thread
From: Martin Schwidefsky @ 2007-06-28 16:40 UTC (permalink / raw)
  To: linux-kernel, virtualization, kvm-devel, linux-mm

Greetings,
after Carsten pitched CMM2 on the kvm mini summit here is a repost
of version 5 of the guest page hinting patches. The code is still
the same but has been adapted to the latest git level.

-- 
blue skies,
   Martin.

"Reality continues to ruin my life." - Calvin.


^ permalink raw reply	[flat|nested] 54+ messages in thread
* [patch 0/6] [rfc] guest page hinting version 5
@ 2007-05-11 13:58 Martin Schwidefsky
  2007-05-11 13:58 ` [patch 2/6] Guest page hinting: volatile swap cache Martin Schwidefsky
  0 siblings, 1 reply; 54+ messages in thread
From: Martin Schwidefsky @ 2007-05-11 13:58 UTC (permalink / raw)
  To: virtualization, linux-mm, linux-kernel
  Cc: Zachary Amsden, Andrew Morton, Nick Piggin, Hubertus Franke,
	Rik van Riel

After way to many months here is the fifth version of the guest page
hinting patches. Compared to version four a few improvements have been
added:
 - Avoid page_host_discards() calls outside of page-states.h
 - The discard list is now implemented via the page_free_discarded
   hook and architecture specific code.
 - PG_state_change page flag has been replaced with architecture
   specficic primitives. s390 now uses PG_arch_1 and avoids to waste
   another page flag (it still uses two additional bits).
 - Add calls to make pages volatile when pages are moved from the
   active to the inactive list and set max_buffer_heads to zero to
   force a try_to_release_page call to get more page into volatile
   state.
 - remap_file_pages now works with guest page hinting, although the
   discard of a page contained in a non-linear mapping is slow.
 - Simplified the check in the mlock code.
 - In general the code looks a bit nicer now.

I tried to implement batched state transitions to volatile but after
a few failures I gave up. Basically, most pages are made volatile with
the unlock_page call after the end of i/o. To postpone a make volatile
attempt requires to take a page reference. Trouble is you can't release
a page reference from interrupt context. This has to be done in task
context, so we can't use a pvec/array for keep the references. There is
no room in struct page for a list, so it turns out lazy make volatile
is hard to implement.

The patches apply on the current git tree.

Many thanks go to Oliver Paukstadt who kept me busy with bug reports
and uncountable dumps ..

-- 
blue skies,
  Martin.

"Reality continues to ruin my life." - Calvin.


^ permalink raw reply	[flat|nested] 54+ messages in thread

end of thread, other threads:[~2009-04-01  8:14 UTC | newest]

Thread overview: 54+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-03-12 13:21 [patch 0/6] Guest page hinting version 6 Martin Schwidefsky
2008-03-12 13:21 ` [patch 1/6] Guest page hinting: core + volatile page cache Martin Schwidefsky
2008-03-12 23:12   ` Rusty Russell
2008-03-13  9:24     ` Martin Schwidefsky
2008-03-12 13:21 ` [patch 2/6] Guest page hinting: volatile swap cache Martin Schwidefsky
2008-03-12 13:21 ` [patch 3/6] Guest page hinting: mlocked pages Martin Schwidefsky
2008-03-12 23:27   ` Rusty Russell
2008-03-13  9:13     ` Martin Schwidefsky
2008-03-12 13:21 ` [patch 4/6] Guest page hinting: writable page table entries Martin Schwidefsky
2008-03-12 23:35   ` Rusty Russell
2008-03-13  9:11     ` Martin Schwidefsky
2008-03-12 13:21 ` [patch 5/6] Guest page hinting: minor fault optimization Martin Schwidefsky
2008-03-12 13:21 ` [patch 6/6] Guest page hinting: s390 support Martin Schwidefsky
2008-03-12 16:19   ` Jeremy Fitzhardinge
2008-03-12 16:28     ` Martin Schwidefsky
2008-03-12 16:44       ` Jeremy Fitzhardinge
2008-03-12 16:59         ` Martin Schwidefsky
2008-03-12 17:48           ` Jeremy Fitzhardinge
2008-03-12 20:04             ` Anthony Liguori
2008-03-12 20:45               ` Jeremy Fitzhardinge
2008-03-12 20:56                 ` Anthony Liguori
2008-03-12 21:36                   ` Jeremy Fitzhardinge
2008-03-13  9:45                     ` Martin Schwidefsky
2008-03-13 16:07                       ` Jeremy Fitzhardinge
2008-03-13 16:17                         ` Jeremy Fitzhardinge
2008-03-13 16:55                           ` Martin Schwidefsky
2008-03-13 17:05                             ` Jeremy Fitzhardinge
2008-03-13 17:23                               ` Martin Schwidefsky
2008-03-13  9:42                   ` Martin Schwidefsky
2008-03-13  9:36                 ` Martin Schwidefsky
2008-03-13  9:32               ` Martin Schwidefsky
2008-03-12 22:41 ` [patch 0/6] Guest page hinting version 6 Rusty Russell
2008-03-13  9:47   ` Martin Schwidefsky
2008-03-13 16:57 ` Hugh Dickins
2008-03-13 17:14   ` Martin Schwidefsky
2008-03-13 17:45   ` Zachary Amsden
2008-03-13 19:45     ` Andrea Arcangeli
2008-03-13 21:41       ` Zachary Amsden
2008-03-13 18:41   ` Jeremy Fitzhardinge
2008-03-13 18:55     ` Hugh Dickins
2008-03-13 19:53       ` Zachary Amsden
2008-03-14 18:30         ` Jeremy Fitzhardinge
2008-03-14 21:32           ` Zachary Amsden
2008-03-14 21:37             ` Jeremy Fitzhardinge
2008-03-17  9:21             ` Martin Schwidefsky
2008-05-06 15:33   ` Martin Schwidefsky
2008-05-06 19:46     ` Rik van Riel
2008-05-07  3:49       ` Zachary Amsden
2008-05-07  7:00         ` Martin Schwidefsky
  -- strict thread matches above, loose matches on Subject: below --
2009-03-27 15:09 [patch 0/6] Guest page hinting version 7 Martin Schwidefsky
2009-03-27 15:09 ` [patch 2/6] Guest page hinting: volatile swap cache Martin Schwidefsky
2009-04-01  2:10   ` Rik van Riel
2009-04-01  8:13     ` Martin Schwidefsky
2007-06-28 16:40 [patch 0/6] resend: guest page hinting version 5 Martin Schwidefsky
2007-06-28 16:40 ` [patch 2/6] Guest page hinting: volatile swap cache Martin Schwidefsky
2007-05-11 13:58 [patch 0/6] [rfc] guest page hinting version 5 Martin Schwidefsky
2007-05-11 13:58 ` [patch 2/6] Guest page hinting: volatile swap cache Martin Schwidefsky

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).