From: Matti Aarnio <matti.aarnio@sonera.fi>
To: pnilesh@in.ibm.com
Cc: linux-mm@kvack.org
Subject: Re: page->offset
Date: Thu, 13 Apr 2000 09:07:46 +0300 [thread overview]
Message-ID: <20000413090746.R13396@mea.tmt.tele.fi> (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
On Thu, Apr 13, 2000 at 10:23:03AM +0530, pnilesh@in.ibm.com wrote:
> I think I had put up the question in a wrong way.
>
> If I mmap a file from/at a particular offset.
> char *p;
> fd = open("anyfile");
> p = mmap (NULL,100,PROT_READ|PROT_WRITE, MAP_SHARED,fd,10);
>
> Here the call fails .
> I tried to map at / from offset 512 that also failed.
> however with the offset of 1024 it succeded.
>
> So I can not mmap anything which is not fs block size aligned .
Actually you should not be able to map anything which is
not MACHINE PAGE SIZE aligned -- not map shared, that is.
It is somewhat accidental that 2.2 allows FS block size
alignment. A MAP_PRIVATE may allow other offsets.
In 2.4 the 'page->offset' field is gone, and it is known
as 'page->index', which is scaled version of offset value.
Scaled with PAGE SIZE.
Reason for going to this has been (among others) to get
coherency into the page cache so that there won't be
differently aligned copies of same byte range in the memory.
> Nilesh
/Matti Aarnio
--
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/
next prev parent reply other threads:[~2000-04-13 6:07 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 ` Matti Aarnio [this message]
2000-04-13 19:34 ` page->offset Andrea Arcangeli
2000-04-13 9:59 ` page->offset Stephen C. Tweedie
-- 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=20000413090746.R13396@mea.tmt.tele.fi \
--to=matti.aarnio@sonera.fi \
--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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox