public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Prasanna S Panchamukhi <prasanna@in.ibm.com>
To: Nick Piggin <nickpiggin@yahoo.com.au>
Cc: Andrew Morton <akpm@osdl.org>,
	ak@suse.de, davem@davemloft.net, suparna@in.ibm.com,
	richardj_moore@uk.ibm.com, linux-kernel@vger.kernel.org
Subject: Re: [3/3 PATCH] Kprobes: User space probes support- single stepping out-of-line
Date: Mon, 20 Mar 2006 19:22:24 +0530	[thread overview]
Message-ID: <20060320135223.GA18975@in.ibm.com> (raw)
In-Reply-To: <441E92D8.4070309@yahoo.com.au>

On Mon, Mar 20, 2006 at 10:32:40PM +1100, Nick Piggin wrote:
> Andrew Morton wrote:
> >Prasanna S Panchamukhi <prasanna@in.ibm.com> wrote:
> 
> >>+
> >>+/**
> >>+ * This routines get the pte of the page containing the specified 
> >>address.
> >>+ */
> >>+static pte_t  __kprobes *get_uprobe_pte(unsigned long address)
> >>+{
> >>+	pgd_t *pgd;
> >>+	pud_t *pud;
> >>+	pmd_t *pmd;
> >>+	pte_t *pte = NULL;
> >>+
> >>+	pgd = pgd_offset(current->mm, address);
> >>+	if (!pgd)
> >>+		goto out;
> >>+
> >>+	pud = pud_offset(pgd, address);
> >>+	if (!pud)
> >>+		goto out;
> >>+
> >>+	pmd = pmd_offset(pud, address);
> >>+	if (!pmd)
> >>+		goto out;
> >>+
> >>+	pte = pte_alloc_map(current->mm, pmd, address);
> >>+
> >>+out:
> >>+	return pte;
> >>+}
> >
> >
> >That's familiar looking code..
> >
> >I guess this should be given a more generic name then placed in
> >mm/memory.c, which is where we do pagetable walking.
> >
> 
> Apart from this, there looks like quite a bit of other mm code
> that has been crammed into everywhere but mm/ (yes this has
> happened before, but it shouldn't be encouraged in new code).
> 
> For this specific example, I'm not sure that a function returning
> a pointer to a pte is a good idea to be exporting. I'd like to see
> some good reasons why things like get_user_pages, find_*_page, and
> other standard APIs can't be used. Then you can list those reasons
> in an individual patch to add your required API to mm/. This can
> be more easily reviewed by people who aren't as good at wading
> through code as Andrew.
> 
> Also, adding your own mm code outside core files really makes
> things hard to maintain and audit when somebody would like to
> change anything.
> 

Nick,

I will send out a separate patch to add this piece of code with proper
comments.

Thanks
Prasanna
> -- 
> SUSE Labs, Novell Inc.
> Send instant messages to your online friends http://au.messenger.yahoo.com 

-- 
Prasanna S Panchamukhi
Linux Technology Center
India Software Labs, IBM Bangalore
Email: prasanna@in.ibm.com
Ph: 91-80-51776329

  reply	other threads:[~2006-03-20 13:52 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-20  6:07 [0/3] Kprobes: User space probes support Prasanna S Panchamukhi
2006-03-20  6:09 ` [1/3 PATCH] Kprobes: User space probes support- base interface Prasanna S Panchamukhi
2006-03-20  6:10   ` [2/3 PATCH] Kprobes: User space probes support- readpage hooks Prasanna S Panchamukhi
2006-03-20  6:11     ` [3/3 PATCH] Kprobes: User space probes support- single stepping out-of-line Prasanna S Panchamukhi
2006-03-20 11:09       ` Andrew Morton
2006-03-20 11:24         ` Arjan van de Ven
2006-03-20 14:05           ` Prasanna S Panchamukhi
2006-03-20 14:13             ` Arjan van de Ven
2006-03-20 11:32         ` Nick Piggin
2006-03-20 13:52           ` Prasanna S Panchamukhi [this message]
2006-03-20 13:48         ` Prasanna S Panchamukhi
2006-03-20 20:40           ` Andrew Morton
2006-03-21  2:02             ` Prasanna S Panchamukhi
2006-03-21 10:05               ` Andrew Morton
2006-03-21 11:05                 ` Richard J Moore
2006-03-21 11:13                 ` Suparna Bhattacharya
2006-03-21 12:23                 ` Prasanna S Panchamukhi
2006-03-20 10:53     ` [2/3 PATCH] Kprobes: User space probes support- readpage hooks Andrew Morton
2006-03-20 13:48       ` Prasanna S Panchamukhi
2006-03-21  2:12         ` Andrew Morton
2006-03-21  9:14           ` Richard J Moore
2006-03-21 11:14             ` Christoph Hellwig
2006-03-21 11:38               ` Richard J Moore
2006-03-21 12:40               ` Theodore Ts'o
2006-03-21 11:28           ` Christoph Hellwig
2006-03-21 11:42             ` Richard J Moore
2006-03-21 12:15               ` Christoph Hellwig
2006-03-21 16:17                 ` Richard J Moore
2006-03-20 11:10     ` Andrew Morton
2006-03-20 13:59       ` Prasanna S Panchamukhi
2006-03-20 10:42   ` [1/3 PATCH] Kprobes: User space probes support- base interface Andrew Morton
2006-03-20 13:48     ` Prasanna S Panchamukhi
2006-03-21 11:39 ` [0/3] Kprobes: User space probes support Christoph Hellwig

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=20060320135223.GA18975@in.ibm.com \
    --to=prasanna@in.ibm.com \
    --cc=ak@suse.de \
    --cc=akpm@osdl.org \
    --cc=davem@davemloft.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nickpiggin@yahoo.com.au \
    --cc=richardj_moore@uk.ibm.com \
    --cc=suparna@in.ibm.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