set_pte_at_notify regression

2014-01-10 Thread Izik Eidus
Hi, It look like commit 6bdb913f0a70a4dfb7f066fb15e2d6f960701d00 break the semantic of set_pte_at_notify. The change of calling first to mmu_notifier_invalidate_range_start, then to set_pte_at_notify, and then to mmu_notifier_invalidate_range_end not only increase the amount of locks kvm have

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Izik Eidus
On 6/22/2011 3:21 AM, Chris Wright wrote: * Nai Xia (nai@gmail.com) wrote: Introduced kvm_mmu_notifier_test_and_clear_dirty(), kvm_mmu_notifier_dirty_update() and their mmu_notifier interfaces to support KSM dirty bit tracking, which brings significant performance gain in volatile pages

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Izik Eidus
On 6/22/2011 1:43 PM, Avi Kivity wrote: On 06/21/2011 04:32 PM, Nai Xia wrote: Introduced kvm_mmu_notifier_test_and_clear_dirty(), kvm_mmu_notifier_dirty_update() and their mmu_notifier interfaces to support KSM dirty bit tracking, which brings significant performance gain in volatile pages

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Izik Eidus
On 6/22/2011 2:10 PM, Avi Kivity wrote: On 06/22/2011 02:05 PM, Izik Eidus wrote: +spte = rmap_next(kvm, rmapp, NULL); +while (spte) { +int _dirty; +u64 _spte = *spte; +BUG_ON(!(_spte PT_PRESENT_MASK)); +_dirty = _spte PT_DIRTY_MASK; +if (_dirty

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Izik Eidus
On 6/22/2011 2:33 PM, Nai Xia wrote: On Wednesday 22 June 2011 19:28:08 Avi Kivity wrote: On 06/22/2011 02:24 PM, Avi Kivity wrote: On 06/22/2011 02:19 PM, Izik Eidus wrote: On 6/22/2011 2:10 PM, Avi Kivity wrote: On 06/22/2011 02:05 PM, Izik Eidus wrote: +spte = rmap_next(kvm, rmapp

Re: [PATCH] mmu_notifier, kvm: Introduce dirty bit tracking in spte and mmu notifier to help KSM dirty bit tracking

2011-06-22 Thread Izik Eidus
If we don't flush the smp tlb don't we risk that we'll insert pages in the unstable tree that are volatile just because the dirty bit didn't get set again on the spte? Yes, this is the trade off we take, the unstable tree will be flushed anyway - so this is nothing that won`t be recovered

[PATCH] fix migration with big mem guests

2010-04-04 Thread Izik Eidus
already have timer that is set, so it like it make the most sense to use it... If anyone have any better idea how to solve this issue, I will be very happy to hear. Thanks. From 2d9c25f1fee61f50cb130769c3779707a6ef90d9 Mon Sep 17 00:00:00 2001 From: Izik Eidus iei...@redhat.com Date: Mon, 5 Apr 2010

Re: problems getting KSM running on newer 2.6.32.x kernels

2010-02-09 Thread Izik Eidus
On Tue, 09 Feb 2010 12:51:47 +0200 Avi Kivity a...@redhat.com wrote: On 02/01/2010 12:37 PM, Nikola Ciprich wrote: Hello, it seems to me that after upgrading to some 2.6.32.x release, KSM stopped working for me. I'm not exactly sure which update did this, but enabling KSM doesn't seem

Re: [PATCH] RFC: alias rework

2010-01-26 Thread Izik Eidus
On Tue, 26 Jan 2010 16:14:47 +0200 Avi Kivity a...@redhat.com wrote: On 01/25/2010 10:40 PM, Izik Eidus wrote: Or is this a feature you need? I dont need it (I asked Avi to do something), So he said he want to nuke the aliasing from kvm and keep supporting the old userspace

[PATCH] RFC: alias rework

2010-01-25 Thread Izik Eidus
From f94dcd1ccabbcdb51ed7c37c5f58f00a5c1b7eec Mon Sep 17 00:00:00 2001 From: Izik Eidus iei...@redhat.com Date: Mon, 25 Jan 2010 15:49:41 +0200 Subject: [PATCH] RFC: alias rework This patch remove the old way of aliasing inside kvm and move into using aliasing with the same virtual addresses

Re: [PATCH] RFC: alias rework

2010-01-25 Thread Izik Eidus
On Mon, 25 Jan 2010 17:45:53 -0200 Marcelo Tosatti mtosa...@redhat.com wrote: Izik, On Mon, Jan 25, 2010 at 03:53:44PM +0200, Izik Eidus wrote: From f94dcd1ccabbcdb51ed7c37c5f58f00a5c1b7eec Mon Sep 17 00:00:00 2001 From: Izik Eidus iei...@redhat.com Date: Mon, 25 Jan 2010 15:49:41 +0200

Re: [PATCH] RFC: alias rework

2010-01-25 Thread Izik Eidus
On Mon, 25 Jan 2010 18:49:25 -0200 Marcelo Tosatti mtosa...@redhat.com wrote: On Mon, Jan 25, 2010 at 10:40:32PM +0200, Izik Eidus wrote: On Mon, 25 Jan 2010 18:20:39 -0200 Marcelo Tosatti mtosa...@redhat.com wrote: With current code, if a memslot is deleted, access through any aliases

PATCH: kvm-userspace: ksm support

2009-10-04 Thread Izik Eidus
From a8ca226de8efb4f0447e4ef87bf034cf18996745 Mon Sep 17 00:00:00 2001 From: Izik Eidus iei...@redhat.com Date: Sun, 4 Oct 2009 14:01:31 +0200 Subject: [PATCH] kvm-userspace: add ksm support Calling to madvise(MADV_MERGEABLE) on the memory allocations. Signed-off-by: Izik Eidus iei...@redhat.com

[PATCH 0/3] ksm support for kvm v2

2009-09-23 Thread Izik Eidus
Hope i fixed everything i was asked... please tell me if I forgot anything. Izik Eidus (3): kvm: dont hold pagecount reference for mapped sptes pages add SPTE_HOST_WRITEABLE flag to the shadow ptes add support for change_pte mmu notifiers arch/x86/include/asm/kvm_host.h |1 + arch/x86

[PATCH 1/3] kvm: dont hold pagecount reference for mapped sptes pages

2009-09-23 Thread Izik Eidus
not increase the mapcount when mapping page into shadow page table entry, so when comparing pagecount against mapcount, you have no reliable result.) Signed-off-by: Izik Eidus iei...@redhat.com --- arch/x86/kvm/mmu.c |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86

[PATCH 2/3] add SPTE_HOST_WRITEABLE flag to the shadow ptes

2009-09-23 Thread Izik Eidus
this flag notify that the host physical page we are pointing to from the spte is write protected, and therefore we cant change its access to be write unless we run get_user_pages(write = 1). (this is needed for change_pte support in kvm) Signed-off-by: Izik Eidus iei...@redhat.com --- arch/x86

[PATCH 3/3] add support for change_pte mmu notifiers

2009-09-23 Thread Izik Eidus
this is needed for kvm if it want ksm to directly map pages into its shadow page tables. Signed-off-by: Izik Eidus iei...@redhat.com --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/mmu.c | 64 +- virt/kvm/kvm_main.c | 14

Re: [PATCH 3/3] add support for change_pte mmu notifiers

2009-09-23 Thread Izik Eidus
Izik Eidus wrote: this is needed for kvm if it want ksm to directly map pages into its shadow page tables. Signed-off-by: Izik Eidus iei...@redhat.com --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/mmu.c | 64 +- virt/kvm

[PATCH 0/3] kvm ksm support v3

2009-09-23 Thread Izik Eidus
Change from v2 : remove unused if. Thanks. Izik Eidus (3): kvm: dont hold pagecount reference for mapped sptes pages add SPTE_HOST_WRITEABLE flag to the shadow ptes add support for change_pte mmu notifiers arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/mmu.c | 84

[PATCH 1/3] kvm: dont hold pagecount reference for mapped sptes pages

2009-09-23 Thread Izik Eidus
not increase the mapcount when mapping page into shadow page table entry, so when comparing pagecount against mapcount, you have no reliable result.) Signed-off-by: Izik Eidus iei...@redhat.com --- arch/x86/kvm/mmu.c |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86

[PATCH 2/3] add SPTE_HOST_WRITEABLE flag to the shadow ptes

2009-09-23 Thread Izik Eidus
this flag notify that the host physical page we are pointing to from the spte is write protected, and therefore we cant change its access to be write unless we run get_user_pages(write = 1). (this is needed for change_pte support in kvm) Signed-off-by: Izik Eidus iei...@redhat.com --- arch/x86

[PATCH 3/3] add support for change_pte mmu notifiers

2009-09-23 Thread Izik Eidus
this is needed for kvm if it want ksm to directly map pages into its shadow page tables. Signed-off-by: Izik Eidus iei...@redhat.com --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/mmu.c | 62 +- virt/kvm/kvm_main.c | 14

Re: [PATCH 2/3] add SPTE_HOST_WRITEABLE flag to the shadow ptes

2009-09-14 Thread Izik Eidus
Marcelo Tosatti wrote: Why can't you use the writable bit in the spte? So that you can only sync a writeable spte if it was writeable before, in sync_page? I could, but there we will add overhead for read only gptes that become writable in the guest... If you prefer to fault on the syncing

Re: [PATCH 2/3] add SPTE_HOST_WRITEABLE flag to the shadow ptes

2009-09-12 Thread Izik Eidus
Marcelo Tosatti wrote: On Thu, Sep 10, 2009 at 07:38:57PM +0300, Izik Eidus wrote: this flag notify that the host physical page we are pointing to from the spte is write protected, and therefore we cant change its access to be write unless we run get_user_pages(write = 1). (this is needed

Re: [PATCH 3/3] add support for change_pte mmu notifiers

2009-09-12 Thread Izik Eidus
Marcelo Tosatti wrote: On Sat, Sep 12, 2009 at 09:41:10AM +0300, Izik Eidus wrote: Marcelo Tosatti wrote: On Thu, Sep 10, 2009 at 07:38:58PM +0300, Izik Eidus wrote: this is needed for kvm if it want ksm to directly map pages into its shadow page tables. Signed-off-by: Izik

[PATCH 0/3] ksm support for kvm

2009-09-10 Thread Izik Eidus
Hi, The following seires add ksm support to the kvm mmu. Thanks. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 2/3] add SPTE_HOST_WRITEABLE flag to the shadow ptes

2009-09-10 Thread Izik Eidus
this flag notify that the host physical page we are pointing to from the spte is write protected, and therefore we cant change its access to be write unless we run get_user_pages(write = 1). (this is needed for change_pte support in kvm) Signed-off-by: Izik Eidus iei...@redhat.com --- arch/x86

[PATCH 3/3] add support for change_pte mmu notifiers

2009-09-10 Thread Izik Eidus
this is needed for kvm if it want ksm to directly map pages into its shadow page tables. Signed-off-by: Izik Eidus iei...@redhat.com --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/mmu.c | 70 ++ virt/kvm/kvm_main.c | 14

Re: kvm userspace: ksm support

2009-08-03 Thread Izik Eidus
that qemu used to have something called phys_ram_base, in that case it would be just making madvise on phys_ram_base with the same of phys_ram_size) (and adding the necessary kernel changes of course)? On Tuesday 28 July 2009 11:39:59 am Izik Eidus wrote: This patch

Re: kvm userspace: ksm support

2009-08-03 Thread Izik Eidus
Brian Jackson wrote: On Monday 03 August 2009 01:09:38 pm Izik Eidus wrote: Brian Jackson wrote: If someone wanted to play around with ksm in qemu-kvm-0.x.x would it be as simple as adding the below additions to kvm_setup_guest_memory in kvm-all.c qemu-kvm-0.x.x doesnt tell me

kvm userspace: ksm support

2009-07-28 Thread Izik Eidus
This patch is not for inclusion just rfc. Thanks. From 1297b86aa257100b3d819df9f9f0932bf4f7f49d Mon Sep 17 00:00:00 2001 From: Izik Eidus iei...@redhat.com Date: Tue, 28 Jul 2009 19:14:26 +0300 Subject: [PATCH] kvm userspace: ksm support rfc for ksm support to kvm userpsace. thanks Signed

Re: kvm userspace: ksm support

2009-07-28 Thread Izik Eidus
Anthony Liguori wrote: Izik Eidus wrote: This patch is not for inclusion just rfc. The madvise() interface looks really nice :-) Thanks. From 1297b86aa257100b3d819df9f9f0932bf4f7f49d Mon Sep 17 00:00:00 2001 From: Izik Eidus iei...@redhat.com Date: Tue, 28 Jul 2009 19:14:26 +0300

Re: [patch 1/2] KVM: MMU: make __kvm_mmu_free_some_pages handle empty list

2009-07-28 Thread Izik Eidus
Marcelo Tosatti wrote: From: Izik Eidus iei...@redhat.com First check if the list is empty before attempting to look at list entries. Signed-off-by: Izik Eidus iei...@redhat.com Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: kvm/arch/x86/kvm/mmu.c

Re: [patch 2/2] KVM: MMU: fix bogus alloc_mmu_pages assignment

2009-07-28 Thread Izik Eidus
Marcelo Tosatti wrote: Remove the bogus n_free_mmu_pages assignment from alloc_mmu_pages. It breaks accounting of mmu pages, since n_free_mmu_pages is modified but the real number of pages remains the same. Signed-off-by: Marcelo Tosatti mtosa...@redhat.com Index: kvm/arch/x86/kvm/mmu.c

Re: [PATCH 2/2] kvm: change the dirty page tracking to work with dirty bity

2009-06-11 Thread Izik Eidus
Avi Kivity wrote: Izik Eidus wrote: change the dirty page tracking to work with dirty bity instead of page fault. right now the dirty page tracking work with the help of page faults, when we want to track a page for being dirty, we write protect it and we mark it dirty when we have write page

[PATCH 0/2] *** SUBJECT HERE ***

2009-06-10 Thread Izik Eidus
RFC: move the dirty page tracking to use dirty bit Well, i was bored this morning and had this idea for a while, didnt test it to much..., first i want to hear what ppl think? Thanks. Izik Eidus (2): kvm: fix dirty bit tracking for slots with large pages kvm: change the dirty page tracking

[PATCH 1/2] kvm: fix dirty bit tracking for slots with large pages

2009-06-10 Thread Izik Eidus
When slot is already allocted and being asked to be tracked we need to break the large pages. This code flush the mmu when someone ask a slot to start dirty bit tracking. Signed-off-by: Izik Eidus iei...@redhat.com --- virt/kvm/kvm_main.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions

[PATCH 2/2] kvm: change the dirty page tracking to work with dirty bit instead of page fault

2009-06-10 Thread Izik Eidus
right now the dirty page tracking work with the help of page faults, when we want to track a page for being dirty, we write protect it and we mark it dirty when we have write page fault, this code move into looking at the dirty bit of the spte. Signed-off-by: Izik Eidus iei...@redhat.com

Re: [PATCH 2/2] kvm: change the dirty page tracking to work with dirty bit instead of page fault

2009-06-10 Thread Izik Eidus
Few quick thoughts: +void kvm_arch_get_dirty_log(struct kvm *kvm, struct kvm_memory_slot *memslot) +{ +} + long kvm_arch_vm_ioctl(struct file *filp, unsigned int ioctl, unsigned long arg) { diff --git a/arch/x86/include/asm/kvm_host.h

Re: [PATCH 1/2] kvm: fix dirty bit tracking for slots with large pages

2009-06-10 Thread Izik Eidus
Avi Kivity wrote: Izik Eidus wrote: When slot is already allocted and being asked to be tracked we need to break the large pages. This code flush the mmu when someone ask a slot to start dirty bit tracking. Signed-off-by: Izik Eidus iei...@redhat.com --- virt/kvm/kvm_main.c |2 ++ 1

[PATCH 0/2] RFC use dirty bit for page dirty tracking (v2)

2009-06-10 Thread Izik Eidus
RFC move to dirty bit tracking using the page table dirty bit (v2) (BTW, it seems like the vnc in the mainline have some bugs, i have wasted 2 hours debugging rendering bug that i thought was related to that seires, but it came out not to be related) Thanks. Izik Eidus (2): kvm: fix dirty

[PATCH 1/2] kvm: fix dirty bit tracking for slots with large pages

2009-06-10 Thread Izik Eidus
When slot is already allocted and being asked to be tracked we need to break the large pages. This code flush the mmu when someone ask a slot to start dirty bit tracking. Signed-off-by: Izik Eidus iei...@redhat.com --- virt/kvm/kvm_main.c |2 ++ 1 files changed, 2 insertions(+), 0 deletions

Re: [PATCH 2/2] kvm: change the dirty page tracking to work with dirty bity

2009-06-10 Thread Izik Eidus
Izik Eidus wrote: +static int vmx_dirty_bit_support(void) +{ + return false; +} + Again, idiotic bug: this should be: return tdp_enable == false; ... -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More

Re: [PATCH 2/2] kvm: change the dirty page tracking to work with dirty bity

2009-06-10 Thread Izik Eidus
Marcelo Tosatti wrote: On Wed, Jun 10, 2009 at 07:23:25PM +0300, Izik Eidus wrote: change the dirty page tracking to work with dirty bity instead of page fault. right now the dirty page tracking work with the help of page faults, when we want to track a page for being dirty, we write protect

Re: [PATCH 2/2] kvm: change the dirty page tracking to work with dirty bity

2009-06-10 Thread Izik Eidus
Izik Eidus wrote: Marcelo Tosatti wrote: /* Free page dirty bitmap if unneeded */ -if (!(new.flags KVM_MEM_LOG_DIRTY_PAGES)) +if (!(new.flags KVM_MEM_LOG_DIRTY_PAGES)) { new.dirty_bitmap = NULL; +if (old.flags KVM_MEM_LOG_DIRTY_PAGES

Re: [PATCH 5/5] add ksm kernel shared memory driver.

2009-05-13 Thread Izik Eidus
Anthony Liguori wrote: Chris Wright wrote: * Andrew Morton (a...@linux-foundation.org) wrote: Breaks ppc64 allmodcofnig because that architecture doesn't export its copy_user_page() to modules. Things like this and updating to use madvise() I think all point towards s/tristate/bool/.

Re: [PATCH 5/5] add ksm kernel shared memory driver.

2009-05-13 Thread Izik Eidus
Andrew Morton wrote: On Mon, 20 Apr 2009 04:36:06 +0300 Izik Eidus iei...@redhat.com wrote: Ksm is driver that allow merging identical pages between one or more applications in way unvisible to the application that use it. Pages that are merged are marked as readonly and are COWed when any

Re: [PATCH 5/5] add ksm kernel shared memory driver.

2009-04-30 Thread Izik Eidus
On Tue, 28 Apr 2009 02:12:00 +0300 Izik Eidus iei...@redhat.com wrote: Andrew Morton wrote: Breaks sparc64 and probably lots of other architectures: mm/ksm.c: In function `try_to_merge_two_pages_alloc': mm/ksm.c:697: error: `_PAGE_RW' undeclared (first use in this function

Re: [PATCH 5/5] add ksm kernel shared memory driver.

2009-04-27 Thread Izik Eidus
Andrew Morton wrote: On Mon, 20 Apr 2009 04:36:06 +0300 Izik Eidus iei...@redhat.com wrote: Ksm is driver that allow merging identical pages between one or more applications in way unvisible to the application that use it. Pages that are merged are marked as readonly and are COWed when any

Re: [PATCH 5/5] add ksm kernel shared memory driver.

2009-04-20 Thread Izik Eidus
Avi Kivity wrote: Alan Cox wrote: The minor number you are using already belongs to another project. 10,234 is free but it would be good to know what device naming is proposed. I imagine other folks would like to know why you aren't using sysfs or similar or extending /dev/kvm ? ksm was

[PATCH 0/5] ksm - dynamic page sharing driver for linux v4

2009-04-19 Thread Izik Eidus
other numbers...) Ok, you are ready :-) (Just remember, memory that is swapped, isnt scanned by ksm until it come back to memory, so dont try to raise alot of VMS togather) Thanks. Izik Eidus (5): MMU_NOTIFIERS: add set_pte_at_notify() add get_pte(): helper function: fetching pte for va

[PATCH 1/5] MMU_NOTIFIERS: add set_pte_at_notify()

2009-04-19 Thread Izik Eidus
. (users of mmu_notifiers that didnt implement the set_pte_at_notify() call back will just recive the mmu_notifier_invalidate_page callback) Signed-off-by: Izik Eidus iei...@redhat.com --- include/linux/mmu_notifier.h | 34 ++ mm/memory.c | 10

[PATCH 2/5] add get_pte(): helper function: fetching pte for va

2009-04-19 Thread Izik Eidus
get_pte() receive mm_struct of a task, and a virtual address and return the pte corresponding to it. this function return NULL in case it couldnt fetch the pte. Signed-off-by: Izik Eidus iei...@redhat.com --- include/linux/mm.h | 24 1 files changed, 24 insertions

[PATCH 4/5] add replace_page(): change the page pte is pointing to.

2009-04-19 Thread Izik Eidus
of this issue is that newpage cannot be anything but kernel allocated page that is not swappable. Signed-off-by: Izik Eidus iei...@redhat.com --- include/linux/mm.h |5 +++ mm/memory.c| 80 2 files changed, 85 insertions(+), 0 deletions

[PATCH 5/5] add ksm kernel shared memory driver.

2009-04-19 Thread Izik Eidus
and will fork them when write access will happen to them. Ksm scan just memory areas that were registred to be scanned by it. Signed-off-by: Izik Eidus iei...@redhat.com Signed-off-by: Chris Wright chr...@redhat.com Signed-off-by: Andrea Arcangeli aarca...@redhat.com --- include/linux/ksm.h

Re: [PATCH 0/4] ksm - dynamic page sharing driver for linux v3

2009-04-16 Thread Izik Eidus
Nick Piggin wrote: On Wednesday 15 April 2009 08:09:03 Andrew Morton wrote: On Thu, 9 Apr 2009 06:58:37 +0300 Izik Eidus iei...@redhat.com wrote: KSM is a linux driver that allows dynamicly sharing identical memory pages between one or more processes. Generally looks OK to me

Re: [PATCH 4/4] add ksm kernel shared memory driver.

2009-04-15 Thread Izik Eidus
Andrew Morton wrote: On Thu, 9 Apr 2009 06:58:41 +0300 Izik Eidus iei...@redhat.com wrote: Confused. In the covering email you indicated that v2 of the patchset had abandoned ioctls and had moved the interface to sysfs. We have abandoned the ioctls that control the ksm behavior (how

Re: [PATCH 4/4] add ksm kernel shared memory driver.

2009-04-15 Thread Izik Eidus
Jeremy Fitzhardinge wrote: Andrew Morton wrote: +static pte_t *get_pte(struct mm_struct *mm, unsigned long addr) +{ +pgd_t *pgd; +pud_t *pud; +pmd_t *pmd; +pte_t *ptep = NULL; + +pgd = pgd_offset(mm, addr); +if (!pgd_present(*pgd)) +goto out; + +pud =

Re: [PATCH 1/3] kvm: dont hold pagecount reference for mapped sptes pages.

2009-04-12 Thread Izik Eidus
Izik Eidus wrote: Marcelo Tosatti wrote: On Tue, Mar 31, 2009 at 03:00:02AM +0300, Izik Eidus wrote: When using mmu notifiers, we are allowed to remove the page count reference tooken by get_user_pages to a specific page that is mapped inside the shadow page tables. This is needed so we can

Re: [PATCH 1/3] kvm: dont hold pagecount reference for mapped sptes pages.

2009-04-09 Thread Izik Eidus
Marcelo Tosatti wrote: On Tue, Mar 31, 2009 at 03:00:02AM +0300, Izik Eidus wrote: When using mmu notifiers, we are allowed to remove the page count reference tooken by get_user_pages to a specific page that is mapped inside the shadow page tables. This is needed so we can balance

[PATCH 3/4] add replace_page(): change the page pte is pointing to.

2009-04-08 Thread Izik Eidus
of this issue is that newpage cannot be anything but kernel allocated page that is not swappable. Signed-off-by: Izik Eidus iei...@redhat.com --- include/linux/mm.h |5 +++ mm/memory.c| 80 2 files changed, 85 insertions(+), 0 deletions

[PATCH 1/4] MMU_NOTIFIERS: add set_pte_at_notify()

2009-04-08 Thread Izik Eidus
. (users of mmu_notifiers that didnt implement the set_pte_at_notify() call back will just recive the mmu_notifier_invalidate_page callback) Signed-off-by: Izik Eidus iei...@redhat.com --- include/linux/mmu_notifier.h | 34 ++ mm/memory.c | 10

[PATCH 0/4] ksm - dynamic page sharing driver for linux v3

2009-04-08 Thread Izik Eidus
kernel and kvm-userspace that would allow users of kvm to test ksm with it. The kvm patchs would apply to Avi git tree. Izik Eidus (4): MMU_NOTIFIERS: add set_pte_at_notify() add page_wrprotect(): write protecting page. add replace_page(): change the page pte is pointing to. add ksm

[PATCH 2/4] add page_wrprotect(): write protecting page.

2009-04-08 Thread Izik Eidus
another thread read and writes to/from the first 512bytes of the page. We can lose O_DIRECT reads, the very moment we mark any pte wrprotected... Signed-off-by: Izik Eidus iei...@redhat.com --- include/linux/rmap.h | 11 mm/rmap.c| 139

[PATCH 4/4] add ksm kernel shared memory driver.

2009-04-08 Thread Izik Eidus
of pages to share inside this memory region. __u32 pad; __u64 addr: the begining of the virtual address of this region. __u64 reserved_bits; reserved bits for future usage. KSM_REMOVE_MEMORY_REGION: Remove memory region from ksm. Signed-off-by: Izik Eidus iei...@redhat.com Signed-off

Re: [PATCH 4/4] add ksm kernel shared memory driver.

2009-04-06 Thread Izik Eidus
Andrey Panin wrote: On 094, 04 04, 2009 at 05:35:22PM +0300, Izik Eidus wrote: SNIP +static inline u32 calc_checksum(struct page *page) +{ + u32 checksum; + void *addr = kmap_atomic(page, KM_USER0); + checksum = jhash(addr, PAGE_SIZE, 17); Why jhash2() is not used

[PATCH 3/4] add replace_page(): change the page pte is pointing to.

2009-04-04 Thread Izik Eidus
of this issue is that newpage cannot be anything but kernel allocated page that is not swappable. Signed-off-by: Izik Eidus iei...@redhat.com --- include/linux/mm.h |5 +++ mm/memory.c| 80 2 files changed, 85 insertions(+), 0 deletions

[PATCH 2/4] add page_wrprotect(): write protecting page.

2009-04-04 Thread Izik Eidus
another thread read and writes to/from the first 512bytes of the page. We can lose O_DIRECT reads, the very moment we mark any pte wrprotected... Signed-off-by: Izik Eidus iei...@redhat.com --- include/linux/rmap.h | 11 mm/rmap.c| 139

[PATCH 1/4] MMU_NOTIFIERS: add set_pte_at_notify()

2009-04-04 Thread Izik Eidus
. (users of mmu_notifiers that didnt implement the set_pte_at_notify() call back will just recive the mmu_notifier_invalidate_page callback) Signed-off-by: Izik Eidus iei...@redhat.com --- include/linux/mmu_notifier.h | 34 ++ mm/memory.c | 10

[PATCH 0/4] ksm - dynamic page sharing driver for linux v2

2009-04-04 Thread Izik Eidus
be done automatically by the system so it sounded extremely attractive when Andrea presented it. I am sending another seires of patchs for kvm kernel and kvm-userspace that would allow users of kvm to test ksm with it. The kvm patchs would apply to Avi git tree. Izik Eidus (4): MMU_NOTIFIERS: add

[PATCH 4/4] add ksm kernel shared memory driver.

2009-04-04 Thread Izik Eidus
of pages to share inside this memory region. __u32 pad; __u64 addr: the begining of the virtual address of this region. __u64 reserved_bits; reserved bits for future usage. KSM_REMOVE_MEMORY_REGION: Remove memory region from ksm. Signed-off-by: Izik Eidus iei...@redhat.com

Re: [PATCH 5/4] update ksm userspace interfaces

2009-04-03 Thread Izik Eidus
Gerd Hoffmann wrote: Izik Eidus wrote: The main problem that ksm will face when removing the fd interface is: right now when you register memory into ksm, you open fd, and then ksm do get_task_mm(), we will do mmput when the file will be closed Did you test whenever it really cleans

Re: [PATCH 4/4] add ksm kernel shared memory driver.

2009-04-02 Thread Izik Eidus
Anthony Liguori wrote: Chris Wright wrote: * Anthony Liguori (anth...@codemonkey.ws) wrote: The ioctl() interface is quite bad for what you're doing. You're telling the kernel extra information about a VA range in userspace. That's what madvise is for. You're tweaking simple

Re: [PATCH 5/4] update ksm userspace interfaces

2009-04-02 Thread Izik Eidus
Chris Wright wrote: * Anthony Liguori (anth...@codemonkey.ws) wrote: Using an interface like madvise() would force the issue to be dealt with properly from the start :-) Yeah, I'm not at all opposed to it. This updates to madvise for register and sysfs for control. madvise issues:

Re: [PATCH 5/4] update ksm userspace interfaces

2009-04-02 Thread Izik Eidus
Chris Wright wrote: * Izik Eidus (iei...@redhat.com) wrote: Is this what we want? How about baby steps... admit that ioctl to control plane is better done via sysfs? Yes -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord

Re: [PATCH 0/4] ksm - dynamic page sharing driver for linux

2009-04-02 Thread Izik Eidus
Jesper Juhl wrote: Hi, On Tue, 31 Mar 2009, Izik Eidus wrote: KSM is a linux driver that allows dynamicly sharing identical memory pages between one or more processes. Unlike tradtional page sharing that is made at the allocation of the memory, ksm do it dynamicly after the memory

Re: [PATCH 4/4] add ksm kernel shared memory driver.

2009-04-01 Thread Izik Eidus
KAMEZAWA Hiroyuki wrote: On Tue, 31 Mar 2009 15:21:53 +0300 Izik Eidus iei...@redhat.com wrote: kpage is actually what going to be KsmPage - the shared page... Right now this pages are not swappable..., after ksm will be merged we will make this pages swappable as well

Re: [PATCH 4/4] add ksm kernel shared memory driver.

2009-04-01 Thread Izik Eidus
Anthony Liguori wrote: Andrea Arcangeli wrote: On Tue, Mar 31, 2009 at 10:54:57AM -0500, Anthony Liguori wrote: You can still disable ksm and simply return ENOSYS for the MADV_ flag. You Anthony, the biggest problem about madvice() is that it is a real system call api, i wouldnt

Re: [PATCH 4/4] add ksm kernel shared memory driver.

2009-03-31 Thread Izik Eidus
KAMEZAWA Hiroyuki wrote: On Tue, 31 Mar 2009 02:59:20 +0300 Izik Eidus iei...@redhat.com wrote: Ksm is driver that allow merging identical pages between one or more applications in way unvisible to the application that use it. Pages that are merged are marked as readonly and are COWed when

Re: [PATCH 4/4] add ksm kernel shared memory driver.

2009-03-31 Thread Izik Eidus
Anthony Liguori wrote: Izik Eidus wrote: Ksm is driver that allow merging identical pages between one or more applications in way unvisible to the application that use it. Pages that are merged are marked as readonly and are COWed when any application try to change them. Ksm is used for cases

Re: [PATCH 0/4] ksm - dynamic page sharing driver for linux

2009-03-31 Thread Izik Eidus
Anthony Liguori wrote: Izik Eidus wrote: I am sending another seires of patchs for kvm kernel and kvm-userspace that would allow users of kvm to test ksm with it. The kvm patchs would apply to Avi git tree. Any reason to not take these through upstream QEMU instead of kvm-userspace

[PATCH 0/4] ksm - dynamic page sharing driver for linux

2009-03-30 Thread Izik Eidus
of patchs for kvm kernel and kvm-userspace that would allow users of kvm to test ksm with it. The kvm patchs would apply to Avi git tree. Izik Eidus (4): MMU_NOTIFIERS: add set_pte_at_notify() add page_wrprotect(): write protecting page. add replace_page(): change the page pte is pointing

[PATCH 1/4] MMU_NOTIFIERS: add set_pte_at_notify()

2009-03-30 Thread Izik Eidus
. (users of mmu_notifiers that didnt implement the set_pte_at_notify() call back will just recive the mmu_notifier_invalidate_page callback) Signed-off-by: Izik Eidus iei...@redhat.com --- include/linux/mmu_notifier.h | 34 ++ mm/memory.c | 10

[PATCH 2/4] add page_wrprotect(): write protecting page.

2009-03-30 Thread Izik Eidus
another thread read and writes to/from the first 512bytes of the page. We can lose O_DIRECT reads, the very moment we mark any pte wrprotected... Signed-off-by: Izik Eidus iei...@redhat.com --- include/linux/rmap.h | 11 mm/rmap.c| 139

[PATCH 3/4] add replace_page(): change the page pte is pointing to.

2009-03-30 Thread Izik Eidus
of this issue is that newpage cannot be anything but kernel allocated page that is not swappable. Signed-off-by: Izik Eidus iei...@redhat.com --- include/linux/mm.h |5 +++ mm/memory.c| 80 2 files changed, 85 insertions(+), 0 deletions

[PATCH 0/3] kvm support for ksm

2009-03-30 Thread Izik Eidus
apply it against Avi git tree. Izik Eidus (3): kvm: dont hold pagecount reference for mapped sptes pages. kvm: add SPTE_HOST_WRITEABLE flag to the shadow ptes. kvm: add support for change_pte mmu notifiers arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/mmu.c | 89

[PATCH 1/3] kvm: dont hold pagecount reference for mapped sptes pages.

2009-03-30 Thread Izik Eidus
not increase the mapcount when mapping page into shadow page table entry, so when comparing pagecount against mapcount, you have no reliable result.) Signed-off-by: Izik Eidus iei...@redhat.com --- arch/x86/kvm/mmu.c |7 ++- 1 files changed, 2 insertions(+), 5 deletions(-) diff --git a/arch/x86

[PATCH 2/3] kvm: add SPTE_HOST_WRITEABLE flag to the shadow ptes.

2009-03-30 Thread Izik Eidus
this flag notify that the host physical page we are pointing to from the spte is write protected, and therefore we cant change its access to be write unless we run get_user_pages(write = 1). (this is needed for change_pte support in kvm) Signed-off-by: Izik Eidus iei...@redhat.com --- arch/x86

[PATCH 3/3] kvm: add support for change_pte mmu notifiers

2009-03-30 Thread Izik Eidus
this is needed for kvm if it want ksm to directly map pages into its shadow page tables. Signed-off-by: Izik Eidus iei...@redhat.com --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/mmu.c | 68 +++ virt/kvm/kvm_main.c

[PATCH 0/2] kvm-userspace ksm support

2009-03-30 Thread Izik Eidus
Apply it against Avi kvm-userspace git tree. Izik Eidus (2): qemu: add ksm support qemu: add ksmctl. qemu/ksm.h | 70 qemu/vl.c | 34 + user/Makefile |6 +++- user/config

[PATCH 1/2] qemu: add ksm support

2009-03-30 Thread Izik Eidus
Signed-off-by: Izik Eidus iei...@redhat.com --- qemu/ksm.h | 70 qemu/vl.c | 34 + 2 files changed, 104 insertions(+), 0 deletions(-) create mode 100644 qemu/ksm.h diff --git a/qemu/ksm.h b/qemu/ksm.h

[PATCH 2/2] qemu: add ksmctl.

2009-03-30 Thread Izik Eidus
userspace tool to control the ksm kernel thread Signed-off-by: Izik Eidus iei...@redhat.com --- user/Makefile |6 +++- user/config-x86-common.mak |2 +- user/ksmctl.c | 69 3 files changed, 75 insertions(+), 2

[PATCH 4/4] add ksm kernel shared memory driver.

2009-03-30 Thread Izik Eidus
: __u32 npages; number of pages to share inside this memory region. __u32 pad; __u64 addr: the begining of the virtual address of this region. KSM_REMOVE_MEMORY_REGION: Remove memory region from ksm. Signed-off-by: Izik Eidus iei...@redhat.com --- include/linux/ksm.h| 69

Re: Live memory allocation?

2009-03-26 Thread Izik Eidus
Tomasz Chmielewski wrote: Evert schrieb: Hi all, According to the Wikipedia ( http://en.wikipedia.org/wiki/Comparison_of_platform_virtual_machines ) both VirtualBox VMware server support something called 'Live memory allocation'. Does KVM support this as well? What does this term mean

Re: Porting KVM to Mac OS?

2009-01-25 Thread Izik Eidus
Alexander Graf wrote: Hi, On 25.01.2009, at 09:16, Neo Jia wrote: hi, I am thinking if it is possible to port KVM to Mac OS (leopard). Is there anybody doing this already? I've considered doing it, but haven't gotten around to it, due to lack of inspiration. The biggest problem IMHO is

Re: [PATCH] kvm-userspace: set pci mem to start at 0xc100000 and vesa to 0xc000000

2009-01-17 Thread Izik Eidus
Chris Wright wrote: * Izik Eidus (iei...@redhat.com) wrote: This patch make the pci mem region larger (1 giga now). this is needed for pci devices that require large amount of memory such as video cards. for pea guests this patch is not an issue beacuse the guest OS will map the rest

[PATCH 0/1] pci hole remaping

2009-01-10 Thread Izik Eidus
kind of simple, i would send one to qemu later (need to check something first Spice need this, it allow more memory cache (badly needed when runing with multiple screens) -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More

[PATCH] kvm-userspace: set pci mem to start at 0xc100000 and vesa to 0xc000000

2009-01-10 Thread Izik Eidus
the maximum memory that would be avaible now is 3giga. Signed-off-by: Izik Eidus iei...@redhat.com --- bios/acpi-dsdt.dsl |2 +- bios/rombios.c |2 +- bios/rombios32.c| 10 +- qemu/hw/pc.c|6 +++--- qemu/hw/vga_int.h

[PATCH 0/2] remove kvm vmap usage

2008-12-28 Thread Izik Eidus
Remove the vmap usage from kvm, this is needed both for ksm and get_user_pages != write. -- To unsubscribe from this list: send the line unsubscribe kvm in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html

[PATCH 1/2] KVM: introducing kvm_read_guest_virt, kvm_write_guest_virt.

2008-12-28 Thread Izik Eidus
This commit change the name of emulator_read_std into kvm_read_guest_virt, and add new function name kvm_write_guest_virt that allow writing into a guest virtual address. Signed-off-by: Izik Eidus iei...@redhat.com --- arch/x86/include/asm/kvm_host.h |4 --- arch/x86/kvm/x86.c

  1   2   >