From: Ed L Cashin <ecashin@uga.edu>
To: "Kuas (gmane)" <ku4s@users.sourceforge.net>
Cc: linux-mm@kvack.org
Subject: Re: Page Mapping
Date: Mon, 19 Apr 2004 11:26:53 -0400 [thread overview]
Message-ID: <87n058ng3m.fsf@uga.edu> (raw)
In-Reply-To: <407171E4.4020002@users.sourceforge.net> ("Kuas's message of "Mon, 05 Apr 2004 10:49:08 -0400")
"Kuas (gmane)" <ku4s@users.sourceforge.net> writes:
> Sorry, please ignore some of the previous question.
>
> I found the answer in Intel Developer guide v3. 'pte_t' consists of
> the base physical address of the page (20 MSB of pte_t) and page flags
> (12 LSB of pte_t). So to get the address, I just have to mask the
> pte_t with PAGE_MASK.
>
> Now the next question is can I just use that address and refer to it
> right away? Like using a pointer? Or I still have to use some MMU
> mechanism?
No, it's a physical address. Normally, pointers inside the kernel
contain virtual addresses, and the MMU will translate them into
physical addresses automatically.
If you know the page is present in RAM and you want to access the
contents of the page, you can convert it to a virtual address and then
use that address. There's the "phys_to_virt" function that you can
use.
> And I don't see anywhere in the page struct to know how big is the
> page filled? I don't think every page has all 4 KB filled, right? Or
> are all the pages zeroed out before being reassigned? So I still can
> read the whole page, just the last bytes will be 0x00 if it's not used.
I think that anonymous pages are usually set up copy-on-write from the
ZERO_PAGE. They'll be all zero in parts of the page that haven't been
modified.
--
--Ed L Cashin | PGP public key:
ecashin@uga.edu | http://noserose.net/e/pgp/
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"aart@kvack.org"> aart@kvack.org </a>
next prev parent reply other threads:[~2004-04-19 15:26 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-04-05 2:57 Kuas (gmane)
2004-04-05 14:49 ` Kuas (gmane)
2004-04-19 15:26 ` Ed L Cashin [this message]
2004-04-19 15:58 ` Ed L Cashin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87n058ng3m.fsf@uga.edu \
--to=ecashin@uga.edu \
--cc=ku4s@users.sourceforge.net \
--cc=linux-mm@kvack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox