linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Izik Eidus <ieidus@redhat.com>
To: Ryota OZAKI <ozaki.ryota@gmail.com>
Cc: akpm@linux-foundation.org, linux-kernel@vger.kernel.org,
	linux-mm@kvack.org, kvm@vger.kernel.org, aarcange@redhat.com,
	chrisw@redhat.com, avi@redhat.com, dlaor@redhat.com,
	kamezawa.hiroyu@jp.fujitsu.com, cl@linux-foundation.org,
	corbet@lwn.net
Subject: Re: [PATCH 0/4] ksm - dynamic page sharing driver for linux v2
Date: Thu, 20 Nov 2008 11:03:27 +0200	[thread overview]
Message-ID: <492527DF.1080602@redhat.com> (raw)
In-Reply-To: <5e93dcec0811192344l3813867egcc6b5a3c666142b9@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 2816 bytes --]

oeeae 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 with your
> script, then the host linux caused panic with the following oops.
>   

Yes you are right, we are missing pte_unmap(pte); in get_pte()!
that will effect just 32bits with highmem so this why you see it
thanks for the reporting, i will fix it for v3

below patch should fix it (i cant test it now, will test it for v3)

can you report if it fix your problem? thanks
>
> == BEGINNING of OOPS
> kernel BUG at arch/x86/mm/highmem_32.c:87!
> invalid opcode: 0000 [#1] SMP
> last sysfs file: /sys/class/net/vnet-ssh2/address
> Dumping ftrace buffer:
>    (ftrace buffer empty)
> Modules linked in: netconsole autofs4 nf_conntrack_ipv4 nf_defrag_ipv4
> xt_state nf_conntrack xt_tcpudp ipt_REJECT iptable_filter ip_tables
> x_tables loop kvm_intel kvm iTCO_wdt iTCO_vendor_support igb
> netxen_nic button ext3 jbd mbcache uhci_hcd ohci_hcd ehci_hcd usbcore
> [last unloaded: microcode]
>
> Pid: 343, comm: kksmd Not tainted
> (2.6.28-rc5-linus-head-20081119-sparsemem #1) X7DWA
> EIP: 0060:[<c041eff9>] EFLAGS: 00010206 CPU: 6
> EIP is at kmap_atomic_prot+0x7d/0xeb
> EAX: c0008d94 EBX: c1ff6240 ECX: 00000163 EDX: 7e000000
> ESI: 00000154 EDI: 00000055 EBP: f5cdbf10 ESP: f5cdbef8
>  DS: 007b ES: 007b FS: 00d8 GS: 0000 SS: 0068
> Process kksmd (pid: 343, ti=f5cda000 task=f617b140 task.ti=f5cda000)
> Stack:
>  7fa12163 fffff000 c204efbc f50479e8 9eb7e000 c08a34d0 f5cdbf18 c041f07a
>  f5cdbf28 c048339c 00000000 f5c271e0 f5cdbf30 c04833bc f5cdbfb0 c0483b0d
>  f5cdbf50 c0425845 00000000 00000064 00000009 c08a34d0 f5cdbfb0 c06384c1
> Call Trace:
>  [<c041f07a>] ? kmap_atomic+0x13/0x15
>  [<c048339c>] ? get_pte+0x50/0x63
>  [<c04833bc>] ? is_present_pte+0xd/0x1f
>  [<c0483b0d>] ? ksm_scan_start+0x9a/0x7ac
>  [<c0425845>] ? finish_task_switch+0x29/0xa4
>  [<c06384c1>] ? schedule+0x6bf/0x719
>  [<c041b3fc>] ? default_spin_lock_flags+0x8/0xc
>  [<c043bffa>] ? finish_wait+0x49/0x4e
>  [<c04845f4>] ? kthread_ksm_scan_thread+0x0/0xdc
>  [<c048462e>] ? kthread_ksm_scan_thread+0x3a/0xdc
>  [<c043bf31>] ? autoremove_wake_function+0x0/0x38
>  [<c043be3e>] ? kthread+0x40/0x66
>  [<c043bdfe>] ? kthread+0x0/0x66
>  [<c0404997>] ? kernel_thread_helper+0x7/0x10
> Code: 86 00 00 00 64 a1 04 a0 82 c0 6b c0 0d 8d 3c 30 a1 78 b0 77 c0
> 8d 34 bd 00 00 00 00 89 45 ec a1 0c d0 84 c0 29 f0 83 38 00 74 04 <0f>
> 0b eb fe c1 ea 1a 8b 04 d5 80 32 8a c0 83 e0 fc 29 c3 c1 fb
> EIP: [<c041eff9>] kmap_atomic_prot+0x7d/0xeb SS:ESP 0068:f5cdbef8
> Kernel panic - not syncing: Fatal exception
> == END of OOPS
>   


[-- Attachment #2: fix_32highmem --]
[-- Type: text/plain, Size: 271 bytes --]

diff --git a/mm/ksm.c b/mm/ksm.c
index 707be52..e14448a 100644
--- a/mm/ksm.c
+++ b/mm/ksm.c
@@ -562,6 +562,7 @@ static pte_t *get_pte(struct mm_struct *mm, unsigned long addr)
 		goto out;
 
 	ptep = pte_offset_map(pmd, addr);
+	pte_unmap(ptep);
 out:
 	return ptep;
 }

  reply	other threads:[~2008-11-20  9:03 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-17  2:20 [PATCH 0/4] ksm - dynamic page sharing driver for linux v2 Izik Eidus
2008-11-17  2:20 ` [PATCH 1/4] Rmap: Add page_wrprotect() function Izik Eidus
2008-11-17  2:20   ` [PATCH 2/4] Add replace_page(): change the page pte is pointing to Izik Eidus
2008-11-17  2:20     ` [PATCH 3/4] add ksm kernel shared memory driver Izik Eidus
2008-11-17  2:20       ` [PATCH 4/4] MMU_NOTIFIRES: add set_pte_at_notify() Izik Eidus
2008-11-28 16:58       ` [PATCH 3/4] add ksm kernel shared memory driver Alan Cox
2008-12-02 18:07         ` Chris Wright
2008-12-02 18:13           ` Alan Cox
2008-12-02 21:24             ` Chris Wright
2008-12-02 21:37               ` Jonathan Corbet
2008-12-02 22:10               ` Alan Cox
2008-12-03 14:33                 ` Pavel Machek
2008-12-04  9:48                   ` Alan Cox
2008-11-20  7:44 ` [PATCH 0/4] ksm - dynamic page sharing driver for linux v2 Ryota OZAKI
2008-11-20  9:03   ` Izik Eidus [this message]
2008-11-20  9:13     ` Izik Eidus
2008-11-20  9:44       ` Ryota OZAKI
2008-11-28 12:57 ` Dmitri Monakhov
2008-11-28 13:51   ` Alan Cox
  -- strict thread matches above, loose matches on Subject: below --
2009-04-04 14:35 Izik Eidus
2009-04-06  7:04 ` Nick Piggin
2009-04-06  7:33   ` Avi Kivity
2009-04-06 11:19   ` Izik Eidus
2009-04-06 13:42   ` Andrea Arcangeli
2009-04-07 13:57 ` Andrea Arcangeli

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=492527DF.1080602@redhat.com \
    --to=ieidus@redhat.com \
    --cc=aarcange@redhat.com \
    --cc=akpm@linux-foundation.org \
    --cc=avi@redhat.com \
    --cc=chrisw@redhat.com \
    --cc=cl@linux-foundation.org \
    --cc=corbet@lwn.net \
    --cc=dlaor@redhat.com \
    --cc=kamezawa.hiroyu@jp.fujitsu.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=ozaki.ryota@gmail.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 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).