public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: ebiederm@xmission.com (Eric W. Biederman)
To: "H. Peter Anvin" <hpa@zytor.com>
Cc: "Luck, Tony" <tony.luck@intel.com>, linux-kernel@vger.kernel.org
Subject: Re: Is it possible to use 8K page size on a i386 pc?
Date: 10 Sep 2002 10:34:12 -0600	[thread overview]
Message-ID: <m1lm69olbv.fsf@frodo.biederman.org> (raw)
In-Reply-To: <3D6C189D.7080101@zytor.com>

"H. Peter Anvin" <hpa@zytor.com> writes:

> Luck, Tony wrote:
> > H. Peter Anvin wrote:
> > 
> >>Followup to:  <200208271914.g7RJEQE07821@devserv.devel.redhat.com>
> >>By author:    Pete Zaitcev <zaitcev@redhat.com>
> >>In newsgroup: linux.dev.kernel
> >>
> >>>You may run into trouble with something that calls mmap with
> >>>a fixed address, with executables which have text sizes of
> >>>odd number of small pages. I was told that these problems are
> >>>fairly rare.
> >>
> >>Only 50% of all binaries are affected... that's fairly rare :)
> > 
> > The majority of x86 linux binaries run on ia64 with a 16K
> > pagesize (admittedly with some not-so-pretty code to fudge
> > mmap/munmap addresses ... but it is proof that you can reduce
> > the problems to "fairly rare").
> > 
> 
> It's proof that you can kluge around it.  Part of the issue is with the
> handling of the code versus data segment, which means you have to treat
> (part of) the code segment as data.
> 
> Changing the i386 port to use > 4K pages would have to go through
> similar contortions.

In particular the sysv ABI for i386 specifies a 4K page size be
supported.

The alpha ABI (which planned for page size changes) specifies all data
in binaries must be 64K aligned.  Despite initially shipping with
something smaller.  This issue is particularly important to demand
paging. 

The classic work around is to just read the entire binary into memory
and don't worry about sharing pages.  Which is an effective way to support
old a.out binaries, that had 1K alignments.

The case of mmap(MAP_FIXED) without the proper alignment can only
fail.  And of course libc would need to be updated so that
getpagesize() returns the appropriate page size.

But be very clear that anything that changes the externally visible
page size is an ABI change, and best avoided.

But note it should be possible to grow he kernels internal page size
without making it externally visible.  And allow mappings of partial
pages.  So far it has been more trouble than it is worth.

Eric

  reply	other threads:[~2002-09-10 16:43 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-08-28  0:19 Is it possible to use 8K page size on a i386 pc? Luck, Tony
2002-08-28  0:26 ` H. Peter Anvin
2002-09-10 16:34   ` Eric W. Biederman [this message]
     [not found] <mailman.1030474690.4302.linux-kernel2news@redhat.com>
2002-08-27 19:14 ` Pete Zaitcev
2002-08-28  0:06   ` H. Peter Anvin
  -- strict thread matches above, loose matches on Subject: below --
2002-08-27 18:50 chen, xiangping
2002-08-27 19:19 ` Richard B. Johnson
2002-08-28  0:27 ` Daniel Phillips

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=m1lm69olbv.fsf@frodo.biederman.org \
    --to=ebiederm@xmission.com \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=tony.luck@intel.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