[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: page->offset



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

>         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.

> 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.

> If I do read () from 1024 offset the data I will get will be from the
above
> 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 majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux.eu.org/Linux-MM/