Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754766AbYKTJOw (ORCPT ); Thu, 20 Nov 2008 04:14:52 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1753780AbYKTJOV (ORCPT ); Thu, 20 Nov 2008 04:14:21 -0500 Received: from mx2.redhat.com ([66.187.237.31]:37326 "EHLO mx2.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753468AbYKTJOS (ORCPT ); Thu, 20 Nov 2008 04:14:18 -0500 Message-ID: <49252A54.6010602@redhat.com> Date: Thu, 20 Nov 2008 11:13:56 +0200 From: Izik Eidus User-Agent: Thunderbird 2.0.0.17 (Windows/20080914) MIME-Version: 1.0 To: Ryota OZAKI 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 References: <1226888432-3662-1-git-send-email-ieidus@redhat.com> <5e93dcec0811192344l3813867egcc6b5a3c666142b9@mail.gmail.com> <492527DF.1080602@redhat.com> In-Reply-To: <492527DF.1080602@redhat.com> Content-Type: multipart/mixed; boundary="------------090500050002060706000102" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2210 Lines: 77 This is a multi-part message in MIME format. --------------090500050002060706000102 Content-Type: text/plain; charset=windows-1255; format=flowed Content-Transfer-Encoding: 8bit ????? 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 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 > Thinking about what i just did, it is wrong, this patch is the right one (still wasnt tested), but if you are going to apply something then use this one. thanks --------------090500050002060706000102 Content-Type: text/plain; name="fix_highmem_2" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="fix_highmem_2" diff --git a/mm/ksm.c b/mm/ksm.c index 707be52..c842c29 100644 --- a/mm/ksm.c +++ b/mm/ksm.c @@ -569,14 +569,16 @@ out: static int is_present_pte(struct mm_struct *mm, unsigned long addr) { pte_t *ptep; + int r; ptep = get_pte(mm, addr); if (!ptep) return 0; - if (pte_present(*ptep)) - return 1; - return 0; + r = pte_present(*ptep); + pte_unmap(ptep); + + return r; } #define PAGEHASH_LEN 128 @@ -669,6 +671,7 @@ static int try_to_merge_one_page(struct mm_struct *mm, if (!orig_ptep) goto out_unlock; orig_pte = *orig_ptep; + pte_unmap(orig_ptep); if (!pte_present(orig_pte)) goto out_unlock; if (page_to_pfn(oldpage) != pte_pfn(orig_pte)) --------------090500050002060706000102-- -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/