linux/mm/memory.c [ void clear_page_tables(...); ] question...

From: Sardaņons, Eliel (Eliel.Sardanons@philips.edu.ar)
Date: Tue Mar 27 2001 - 09:54:55 EST


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/



This archive was generated by hypermail 2b29 : Sat Mar 31 2001 - 21:00:16 EST