Skip to contentSkip to conversation

alloc_pages and struct page *

DISCUSSION Olivier Galibert 2 participants 2 messages Apr 19, 2005

lore
Share & tools
lore
#0 lore raw

If I get a struct page * from a call to alloc_pages with a non-zero order, how do I get the struct page * of te following pages from the same allocation in order to use them in calls to tcp_sendpage?

If there a documentation somewhere whcih would answer this kind of questions? Couldn't find anything pertinent in Documentation/*.

OG.

#1 lore raw
Quoted 3 lines · Olivier Galibert

If I get a struct page * from a call to alloc_pages with a non-zero order, how do I get the struct page * of te following pages from the same allocation in order to use them in calls to tcp_sendpage?

page++;

The page structures are kept in an array, "mem_map" if CONFIG_DISCONTIGMEM is not set or something like "discontig_node_data[nid].node_mem_map" otherwise (this is true for the ARM architecture, should be similar on the others). "alloc_pages" allocates a contiguous range of pages from an array (and doesn't cross a node boundary).

Signature · 1 line
Catalin