All of lore.kernel.org
 help / color / mirror / Atom feed
From: Marcelo Tosatti <marcelo.tosatti@cyclades.com>
To: Mauricio Lin <mauriciolin@gmail.com>
Cc: Andrew Morton <akpm@osdl.org>,
	Mauricio Lin <mauricio.lin@indt.org.br>,
	linux-kernel@vger.kernel.org,
	Nick Piggin <piggin@cyberone.com.au>
Subject: Re: [PATCH] A new entry for /proc
Date: Mon, 17 Jan 2005 15:30:23 -0200	[thread overview]
Message-ID: <20050117173023.GA22202@logos.cnet> (raw)
In-Reply-To: <3f250c71050117110241dfc46c@mail.gmail.com>


Hi Mauricio,

On Mon, Jan 17, 2005 at 03:02:14PM -0400, Mauricio Lin wrote:
> Hi Andrew,
> 
> I figured out the error. This patch works for others editors as well.

<snip>

> diff -uprN linux-2.6.10/fs/proc/task_mmu.c linux-2.6.10-smaps/fs/proc/task_mmu.c
> --- linux-2.6.10/fs/proc/task_mmu.c	2004-12-24 17:34:01.000000000 -0400
> +++ linux-2.6.10-smaps/fs/proc/task_mmu.c	2005-01-17 14:55:17.000000000 -0400
> @@ -81,6 +81,76 @@ static int show_map(struct seq_file *m, 
>  	return 0;
>  }
>  
> +static void resident_mem_size(struct mm_struct *mm,
> +			      unsigned long start_address,
> +			      unsigned long end_address,
> +			      unsigned long *size)
> +{
> +	pgd_t *pgd;
> +	pmd_t *pmd;
> +	pte_t *ptep, pte;
> +	unsigned long each_page;
> +
> +	for (each_page = start_address; each_page < end_address; 
> +	     each_page += PAGE_SIZE) {
> +		pgd = pgd_offset(mm, each_page);
> +		if (pgd_none(*pgd) || unlikely(pgd_bad(*pgd)))
> +			continue;
> +
> +		pmd = pmd_offset(pgd, each_page);
> +
> +		if (pmd_none(*pmd))
> +			continue;
> +
> +		if (unlikely(pmd_bad(*pmd)))
> +			continue;
> +
> +		if (pmd_present(*pmd)) {
> +			ptep = pte_offset_map(pmd, each_page);
> +			if (!ptep)
> +				continue;
> +			pte = *ptep;
> +			pte_unmap(ptep);
> +			if (pte_present(pte))
> +				*size += PAGE_SIZE;
> +		}
> +	}
> +}

You want to update your patch to handle the new 4level pagetables which introduces
a new indirection table: the PUD. 

Check 2.6.11-rc1 - mm/rmap.c.

BTW: What does PUD stand for?





  reply	other threads:[~2005-01-17 20:38 UTC|newest]

Thread overview: 38+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-01-06 21:11 [PATCH] A new entry for /proc Mauricio Lin
2005-01-07  4:23 ` Andrew Morton
2005-01-07 12:30   ` Roger Luethi
2005-01-08 20:20   ` Hugh Dickins
2005-01-08 21:47     ` Alan Cox
2005-01-10  9:21     ` Edjard Souza Mota
2005-01-10 15:23     ` Mauricio Lin
2005-02-22 13:13     ` Mauricio Lin
2005-02-24  8:31       ` Mauricio Lin
2005-02-24  9:09         ` Andrew Morton
2005-02-24 11:43           ` Mauricio Lin
2005-02-24 11:52             ` Andrew Morton
2005-02-25 15:14               ` Mauricio Lin
2005-02-28  9:43                 ` Mauricio Lin
2005-02-28  9:56                   ` Mauricio Lin
2005-02-28 20:41                     ` Hugh Dickins
2005-03-01  8:08                       ` Mauricio Lin
2005-03-01 14:17                         ` Mauricio Lin
2005-03-01 15:44                           ` Mauricio Lin
2005-03-02 12:20                             ` Mauricio Lin
2005-03-02 19:07                               ` Hugh Dickins
2005-03-03  7:25                                 ` Mauricio Lin
2005-03-03 12:48                                   ` Hugh Dickins
2005-03-03 14:23                                     ` Mauricio Lin
2005-01-10 14:35   ` Mauricio Lin
2005-01-14 22:46   ` Mauricio Lin
     [not found]     ` <20050114154209.6b712e55.akpm@osdl.org>
2005-01-17 18:03       ` Mauricio Lin
2005-01-17 19:02         ` Mauricio Lin
2005-01-17 17:30           ` Marcelo Tosatti [this message]
2005-01-17 21:27             ` Mauricio Lin
2005-01-17 21:35             ` William Lee Irwin III
2005-01-18  1:07               ` Nick Piggin
2005-01-19 12:59                 ` Nick Piggin
2005-01-24 22:14             ` Mauricio Lin
2005-04-29 18:36   ` Mauricio Lin
2005-04-30  1:25     ` Andrew Morton
  -- strict thread matches above, loose matches on Subject: below --
2005-02-24 18:56 Albert Cahalan
2005-03-01 14:32 ` Mauricio Lin

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=20050117173023.GA22202@logos.cnet \
    --to=marcelo.tosatti@cyclades.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mauricio.lin@indt.org.br \
    --cc=mauriciolin@gmail.com \
    --cc=piggin@cyberone.com.au \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.