Re: Linux kernel, possible useless continue
- From: Rainer Weikusat <rainer.weikusat@xxxxxxxxx>
- Date: Mon, 19 Mar 2007 12:44:16 +0100
Ulrich Eckhardt <doomster@xxxxxxxx> writes:
Bin Chen wrote:
Below code I am curious in (A)'s continue will bring flow to (B) but
from (B) to (A) no code updates the value of both pfn and max_low_pfn.
So the condition of 'if' will always true. Is it useless?
Yes it is useless.
It is not, see below.
(B) for (; pgd_idx < PTRS_PER_PGD; pgd++, pgd_idx++) {
pmd = one_md_table_init(pgd);
if (pfn >= max_low_pfn)
(A) continue;
[...]
Other than that, Iwo Mergler's comment that one_md_table_init() is called
with the next index indeed applies,
And this routine is documented by the following comment (and the code,
of course):
/*
* Creates a middle page table and puts a pointer to it in the
* given global directory entry. This only returns the gd entry
* in non-PAE compilation mode, since the middle layer is folded.
*/
Which means that the loop in questions populates all of the pmd (if a
pmd is in use) and maps at most max_low_pfn pages of memory directly
for use by the kernel.
.
- Follow-Ups:
- Re: Linux kernel, possible useless continue
- From: Ulrich Eckhardt
- Re: Linux kernel, possible useless continue
- References:
- Linux kernel, possible useless continue
- From: Bin Chen
- Re: Linux kernel, possible useless continue
- From: Ulrich Eckhardt
- Linux kernel, possible useless continue
- Prev by Date: Re: Linux kernel, possible useless continue
- Next by Date: Re: Adding a new OSI layer
- Previous by thread: Re: Linux kernel, possible useless continue
- Next by thread: Re: Linux kernel, possible useless continue
- Index(es):