[PATCH 2/2] KVM: remove the vmap usage

2008-12-28 Thread Izik Eidus
Signed-off-by: Izik Eidus iei...@redhat.com --- arch/x86/kvm/x86.c| 62 +--- include/linux/kvm_types.h |3 +- 2 files changed, 14 insertions(+), 51 deletions(-) diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index c812209..29df564

Re: [PATCH 0/2] remove kvm vmap usage

2008-12-28 Thread Izik Eidus
Izik Eidus wrote: 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

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

2008-11-20 Thread Izik Eidus
ציטוט Ryota OZAKI: Hi Izik, I've tried your patch set, but ksm doesn't work in my machine. I compiled linux patched with the four patches and configured with KSM and KVM enabled. After boot with the linux, I run two VMs running linux using QEMU with a patch in your mail and started KSM scanner

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

2008-11-20 Thread Izik Eidus
ציטוט Izik Eidus: ציטוט Ryota OZAKI: Hi Izik, I've tried your patch set, but ksm doesn't work in my machine. I compiled linux patched with the four patches and configured with KSM and KVM enabled. After boot with the linux, I run two VMs running linux using QEMU with a patch in your mail

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

2008-11-16 Thread Izik Eidus
(From v1 to v2 the main change is much more documentation) 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 was created.

[PATCH 1/4] Rmap: Add page_wrprotect() function.

2008-11-16 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 [EMAIL PROTECTED] --- include/linux/rmap.h | 11 mm/rmap.c| 129

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

2008-11-16 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 [EMAIL PROTECTED] --- include/linux/mm.h |5 +++ mm/memory.c| 80 2 files changed, 85 insertions(+), 0 deletions

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

2008-11-16 Thread Izik Eidus
of scanning (so even if there are still more pages to scan, we stop this iteration) __u32 flags: flags to control ksm scaning (right now just ksm_control_flags_run available) Signed-off-by: Izik Eidus

[PATCH 4/4] MMU_NOTIFIRES: add set_pte_at_notify()

2008-11-16 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 [EMAIL PROTECTED] --- arch/x86/include/asm/kvm_host.h |1 + arch/x86/kvm/mmu.c | 55

Re: [PATCH 2/4] Add replace_page(), change the mapping of pte from one page into another

2008-11-13 Thread Izik Eidus
ציטוט KAMEZAWA Hiroyuki: Thank you for answers. On Wed, 12 Nov 2008 13:11:12 +0200 Izik Eidus [EMAIL PROTECTED] wrote: Avi Kivity wrote: KAMEZAWA Hiroyuki wrote: Can I make a question ? (I'm working for memory cgroup.) Now, we do charge to anonymous page when - charge(+1

Re: [PATCH 2/4] Add replace_page(), change the mapping of pte from one page into another

2008-11-12 Thread Izik Eidus
Avi Kivity wrote: KAMEZAWA Hiroyuki wrote: Can I make a question ? (I'm working for memory cgroup.) Now, we do charge to anonymous page when - charge(+1) when it's mapped firstly (mapcount 0-1) - uncharge(-1) it's fully unmapped (mapcount 1-0) vir page_remove_rmap(). My quesion is -

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

2008-11-11 Thread Izik Eidus
Andrew Morton wrote: On Tue, 11 Nov 2008 15:21:37 +0200 Izik Eidus [EMAIL PROTECTED] 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

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

2008-11-11 Thread Izik Eidus
Avi Kivity wrote: Andrew Morton wrote: The whole approach seems wrong to me. The kernel lost track of these pages and then we run around post-facto trying to fix that up again. Please explain (for the changelog) why the kernel cannot get this right via the usual sharing, refcounting and

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

2008-11-11 Thread Izik Eidus
Andrew Morton wrote: On Tue, 11 Nov 2008 20:48:16 +0200 Avi Kivity [EMAIL PROTECTED] wrote: Andrew Morton wrote: The whole approach seems wrong to me. The kernel lost track of these pages and then we run around post-facto trying to fix that up again. Please explain (for the

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

2008-11-11 Thread Izik Eidus
From: Izik Eidus [EMAIL PROTECTED] 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 working by walking over

[PATCH 2/4] Add replace_page(), change the mapping of pte from one page into another

2008-11-11 Thread Izik Eidus
From: Izik Eidus [EMAIL PROTECTED] this function is needed in cases you want to change the userspace virtual mapping into diffrent physical page, KSM need this for merging the identical pages. this function is working by removing the oldpage from the rmap and calling put_page

[PATCH 4/4] MMU_NOTIFIRES: add set_pte_at_notify()

2008-11-11 Thread Izik Eidus
From: Izik Eidus [EMAIL PROTECTED] this function is optimzation for kvm/users of mmu_notifiers for COW pages, it is useful for kvm when ksm is used beacuse it allow kvm not to have to recive VMEXIT and only then map the shared page into the mmu shadow pages, but instead map it directly

Re: [PATCH 2/4] Add replace_page(), change the mapping of pte from one page into another

2008-11-11 Thread Izik Eidus
Andrew Morton wrote: On Tue, 11 Nov 2008 15:21:39 +0200 Izik Eidus [EMAIL PROTECTED] wrote: From: Izik Eidus [EMAIL PROTECTED] this function is needed in cases you want to change the userspace virtual mapping into diffrent physical page, Not sure that I understand that description

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

2008-11-11 Thread Izik Eidus
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 was created. Memory is periodically scanned; identical pages are identified

Re: [PATCH 2/4] Add replace_page(), change the mapping of pte from one page into another

2008-11-11 Thread Izik Eidus
Christoph Lameter wrote: page migration as far as i saw cant migrate anonymous page into kernel page. if you want we can change page_migration to do that, but i thought you will rather have ksm changes separate. What do you mean by kernel page? The kernel can allocate a page and then

Re: [PATCH 2/4] Add replace_page(), change the mapping of pte from one page into another

2008-11-11 Thread Izik Eidus
Christoph Lameter wrote: Currently page migration assumes that the page will continue to be part of the existing file or anon vma. exactly, and ksm really need it to get out of the existing anon vma! What you want sounds like assigning a swap pte to an anonymous page? That way a anon

Re: [PATCH 2/4] Add replace_page(), change the mapping of pte from one page into another

2008-11-11 Thread Izik Eidus
Christoph Lameter wrote: On Tue, 11 Nov 2008, Avi Kivity wrote: Christoph Lameter wrote: page migration requires the page to be on the LRU. That could be changed if you have a different means of isolating a page from its page tables. Isn't rmap the means of isolating a page

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

2008-11-11 Thread Izik Eidus
Jonathan Corbet wrote: I don't claim to begin to really understand the deep VM side of this patch, but I can certainly pick nits as I work through it...sorry for the lack of anything more substantive. +static struct list_head slots; Some of these file-static variable names seem a

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

2008-11-11 Thread Izik Eidus
Jonathan Corbet wrote: On Wed, 12 Nov 2008 00:17:39 +0200 Izik Eidus [EMAIL PROTECTED] wrote: +static int ksm_dev_open(struct inode *inode, struct file *filp) +{ + try_module_get(THIS_MODULE); + return 0; +} + +static int ksm_dev_release(struct inode *inode, struct file *filp

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

2008-11-11 Thread Izik Eidus
Jonathan Corbet wrote: [Let's see if I can get through the rest without premature sends...] On Wed, 12 Nov 2008 00:17:39 +0200 Izik Eidus [EMAIL PROTECTED] wrote: Actually, it occurs to me that there's no sanity checks on any of the values passed in by ioctl(). What happens if the user

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

2008-11-11 Thread Izik Eidus
Jonathan Corbet wrote: What about things like cache effects from scanning all those pages? My guess is that, if you're trying to run dozens of Windows guests, cache usage is not at the top of your list of concerns, but I could be wrong. Usually am... Ok, ksm does make the cache of the

Re: [Qemu-devel] [RFC] Disk integrity in QEMU

2008-10-12 Thread Izik Eidus
Avi Kivity wrote: LRU typically makes fairly bad decisions since it throws most of the information it has away. I recommend looking up LRU-K and similar algorithms, just to get a feel for this; it is basically the simplest possible algorithm short of random selection. Note that Linux doesn't

fast fix for mmu aliasing troubles

2008-10-03 Thread Izik Eidus
i have sent patch that remove the aliasing and i will resend it again but untill then this patch should be applied as it fix kernel panic. From 61a13744e2367572f3e27ab5c0cce6e080e94d67 Mon Sep 17 00:00:00 2001 From: Izik Eidus [EMAIL PROTECTED] Date: Fri, 3 Oct 2008 17:40:32 +0300 Subject: [PATCH

Re: [PATCH] unalias rework

2008-10-02 Thread Izik Eidus
Marcelo Tosatti wrote: Hi Izik, On Thu, Sep 04, 2008 at 05:13:20PM +0300, izik eidus wrote: + struct kvm_memory_slot *alias_slot = kvm-memslots[i]; + + if (alias_slot-base_gfn == slot-base_gfn) + return 1; + } + return 0

Re: [PATCH] unalias rework

2008-10-02 Thread Izik Eidus
Marcelo Tosatti wrote: Hi Izik, On Thu, Sep 04, 2008 at 05:13:20PM +0300, izik eidus wrote: +struct kvm_memory_slot *alias_slot = kvm-memslots[i]; + +if (alias_slot-base_gfn == slot-base_gfn) +return 1; +} +return 0; +} + +static void update_alias_slots

[PATCH] unalias rework

2008-09-04 Thread izik eidus
that treated as not aliased. Signed-off-by: Izik Eidus [EMAIL PROTECTED] --- arch/ia64/include/asm/kvm_host.h |1 + arch/ia64/kvm/kvm-ia64.c |5 -- arch/s390/include/asm/kvm_host.h |1 + arch/s390/kvm/kvm-s390.c |5 -- arch/x86/kvm/mmu.c |5 +-- arch/x86

Re: KSM Algorithm

2008-07-10 Thread Izik Eidus
ציטוט Sukanto Ghosh: Can anyone answer these queries regarding KSM ? How does KSM offers its services through the /dev/ksm device ? ioctls Are every guest pages scanned in KVM while using KSM or page-scanning and sharing is triggered on some event (low memory, etc) ? no, the scanning

Re: KSM Algorithm

2008-07-10 Thread Izik Eidus
ציטוט Sukanto Ghosh: Doesn't KSM notifies KVM about the shared pages so that KVM can update its sptes accordingly or is it done by KSM itself ? when using kvm, mmu notifiers is a must for ksm, (mmu notifiers update kvm about the changes in the host page table) What about KSM

Re: KSM Algorithm

2008-07-10 Thread Izik Eidus
ציטוט Sukanto Ghosh: One more query, what if multiple processes call ioctl KSM_CREATE_SCAN ? Will there be multiple scanners ? yes Consider a scenario where two processes A B separately call KSM_CREATE_SCAN and then start registering some memory pages/areas via

Re: What happens if I use get_user_pages()

2008-07-08 Thread Izik Eidus
ציטוט Arn: If I use the kernel function get_user_pages() within a guest kernel module, will this ensure that the guests pages are never swapped out by the host ? Will it lock these pages in memory ? (Has anyone tried this ? ) As Izik said, the answer is no. Is this the desirable outcome,

<    1   2