Skip to contentSkip to conversation

page->offset

DISCUSSION [email protected] 1 participant 1 message Apr 13, 2000 Memory management

lore
Share & tools
lore
#0 lore raw

Odd, it should't. Which kernel is this?
cat /proc/version shows 2.2.5-15

Quoted 2 lines
        char *p = mmap (NULL,10,PROT_READ,MAP_SHARED,fd,1024);
        char *s = mmap (NULL,10,PROT_READ,MAP_SHARED,fd,1024);

strace shows:

old_mmap(NULL, 10, PROT_READ, MAP_SHARED, 3, 0x400) = -1 EINVAL (Invalid
argument)
old_mmap(NULL, 10, PROT_READ, MAP_SHARED, 3, 0x400) = -1 EINVAL (Invalid
argument)

on a 1k blocksize filesystem.

Quoted 3 lines

Does these virtual addresses point to only one physical page ? This page is in the page cache if I am not wrong with page->count = 3 ? (2.2.x)

Correct.

Quoted 1 line

If I do read () from 1024 offset the data I will get will be from the

above

Quoted 1 line

phyiscal page or from .... ?

read() _always_ invokes the page cache with pagesize-aligned page offsets. If a correctly aligned page is not present, a new one will be created.

Nilesh

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/