[techtalk] free_one_pmd: bad directory entry 00000020

tsemba at menanet.net tsemba at menanet.net
Sat Jan 20 21:20:22 EST 2001


----- Original Message -----
From: "Shawn Strout" <sstrout at nc.rr.com>
Date: Sunday, January 21, 2001 4:26 am
Subject: RE: [techtalk] free_one_pmd: bad directory entry 00000020 

> Could you please be more specific? IANAKH (I Am Not A Kernel 
> Hacker). What
> is a NULL in this context and what kind of "directory" is it? I 
> thought it
> referred to the disk, but it sounds like you're saying it's a RAM 
> problem.
> It is happening frequently - sometimes several in a second and 
> sometimes 10
> minutes between. It is always in the same address, 00000020.

I'm not a kernel hacker either but looking at the kernel source at
src/mm/memory.c. As far as I understand:
When process execute execve() system call the kernel calls 
clear_page_table() to clear the page tables of the calling process
which in turn iteratively calls free_one_pgd() which iteratively
calls free_one_pmd() to clear individual page table entry. So the
new process can start with memory of its callee cleared.

The function pmd_bad() is responsible for what that message you
get (look at the source of free_one_pmd). The definition for
pmd_bad can be found in include/asm-i386/pgtable.h. As far as
I understand it's checking for the presence of these bits in page
entry:
_PAGE_PRESENT | _PAGE_RW | _PAGE_ACCESSED | _PAGE_DIRTY
Unfortunately as I said I'm not a kernel hacker so I don't follow
exactly what does that has to do with a bad page !

<some-explaination>

Excerpts from Kernel Hackers Guide sec. 5:
   Each process has a page directory which means it can access 1 KB of 
page
tables pointing to 1 MB of 4 KB pages which is 4 GB of memory. A 
process' page
directory is initialized during a fork by copy_page_tables().

This is called three-level page table.

The memory in 80386 looks like:

.__________.    ._______.       ._______.
| Proc Mem |--->|_______|------>|_______|----->virtual
`----------'    |       |       |       |      page
                |       |       |       |       |
                |_______|       |       |       |
                |_______|       |       |       V
                  .....           .....         (3)
                |_______|       |_______|
                    |               |
                    |               |
                    |               |
                    V               V
                    (1)             (2)


(1) Process page directory of 1024 entries each entry pointing to a page
table of 1024 entries to memory pages (each page is 4 KB) thus leading
to 4 X 1024 X 1024 = 4 GB.

(2) Page table contains 1024 virtual page entries.

(3) Virtual page entry to get map to physical page in RAM.

</some-explaination>

May be like the other gentleman said it's a memory defect, try removing
some memory modules. For better explanation refer to the kernel mailing
list.

Hope it help.

--
Tamer Embaby <tsemba at menanet.net|http://tsemba.tripod.com>

" Sometimes it's better to die not to give up in life. "
--





More information about the Techtalk mailing list