lkml.org 
[lkml]   [2001]   [Mar]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Subjectlinux/mm/memory.c [ void clear_page_tables(...); ] question...
Date
Function taked from: linux/mm/memory.c

void clear_page_tables(struct mm_struct *mm, unsigned long first, int nr) {
pgd_t * page_dir = mm->pgd;

if (page_dir && page_dir != swapper_pg_dir) {
page_dir += first;
do {
free_one_pgd(page_dir);
page_dir++;
} while (--nr);

/* keep the page table cache within bounds */
check_pgt_cache();
}
}

Hello:
I'm trying to understand the code, and sorry if this is a stupid question.
Here in this function you check if mm->pgd is the swapper_pg_dir if it's you
don't clear it, but then you increment page_dir++ in the loop and you don't
check if
page_dir != swapper_pg_dir ...why? may be when you increment page_dir it
can't become swapper_pg_dir because swapper_pg_dir is always <= page_dir?..
or is something else?

Thanks in advance

Eliel Sardanons

-
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: 2005-03-22 13:17    [from the cache]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and my Meterkast|Read the blog