From: Izik Eidus <ieidus@redhat.com>
To: Hugh Dickins <hugh.dickins@tiscali.co.uk>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH 0/3] ksm: write protect pages from inside ksm
Date: Mon, 15 Jun 2009 03:05:14 +0300 [thread overview]
Message-ID: <4A35903A.3090508@redhat.com> (raw)
In-Reply-To: <4A358DA7.2080305@redhat.com>
Izik Eidus wrote:
> Izik Eidus wrote:
>> Hugh Dickins wrote:
>>> On Sat, 13 Jun 2009, Izik Eidus wrote:
>>>
>>>> Hugh, so untill here we are sync,
>>>>
>>>
>>> Yes, that fits with what I have here, thanks (or where it didn't
>>> quite fit, e.g. ' versus `, I've adjusted to what you have!). And
>>> thanks for fixing my *orig_pte = *ptep bug, you did point that out
>>> before, but I misunderstood at first.
>>>
>>>
>>>> Question is what you want me to do now?,
>>>> (Beacuse we are skipping 2.6.31, It is ok to you to tell me something
>>>> like: "Shut up and let me see what i can get with this madvise" -
>>>> that from one side.
>>>> From another side if you want me to do anything please say.
>>>>
>>>
>>> I had to get a bit further at my end before answering on that,
>>> but now the answer is clear: please do some testing of your RFC
>>> madvise() version (which is what I'm just tidying up a little),
>>> and let me know any bugfixes you find. Try with SLAB or SLUB or
>>> SLQB debug on e.g. CONFIG_SLUB=y, CONFIG_SLUB_DEBUG=y and boot
>>> option "slub_debug".
>>>
>>
>> Sure, let me check it.
>> (You do have Andrea patch that fix the "used after free slab entries" ?)
>
> How fast is it crush opps to you?, I compiled it and ran it here on
> 2.6.30-rc4-mm1 with:
> "Enable SLQB debugging support" and "SLQB debugging on by default, and
> it run and merge (i am using qemu processes to run virtual machines to
> merge the pages between them)
>
> ("SLQB debugging on by defaul" mean i dont have to add boot pareameter
> right?)
>
> Maybe i should try update into newer version of the mm tree? (last
> commit here is Jul 22)
OK, bug on my side, just got that oppss, will try to fix and send patch.
(Sorry for the noise)
>
>>
>>> I'm finding, whether with your RFC or my tidyup, that kksmd
>>> soon oopses in get_next_mmlist (or perhaps find_vma): presumably
>>> accessing a vma or mm which already got freed (if you don't have
>>> slab debugging on, it's liable to hang instead).
>>>
>>> (I've also not seen it actually merging yet: if you register
>>> or madvise a large anon area and memset it, the /dev/ksm version
>>> would merge all its pages, but I've not seen the madvise version
>>> do so yet - though maybe there's something stupidly wrong in my
>>> testing, really I'm more worried about the oopses at present.)
>>>
>>> Note that mmotm includes a patch of Nick's which adds a function
>>> madvise_behavior_valid() - you'll need to add your MADVs into its
>>> list to get it to work at all there.
>>>
>>> Here's a patch I added a month or so ago, when trying to experiment
>>> with KSM on all mms: shouldn't be necessary if your mm refcounting
>>> is right, but might help to avoid extra weirdness when things go
>>> wrong: exit_mmap() leaves stale vma pointers around, reckoning
>>> that nobody can be interested by now; but maybe KSM might peep
>>> so better to tidy them up at least while debugging...
>>>
>>> Thanks,
>>> Hugh
>>>
>>> --- old/mm/mmap.c 2009-05-01 13:47:45.000000000 +0100
>>> +++ new/mm/mmap.c 2009-05-03 11:34:47.000000000 +0100
>>> @@ -2112,6 +2112,14 @@ void exit_mmap(struct mm_struct *mm)
>>> tlb_finish_mmu(tlb, 0, end);
>>>
>>> /*
>>> + * Make sure get_user_pages() and find_vma() etc. will find
>>> nothing:
>>> + * this may be necessary for KSM.
>>> + */
>>> + mm->mmap = NULL;
>>> + mm->mmap_cache = NULL;
>>> + mm->mm_rb = RB_ROOT;
>>> +
>>> + /*
>>> * Walk the list again, actually closing and freeing it,
>>> * with preemption enabled, without holding any MM locks.
>>> */
>>>
>>
>>
>
>
next prev parent reply other threads:[~2009-06-15 0:05 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-12 21:44 [PATCH 0/3] ksm: write protect pages from inside ksm Izik Eidus
2009-06-12 21:44 ` [PATCH 1/3] ksm: remove ksm from being a module Izik Eidus
2009-06-12 21:44 ` [PATCH 2/3] ksm: remove page_wrprotect() from rmap.c Izik Eidus
2009-06-12 21:45 ` [PATCH 3/3] withdraw ksm-add-page_wrprotect-write-protecting-page.patch Izik Eidus
2009-06-14 21:47 ` [PATCH 0/3] ksm: write protect pages from inside ksm Hugh Dickins
2009-06-14 22:16 ` Izik Eidus
2009-06-14 23:54 ` Izik Eidus
2009-06-15 0:05 ` Izik Eidus [this message]
2009-06-15 0:57 ` Izik Eidus
2009-06-15 12:23 ` Hugh Dickins
2009-06-15 13:51 ` Izik Eidus
2009-06-15 15:53 ` Hugh Dickins
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=4A35903A.3090508@redhat.com \
--to=ieidus@redhat.com \
--cc=hugh.dickins@tiscali.co.uk \
--cc=linux-kernel@vger.kernel.org \
/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