All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Carsten Otte <cotte@de.ibm.com>
Cc: npiggin@suse.de, EHRHARDT@de.ibm.com, arnd@arndb.de,
	hollisb@us.ibm.com, borntraeger@de.ibm.com,
	kvm-devel@lists.sourceforge.net, heiko.carstens@de.ibm.com,
	jeroney@us.ibm.com, avi@qumranet.com,
	virtualization@lists.linux-foundation.org, linux-mm@kvack.org,
	schwidefsky@de.ibm.com, hugh@veritas.com, rvdheij@gmail.com,
	os@de.ibm.com, jblunck@suse.de, xiantao.zhang@intel.com
Subject: Re: [RFC/PATCH 02/15 v2] preparation: host memory management changes for s390 kvm
Date: Mon, 24 Mar 2008 14:52:09 -0700	[thread overview]
Message-ID: <20080324145209.23920166.akpm@linux-foundation.org> (raw)
In-Reply-To: <1206205359.7177.84.camel@cotte.boeblingen.de.ibm.com>

On Sat, 22 Mar 2008 18:02:39 +0100
Carsten Otte <cotte@de.ibm.com> wrote:

> From: Heiko Carstens <heiko.carstens@de.ibm.com>
> From: Christian Borntraeger <borntraeger@de.ibm.com>
> 
> This patch changes the s390 memory management defintions to use the pgste field
> for dirty and reference bit tracking of host and guest code. Usually on s390, 
> dirty and referenced are tracked in storage keys, which belong to the physical
> page. This changes with virtualization: The guest and host dirty/reference bits
> are defined to be the logical OR of the values for the mapping and the physical
> page. This patch implements the necessary changes in pgtable.h for s390.
> 
> 
> There is a common code change in mm/rmap.c, the call to page_test_and_clear_young
> must be moved. This is a no-op for all architecture but s390. page_referenced
> checks the referenced bits for the physiscal page and for all mappings:
> o The physical page is checked with page_test_and_clear_young.
> o The mappings are checked with ptep_test_and_clear_young and friends.
> 
> Without pgstes (the current implementation on Linux s390) the physical page
> check is implemented but the mapping callbacks are no-ops because dirty 
> and referenced are not tracked in the s390 page tables. The pgstes introduces 
> guest and host dirty and reference bits for s390 in the host mapping. These
> mapping must be checked before page_test_and_clear_young resets the reference
> bit. 
>
> ...
>
> --- linux-host.orig/mm/rmap.c
> +++ linux-host/mm/rmap.c
> @@ -413,9 +413,6 @@ int page_referenced(struct page *page, i
>  {
>  	int referenced = 0;
>  
> -	if (page_test_and_clear_young(page))
> -		referenced++;
> -
>  	if (TestClearPageReferenced(page))
>  		referenced++;
>  
> @@ -433,6 +430,10 @@ int page_referenced(struct page *page, i
>  			unlock_page(page);
>  		}
>  	}
> +
> +	if (page_test_and_clear_young(page))
> +		referenced++;
> +
>  	return referenced;
>  }

ack.

-------------------------------------------------------------------------
This SF.net email is sponsored by: Microsoft
Defy all challenges. Microsoft(R) Visual Studio 2008.
http://clk.atdmt.com/MRT/go/vse0120000070mrt/direct/01/

WARNING: multiple messages have this Message-ID (diff)
From: Andrew Morton <akpm@linux-foundation.org>
To: Carsten Otte <cotte@de.ibm.com>
Cc: virtualization@lists.linux-foundation.org,
	kvm-devel@lists.sourceforge.net, avi@qumranet.com,
	npiggin@suse.de, hugh@veritas.com, linux-mm@kvack.org,
	schwidefsky@de.ibm.com, heiko.carstens@de.ibm.com, os@de.ibm.com,
	borntraeger@de.ibm.com, hollisb@us.ibm.com, EHRHARDT@de.ibm.com,
	jeroney@us.ibm.com, aliguori@us.ibm.com, jblunck@suse.de,
	rvdheij@gmail.com, rusty@rustcorp.com.au, arnd@arndb.de,
	xiantao.zhang@intel.com
Subject: Re: [RFC/PATCH 02/15 v2] preparation: host memory management changes for s390 kvm
Date: Mon, 24 Mar 2008 14:52:09 -0700	[thread overview]
Message-ID: <20080324145209.23920166.akpm@linux-foundation.org> (raw)
In-Reply-To: <1206205359.7177.84.camel@cotte.boeblingen.de.ibm.com>

On Sat, 22 Mar 2008 18:02:39 +0100
Carsten Otte <cotte@de.ibm.com> wrote:

> From: Heiko Carstens <heiko.carstens@de.ibm.com>
> From: Christian Borntraeger <borntraeger@de.ibm.com>
> 
> This patch changes the s390 memory management defintions to use the pgste field
> for dirty and reference bit tracking of host and guest code. Usually on s390, 
> dirty and referenced are tracked in storage keys, which belong to the physical
> page. This changes with virtualization: The guest and host dirty/reference bits
> are defined to be the logical OR of the values for the mapping and the physical
> page. This patch implements the necessary changes in pgtable.h for s390.
> 
> 
> There is a common code change in mm/rmap.c, the call to page_test_and_clear_young
> must be moved. This is a no-op for all architecture but s390. page_referenced
> checks the referenced bits for the physiscal page and for all mappings:
> o The physical page is checked with page_test_and_clear_young.
> o The mappings are checked with ptep_test_and_clear_young and friends.
> 
> Without pgstes (the current implementation on Linux s390) the physical page
> check is implemented but the mapping callbacks are no-ops because dirty 
> and referenced are not tracked in the s390 page tables. The pgstes introduces 
> guest and host dirty and reference bits for s390 in the host mapping. These
> mapping must be checked before page_test_and_clear_young resets the reference
> bit. 
>
> ...
>
> --- linux-host.orig/mm/rmap.c
> +++ linux-host/mm/rmap.c
> @@ -413,9 +413,6 @@ int page_referenced(struct page *page, i
>  {
>  	int referenced = 0;
>  
> -	if (page_test_and_clear_young(page))
> -		referenced++;
> -
>  	if (TestClearPageReferenced(page))
>  		referenced++;
>  
> @@ -433,6 +430,10 @@ int page_referenced(struct page *page, i
>  			unlock_page(page);
>  		}
>  	}
> +
> +	if (page_test_and_clear_young(page))
> +		referenced++;
> +
>  	return referenced;
>  }

ack.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2008-03-24 21:52 UTC|newest]

Thread overview: 101+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-20 16:24 [RFC/PATCH 00/15] kvm on big iron Carsten Otte
2008-03-21 11:02 ` [kvm-devel] " Avi Kivity
2008-03-21 11:02 ` Avi Kivity
2008-03-21 11:22   ` [kvm-devel] " Carsten Otte
2008-03-21 19:44   ` [kvm-ppc-devel] [kvm-devel] buliding and testing PowerPC KVM Hollis Blanchard
2008-03-21 19:44     ` Hollis Blanchard
2008-03-25 16:56     ` [kvm-ppc-devel] [kvm-devel] " Avi Kivity
2008-03-25 16:56       ` Avi Kivity
2008-03-25 18:18       ` [kvm-ppc-devel] [kvm-devel] " Hollis Blanchard
2008-03-25 18:18         ` Hollis Blanchard
2008-03-25 18:21       ` [kvm-ppc-devel] [kvm-devel] " Jerone Young
2008-03-25 18:21         ` Jerone Young
2008-03-25 18:23         ` [kvm-ppc-devel] [kvm-devel] " Jerone Young
2008-03-25 18:23           ` Jerone Young
2008-03-26 16:40           ` [kvm-ppc-devel] [kvm-devel] " Avi Kivity
2008-03-26 16:40             ` Avi Kivity
2008-03-22 17:02 ` [RFC/PATCH 00/15 v2] kvm on big iron Carsten Otte
2008-03-22 17:02 ` Carsten Otte
2008-03-22 17:02   ` Carsten Otte
2008-03-25 17:47   ` [RFC/PATCH 00/15 v3] " Carsten Otte
2008-03-25 17:47     ` Carsten Otte
2008-03-27 12:02     ` Avi Kivity
2008-03-27 12:02     ` Avi Kivity
2008-03-27 12:02       ` Avi Kivity
2008-03-25 17:47   ` Carsten Otte
     [not found]   ` <1206458154.6217.12.camel@cotte.boeblingen.de.ibm.com>
2008-03-25 17:47     ` [RFC/PATCH 01/15 v3] preparation: provide hook to enable pgstes in user pagetable Carsten Otte
2008-03-25 17:47     ` Carsten Otte
2008-03-25 17:47       ` Carsten Otte, Martin Schwidefsky, Carsten Otte
2008-03-25 17:47     ` [RFC/PATCH 02/15 v3] preparation: host memory management changes for s390 kvm Carsten Otte
2008-03-25 17:47       ` Carsten Otte, Heiko Carstens, Christian Borntraeger
2008-03-25 17:47     ` Carsten Otte
2008-03-25 17:47     ` [RFC/PATCH 03/15 v3] preparation: address of the 64bit extint parm in lowcore Carsten Otte
2008-03-25 17:47     ` Carsten Otte
2008-03-25 17:47     ` [RFC/PATCH 04/15 v3] preparation: split sysinfo defintions for kvm use Carsten Otte
2008-03-25 17:47     ` Carsten Otte
2008-03-25 17:47     ` [RFC/PATCH 05/15 v3] kvm-s390: s390 arch backend for the kvm kernel module Carsten Otte
2008-03-25 17:47     ` Carsten Otte
2008-03-31  5:36       ` Arnd Bergmann
2008-03-31  5:36       ` Arnd Bergmann
2008-04-02 10:20         ` Christian Borntraeger
2008-04-02 10:20         ` Christian Borntraeger
2008-03-25 17:47     ` [RFC/PATCH 06/15 v3] kvm-s390: sie intercept handling Carsten Otte
2008-03-25 17:47     ` Carsten Otte
2008-03-25 17:47     ` [RFC/PATCH 07/15 v3] kvm-s390: interrupt subsystem, cpu timer, waitpsw Carsten Otte
2008-03-31  5:43       ` Arnd Bergmann
2008-03-31  5:43       ` Arnd Bergmann
2008-03-25 17:47     ` Carsten Otte
2008-03-25 17:47     ` [RFC/PATCH 08/15 v3] kvm-s390: intercepts for privileged instructions Carsten Otte
2008-03-25 17:47     ` Carsten Otte
2008-03-25 17:47     ` [RFC/PATCH 09/15 v3] kvm-s390: interprocessor communication via sigp Carsten Otte
2008-03-25 17:47     ` Carsten Otte
2008-03-25 17:47     ` [RFC/PATCH 10/15 v3] kvm-s390: intercepts for diagnose instructions Carsten Otte
2008-03-25 17:47     ` Carsten Otte
2008-03-25 17:47     ` [RFC/PATCH 11/15 v3] kvm-s390: add kvm to kconfig on s390 Carsten Otte
2008-03-25 17:47     ` Carsten Otte
2008-03-25 17:47     ` [RFC/PATCH 12/15 v3] kvm-s390: API documentation Carsten Otte
2008-03-25 17:47     ` Carsten Otte
2008-03-25 17:47     ` [RFC/PATCH 13/15 v3] kvm-s390: update maintainers Carsten Otte
2008-03-25 17:47     ` Carsten Otte
2008-03-25 17:47     ` [RFC/PATCH 14/15 v3] guest: detect when running on kvm Carsten Otte
2008-03-25 17:47     ` Carsten Otte
2008-03-25 17:47     ` [RFC/PATCH 15/15 v3] guest: virtio device support, and kvm hypercalls Carsten Otte
2008-03-25 17:47     ` Carsten Otte
     [not found] ` <1206203560.7177.45.camel@cotte.boeblingen.de.ibm.com>
2008-03-22 17:02   ` [RFC/PATCH 01/15 v2] preparation: provide hook to enable pgstes in user pagetable Carsten Otte
2008-03-22 17:02   ` Carsten Otte
2008-03-22 17:02     ` Carsten Otte, Martin Schwidefsky
2008-03-24 21:50     ` Andrew Morton
2008-03-24 21:50     ` Andrew Morton
2008-03-24 21:50       ` Andrew Morton
2008-03-22 17:02   ` [RFC/PATCH 02/15 v2] preparation: host memory management changes for s390 kvm Carsten Otte
2008-03-22 17:02     ` Carsten Otte, Heiko Carstens, Christian Borntraeger
2008-03-24 21:52     ` Andrew Morton [this message]
2008-03-24 21:52       ` Andrew Morton
2008-03-24 21:52     ` Andrew Morton
2008-03-22 17:02   ` Carsten Otte
2008-03-22 17:02   ` [RFC/PATCH 03/15 v2] preparation: address of the 64bit extint parm in lowcore Carsten Otte
2008-03-22 17:02   ` Carsten Otte
2008-03-22 17:02   ` [RFC/PATCH 04/15 v2] preparation: split sysinfo defintions for kvm use Carsten Otte
2008-03-22 17:02   ` Carsten Otte
2008-03-22 17:02   ` [RFC/PATCH 05/15 v2] kvm-s390: s390 arch backend for the kvm kernel module Carsten Otte
2008-03-22 17:02   ` Carsten Otte
2008-03-22 17:02   ` [RFC/PATCH 06/15 v2] kvm-s390: sie intercept handling Carsten Otte
2008-03-22 17:02   ` Carsten Otte
2008-03-22 17:02   ` [RFC/PATCH 07/15 v2] kvm-s390: interrupt subsystem, cpu timer, waitpsw Carsten Otte
2008-03-22 17:02   ` Carsten Otte
2008-03-22 17:02   ` [RFC/PATCH 08/15 v2] kvm-s390: intercepts for privileged instructions Carsten Otte
2008-03-22 17:02   ` Carsten Otte
2008-03-22 17:02   ` [RFC/PATCH 09/15 v2] kvm-s390: interprocessor communication via sigp Carsten Otte
2008-03-22 17:02   ` Carsten Otte
2008-03-22 17:02   ` [RFC/PATCH 10/15 v2] kvm-s390: intercepts for diagnose instructions Carsten Otte
2008-03-22 17:02   ` Carsten Otte
2008-03-22 17:02   ` [RFC/PATCH 11/15 v2] kvm-s390: add kvm to kconfig on s390 Carsten Otte
2008-03-22 17:02   ` Carsten Otte
2008-03-22 17:02   ` [RFC/PATCH 12/15 v2] kvm-s390: API documentation Carsten Otte
2008-03-22 17:02   ` Carsten Otte
2008-03-22 17:03   ` [RFC/PATCH 13/15 v2] kvm-s390: update maintainers Carsten Otte
2008-03-22 17:03   ` Carsten Otte
2008-03-22 17:03   ` [RFC/PATCH 14/15 v2] guest: detect when running on kvm Carsten Otte
2008-03-22 17:03   ` Carsten Otte
2008-03-22 17:03   ` [RFC/PATCH 15/15 v2] guest: virtio device support, and kvm hypercalls Carsten Otte
2008-03-22 17:03   ` Carsten Otte

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=20080324145209.23920166.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=EHRHARDT@de.ibm.com \
    --cc=arnd@arndb.de \
    --cc=avi@qumranet.com \
    --cc=borntraeger@de.ibm.com \
    --cc=cotte@de.ibm.com \
    --cc=heiko.carstens@de.ibm.com \
    --cc=hollisb@us.ibm.com \
    --cc=hugh@veritas.com \
    --cc=jblunck@suse.de \
    --cc=jeroney@us.ibm.com \
    --cc=kvm-devel@lists.sourceforge.net \
    --cc=linux-mm@kvack.org \
    --cc=npiggin@suse.de \
    --cc=os@de.ibm.com \
    --cc=rvdheij@gmail.com \
    --cc=schwidefsky@de.ibm.com \
    --cc=virtualization@lists.linux-foundation.org \
    --cc=xiantao.zhang@intel.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 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.