[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20100513120739.GA2348@linux.vnet.ibm.com>
Date: Thu, 13 May 2010 17:37:39 +0530
From: Srikar Dronamraju <srikar@...ux.vnet.ibm.com>
To: Peter Zijlstra <peterz@...radead.org>
Cc: Ingo Molnar <mingo@...e.hu>,
Masami Hiramatsu <mhiramat@...hat.com>,
Mel Gorman <mel@....ul.ie>,
Randy Dunlap <rdunlap@...otime.net>,
Linus Torvalds <torvalds@...ux-foundation.org>,
Roland McGrath <roland@...hat.com>,
"H. Peter Anvin" <hpa@...or.com>,
Ananth N Mavinakayanahalli <ananth@...ibm.com>,
Oleg Nesterov <oleg@...hat.com>,
Mark Wielaard <mjw@...hat.com>,
Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
LKML <linux-kernel@...r.kernel.org>,
Jim Keniston <jkenisto@...ux.vnet.ibm.com>,
Frederic Weisbecker <fweisbec@...il.com>,
"Frank Ch. Eigler" <fche@...hat.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Andrea Arcangeli <aarcange@...hat.com>,
Hugh Dickins <hugh.dickins@...cali.co.uk>,
Rik van Riel <riel@...hat.com>,
"Paul E. McKenney" <paulmck@...ux.vnet.ibm.com>
Subject: Re: [PATCH v3 0/10] Uprobes v3
>
> Hrmm, you could do something like the above and use write_protect_page()
> along with that lock_page() you do to sync against concurrent faults. It
> won't be the fastest code around but it should work I guess.
Okay, thanks for the code.
>
> Something like try_to_merge_one_page() in the KSM code:
>
> write_opcode(struct mm_struct *mm, unsigned long address, void *insn,
> int len)
> {
> down_read(mm->mmap_sem);
[ snipped]
>
> kunmap_atomic(vaddr_new);
> kunmap_atomic(vaddr_old);
>
> /* XXX: frob mlock state */
I think you are referring to mlock_vma_page() and munlock_vma_page that
we have in try_to_merge_one_page(). However mlock_vma_page and
munlock_vma_page are not exposed outside mm as they are declared inside
mm/internal.h. So do you suggest moving the declarations out of
mm/internal.h or have a wrapper function defined in mm/ that could be
used by both KSM and uprobes.
>
> /* flip pages, do_wp_page() will fail pte_same() and bail */
> err = replace_page(vma, new_page, old_page, orig_pte)
> if (err) goto fail_more;
>
> /* we're done, let 'em rip */
> unlock_page(old_page);
> put_page(old_page);
>
> return;
>
> fail:
> /* XXX: fixup stuff */
> }
>
> Note that this can fail for fun reasons like O_DIRECT IO, but that
> should be very rare indeed on text pages.
>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists