All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Stephen C. Tweedie" <sct@redhat.com>
To: pnilesh@in.ibm.com
Cc: linux-mm@kvack.org
Subject: Re: page->offset
Date: Thu, 13 Apr 2000 10:59:06 +0100	[thread overview]
Message-ID: <20000413105906.D11123@redhat.com> (raw)
In-Reply-To: <CA2568C0.001B9300.00@d73mta05.au.ibm.com>; from pnilesh@in.ibm.com on Thu, Apr 13, 2000 at 10:23:03AM +0530

Hi,

On Thu, Apr 13, 2000 at 10:23:03AM +0530, pnilesh@in.ibm.com wrote:
> 
> Here the call fails .
> I tried to map at / from offset 512 that also failed.
> however with the offset of 1024 it succeded.

Odd, it shouldn't.  Which kernel is this?

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

--Stephen
--
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/

  parent reply	other threads:[~2000-04-13  9:59 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2000-04-13  4:53 page->offset pnilesh
2000-04-13  6:07 ` page->offset Matti Aarnio
2000-04-13 19:34   ` page->offset Andrea Arcangeli
2000-04-13  9:59 ` Stephen C. Tweedie [this message]
  -- strict thread matches above, loose matches on Subject: below --
2000-04-13 11:19 page->offset pnilesh
2000-04-12 13:04 page->offset pnilesh
2000-04-12 14:45 ` page->offset Stephen C. Tweedie
2000-04-12 15:29 ` page->offset Eric W. Biederman
2000-04-12 10:07 page->offset pnilesh
2000-04-12 11:06 ` page->offset Stephen C. Tweedie

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=20000413105906.D11123@redhat.com \
    --to=sct@redhat.com \
    --cc=linux-mm@kvack.org \
    --cc=pnilesh@in.ibm.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.