linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: david singleton <dsingleton@mvista.com>
To: Andrew Morton <akpm@osdl.org>
Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org
Subject: Re: new procfs memory analysis feature
Date: Thu, 7 Dec 2006 17:53:06 -0800	[thread overview]
Message-ID: <df54053fca85900fab7864e0f05ed2c8@mvista.com> (raw)
In-Reply-To: <20061207174627.63300ccf.akpm@osdl.org>

On Dec 7, 2006, at 5:46 PM, Andrew Morton wrote:

> On Thu, 7 Dec 2006 17:07:22 -0800
> david singleton <dsingleton@mvista.com> wrote:
>
>> Attached is the 2.6.19 patch.
>
> It still has the overflow bug.
>> +       do {
>> +               ptent = *pte;
>> +               if (pte_present(ptent)) {
>> +                       page = vm_normal_page(vma, addr, ptent);
>> +                       if (page) {
>> +                               if (pte_dirty(ptent))
>> +                                       mapcount = 
>> -page_mapcount(page);
>> +                               else
>> +                                       mapcount = 
>> page_mapcount(page);
>> +                       } else {
>> +                               mapcount = 1;
>> +                       }
>> +               }
>> +               seq_printf(m, " %d", mapcount);
>> +
>> +       } while (pte++, addr += PAGE_SIZE, addr != end);
>
> Well that's cute.  As long as both seq_file and pte-pages are of size
> PAGE_SIZE, and as long as pte's are more than three bytes, this will 
> not
> overflow the seq_file output buffer.
>
> hm.  Unless the pages are all dirty and the mapcounts are all 10000.  I
> think it will overflow then?
>

I guess that could happen?    Any suggestions?

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2006-12-08  1:53 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <45789124.1070207@mvista.com>
2006-12-07 22:36 ` Andrew Morton
2006-12-08  0:30   ` david singleton
2006-12-08  1:07   ` david singleton
2006-12-08  1:46     ` Andrew Morton
2006-12-08  1:53       ` david singleton [this message]
2006-12-08  6:21   ` Paul Cameron Davies
2006-12-08 21:46     ` Jeremy Fitzhardinge
2006-12-11  2:19       ` Paul Cameron Davies
2006-12-11  8:13 Albert Cahalan
2006-12-12  1:15 ` Joe Green

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=df54053fca85900fab7864e0f05ed2c8@mvista.com \
    --to=dsingleton@mvista.com \
    --cc=akpm@osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.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