public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Is it possible to use 8K page size on a i386 pc?
@ 2002-08-27 18:50 chen, xiangping
  2002-08-27 19:19 ` Richard B. Johnson
  2002-08-28  0:27 ` Daniel Phillips
  0 siblings, 2 replies; 8+ messages in thread
From: chen, xiangping @ 2002-08-27 18:50 UTC (permalink / raw)
  To: 'Alan Cox'; +Cc: Linux Kernel Mailing List

Hi,

I just wonder how PAGE_SIZE in determined in each architecture? Is it
possible to use 8k or bigger page size in a i386 PC?

Thanks,

Xiangping

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Is it possible to use 8K page size on a i386 pc?
       [not found] <mailman.1030474690.4302.linux-kernel2news@redhat.com>
@ 2002-08-27 19:14 ` Pete Zaitcev
  2002-08-28  0:06   ` H. Peter Anvin
  0 siblings, 1 reply; 8+ messages in thread
From: Pete Zaitcev @ 2002-08-27 19:14 UTC (permalink / raw)
  To: chen, xiangping; +Cc: linux-kernel

>[...]
> I just wonder how PAGE_SIZE in determined in each architecture? Is it
> possible to use 8k or bigger page size in a i386 PC?
> 
> Thanks,
> Xiangping

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.

Running a bigger page size does nothing to help your TLB
coverage, but it might improve paging performance (or
it might not).

-- Pete

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Is it possible to use 8K page size on a i386 pc?
  2002-08-27 18:50 chen, xiangping
@ 2002-08-27 19:19 ` Richard B. Johnson
  2002-08-28  0:27 ` Daniel Phillips
  1 sibling, 0 replies; 8+ messages in thread
From: Richard B. Johnson @ 2002-08-27 19:19 UTC (permalink / raw)
  To: chen, xiangping; +Cc: 'Alan Cox', Linux Kernel Mailing List

On Tue, 27 Aug 2002, chen, xiangping wrote:

> Hi,
> 
> I just wonder how PAGE_SIZE in determined in each architecture? Is it
> possible to use 8k or bigger page size in a i386 PC?
> 
> Thanks,
> 
> Xiangping

It's hardware; "Because both the virtual pages in the linear
address space and the physical pages of memory are aligned to
4k page boundaries, there is no need to modify the low 12
bits of the address. These 12 bits pass straight through the
paging hardware, whether paging is enabled or not...."


Cheers,
Dick Johnson
Penguin : Linux version 2.4.18 on an i686 machine (797.90 BogoMips).
The US military has given us many words, FUBAR, SNAFU, now ENRON.
Yes, top management were graduates of West Point and Annapolis.


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Is it possible to use 8K page size on a i386 pc?
  2002-08-27 19:14 ` Is it possible to use 8K page size on a i386 pc? Pete Zaitcev
@ 2002-08-28  0:06   ` H. Peter Anvin
  0 siblings, 0 replies; 8+ messages in thread
From: H. Peter Anvin @ 2002-08-28  0:06 UTC (permalink / raw)
  To: linux-kernel

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 :)

	-hpa
-- 
<hpa@transmeta.com> at work, <hpa@zytor.com> in private!
"Unix gives you enough rope to shoot yourself in the foot."
http://www.zytor.com/~hpa/puzzle.txt	<amsp@zytor.com>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* RE: Is it possible to use 8K page size on a i386 pc?
@ 2002-08-28  0:19 Luck, Tony
  2002-08-28  0:26 ` H. Peter Anvin
  0 siblings, 1 reply; 8+ messages in thread
From: Luck, Tony @ 2002-08-28  0:19 UTC (permalink / raw)
  To: 'H. Peter Anvin', linux-kernel

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

-Tony

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Is it possible to use 8K page size on a i386 pc?
  2002-08-28  0:19 Luck, Tony
@ 2002-08-28  0:26 ` H. Peter Anvin
  2002-09-10 16:34   ` Eric W. Biederman
  0 siblings, 1 reply; 8+ messages in thread
From: H. Peter Anvin @ 2002-08-28  0:26 UTC (permalink / raw)
  To: Luck, Tony; +Cc: linux-kernel

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.

	-hpa



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Is it possible to use 8K page size on a i386 pc?
  2002-08-27 18:50 chen, xiangping
  2002-08-27 19:19 ` Richard B. Johnson
@ 2002-08-28  0:27 ` Daniel Phillips
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Phillips @ 2002-08-28  0:27 UTC (permalink / raw)
  To: chen, xiangping, 'Alan Cox'; +Cc: Linux Kernel Mailing List

On Tuesday 27 August 2002 20:50, chen, xiangping wrote:
> Hi,
> 
> I just wonder how PAGE_SIZE in determined in each architecture? Is it
> possible to use 8k or bigger page size in a i386 PC?

Hi,

It's possible, but we haven't gotten around to implementing it yet ;-)

-- 
Daniel

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: Is it possible to use 8K page size on a i386 pc?
  2002-08-28  0:26 ` H. Peter Anvin
@ 2002-09-10 16:34   ` Eric W. Biederman
  0 siblings, 0 replies; 8+ messages in thread
From: Eric W. Biederman @ 2002-09-10 16:34 UTC (permalink / raw)
  To: H. Peter Anvin; +Cc: Luck, Tony, linux-kernel

"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

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2002-09-10 16:43 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <mailman.1030474690.4302.linux-kernel2news@redhat.com>
2002-08-27 19:14 ` Is it possible to use 8K page size on a i386 pc? Pete Zaitcev
2002-08-28  0:06   ` H. Peter Anvin
2002-08-28  0:19 Luck, Tony
2002-08-28  0:26 ` H. Peter Anvin
2002-09-10 16:34   ` Eric W. Biederman
  -- 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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox