Say we have a struct page from the address space of the cached page file.
How can we get the starting physical address of the 4KB data from this struct page ?
I assume that inside the struct sk_buff should be something like a data pointer, but I did not find it.
EDIT
Thanks to Mat and llya for the answers.
After looking at the answers, I think the first problem is to determine if the struct page in ZONE_NORMAL or ZONE_HIGHMEM .
During file I / O, when we do not find the cached page, we will first select a new page using page_cache_alloc_cold() . page_cache_alloc_cold() will finally call alloc_pages() , which seems to use ZONE_HIGHMEM (which, in x86, is the kernel memory area starting at PAGE_OFFSET + 896M) for its work.
So,
- I think Mat answer is suitable for pages in
ZONE_NORMAL - Suppose we use
kmap() to find the source physical address of the 4 KB data associated with the page structure, should we use (unsigned long)(&page)-PAGE_OFFSET to find the physical address where the structure itself is stored?
Please correct.
sliter
source share