lkml.org 
[lkml]   [2006]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: new procfs memory analysis feature
Date

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 from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-12-08 02:55    [W:0.025 / U:7.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site