* kernel page size explanation
@ 2005-07-21 23:31 Gaspar Bakos
2005-07-22 1:20 ` Jesper Juhl
0 siblings, 1 reply; 10+ messages in thread
From: Gaspar Bakos @ 2005-07-21 23:31 UTC (permalink / raw)
To: linux-kernel
Hi,
Sorry for this nursery-school question.
Could someone briefly explain me :
1. what is the kernel page size (any _useful_ pointer on the web is fine),
2. how can one tune it (for 2.6.*)?
3. what kind of effect does it have on system performance, if it is
tuneable, and if it worth changing this at all?
I am a bit confused; at one place i see someone saying that the kernel
page size is 4kb for i386.
At another place I see a statement:
"I tried all four possible page sizes on Itanium (4k, 8k, 16k and 64k)"
How can i figure out the page size of the kernel i am currently using?
Cheers
Gaspar
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kernel page size explanation
2005-07-21 23:31 kernel page size explanation Gaspar Bakos
@ 2005-07-22 1:20 ` Jesper Juhl
2005-07-23 22:09 ` Gaspar Bakos
2005-07-24 18:37 ` Nix
0 siblings, 2 replies; 10+ messages in thread
From: Jesper Juhl @ 2005-07-22 1:20 UTC (permalink / raw)
To: gbakos; +Cc: linux-kernel
On 7/22/05, Gaspar Bakos <gbakos@cfa.harvard.edu> wrote:
> Hi,
>
> Sorry for this nursery-school question.
>
> Could someone briefly explain me :
> 1. what is the kernel page size (any _useful_ pointer on the web is fine),
Depends on arch. Take a look at PAGE_SIZE and PAGE_SHIFT - look in
include/asm-*/page.h
Here's a nice web interface for browsing the source and quickly
finding the info you need :) : http://lxr.linux.no/ident?i=PAGE_SIZE
> 2. how can one tune it (for 2.6.*)?
For some archs the page size can be set at compile-time with
CONFIG_PAGE_SIZE_4KB, CONFIG_PAGE_SIZE_8KB etc - mips is an example of
such an arch (also take a look at CONFIG_HUGETLB_PAGE and friends).
> 3. what kind of effect does it have on system performance, if it is
> tuneable, and if it worth changing this at all?
>
Depends on your workload.
> I am a bit confused; at one place i see someone saying that the kernel
> page size is 4kb for i386.
> At another place I see a statement:
> "I tried all four possible page sizes on Itanium (4k, 8k, 16k and 64k)"
>
That makes perfect sense - i386 uses a 4K page size, ia64 is one of
the archs that support different page sizes (via
CONFIG_IA64_PAGE_SIZE_* ).
some i386 machines can also use 4MB pages IIRC, but I don't think
Linux lets you configure that for i386, but I'm not entirely sure.
> How can i figure out the page size of the kernel i am currently using?
>
You can
A) look in the .config file for your current kernel (if your arch
supports different page sizes at all).
B) You can use the getpagesize(2) syscall at runtime. getpagesize()
returns the nr of bytes in a page - man getpagesize - I'm not sure
that's universally supported though.
C) You can look at /proc/cpuinfo or /proc/meminfo , IIRC some archs
report page size there - not quite sure, can't remember...
--
Jesper Juhl <jesper.juhl@gmail.com>
Don't top-post http://www.catb.org/~esr/jargon/html/T/top-post.html
Plain text mails only, please http://www.expita.com/nomime.html
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kernel page size explanation
2005-07-22 1:20 ` Jesper Juhl
@ 2005-07-23 22:09 ` Gaspar Bakos
2005-07-24 18:37 ` Nix
1 sibling, 0 replies; 10+ messages in thread
From: Gaspar Bakos @ 2005-07-23 22:09 UTC (permalink / raw)
To: Jesper Juhl; +Cc: linux-kernel
Hi, Jesper,
RE:
> > 2. how can one tune it (for 2.6.*)?
>
> For some archs the page size can be set at compile-time with
> CONFIG_PAGE_SIZE_4KB, CONFIG_PAGE_SIZE_8KB etc - mips is an example of
> such an arch (also take a look at CONFIG_HUGETLB_PAGE and friends).
OK, now i figured it out. On AMD opteron 64 bit processors the only
option is the default: 4Kb. For itanium and mips, indeed, there are
multiple options. My CPUs are opteron 64 bit ones; that is why i was
not able to find this feature (of tuning it).
> > How can i figure out the page size of the kernel i am currently using?
> >
> You can
> A) look in the .config file for your current kernel (if your arch
> supports different page sizes at all).
Not there.
> C) You can look at /proc/cpuinfo or /proc/meminfo , IIRC some archs
> report page size there - not quite sure, can't remember...
Probably not in meminfo, but possibly in cpuinfo:
cat /proc/cpuinfo
...
TLB size : 1024 4K pages
...
cat /proc/meminfo
MemTotal: 4010956 kB
MemFree: 3848060 kB
Buffers: 0 kB
Cached: 45696 kB
SwapCached: 0 kB
Active: 90432 kB
Inactive: 4820 kB
HighTotal: 0 kB
HighFree: 0 kB
LowTotal: 4010956 kB
LowFree: 3848060 kB
SwapTotal: 7823576 kB
SwapFree: 7823352 kB
Dirty: 20 kB
Writeback: 0 kB
Mapped: 78668 kB
Slab: 46216 kB
CommitLimit: 9829052 kB
Committed_AS: 142036 kB
PageTables: 3252 kB
VmallocTotal: 34359738367 kB
VmallocUsed: 5724 kB
VmallocChunk: 34359732179 kB
HugePages_Total: 0
HugePages_Free: 0
Hugepagesize: 2048 kB
Cheers
Gaspar
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kernel page size explanation
2005-07-22 1:20 ` Jesper Juhl
2005-07-23 22:09 ` Gaspar Bakos
@ 2005-07-24 18:37 ` Nix
2005-07-24 19:01 ` VASM
1 sibling, 1 reply; 10+ messages in thread
From: Nix @ 2005-07-24 18:37 UTC (permalink / raw)
To: Jesper Juhl; +Cc: gbakos, linux-kernel
On 22 Jul 2005, Jesper Juhl suggested tentatively:
> You can
> A) look in the .config file for your current kernel (if your arch
> supports different page sizes at all).
> B) You can use the getpagesize(2) syscall at runtime. getpagesize()
> returns the nr of bytes in a page - man getpagesize - I'm not sure
> that's universally supported though.
> C) You can look at /proc/cpuinfo or /proc/meminfo , IIRC some archs
> report page size there - not quite sure, can't remember...
D) getconf PAGE_SIZE should work, although what it does on arches
with variable page sizes isn't clear to me.
--
`But of course, GR is the very best relativity for the masses.'
--- Wayne Throop
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kernel page size explanation
2005-07-24 18:37 ` Nix
@ 2005-07-24 19:01 ` VASM
2005-07-24 19:24 ` Fawad Lateef
2005-07-24 21:28 ` Nix
0 siblings, 2 replies; 10+ messages in thread
From: VASM @ 2005-07-24 19:01 UTC (permalink / raw)
To: Nix; +Cc: Jesper Juhl, gbakos, linux-kernel
i had one question
does the linux kernel support only one default page size even if the
processor on which it is working supports multiple ?
On 7/25/05, Nix <nix@esperi.org.uk> wrote:
> On 22 Jul 2005, Jesper Juhl suggested tentatively:
> > You can
> > A) look in the .config file for your current kernel (if your arch
> > supports different page sizes at all).
> > B) You can use the getpagesize(2) syscall at runtime. getpagesize()
> > returns the nr of bytes in a page - man getpagesize - I'm not sure
> > that's universally supported though.
> > C) You can look at /proc/cpuinfo or /proc/meminfo , IIRC some archs
> > report page size there - not quite sure, can't remember...
>
> D) getconf PAGE_SIZE should work, although what it does on arches
> with variable page sizes isn't clear to me.
>
> --
> `But of course, GR is the very best relativity for the masses.'
> --- Wayne Throop
> -
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kernel page size explanation
2005-07-24 19:01 ` VASM
@ 2005-07-24 19:24 ` Fawad Lateef
2005-07-24 21:28 ` Nix
1 sibling, 0 replies; 10+ messages in thread
From: Fawad Lateef @ 2005-07-24 19:24 UTC (permalink / raw)
To: VASM; +Cc: linux-kernel
On 7/25/05, VASM <vasm85@gmail.com> wrote:
> i had one question
> does the linux kernel support only one default page size even if the
> processor on which it is working supports multiple ?
>
The PAGE_SIZE depends on the architecture and it do supports different
page_sizes depending on the architecture (AFAIK for almost all
supported architectures)
--
Fawad Lateef
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kernel page size explanation
2005-07-24 19:01 ` VASM
2005-07-24 19:24 ` Fawad Lateef
@ 2005-07-24 21:28 ` Nix
2005-07-25 13:42 ` VASM
1 sibling, 1 reply; 10+ messages in thread
From: Nix @ 2005-07-24 21:28 UTC (permalink / raw)
To: VASM; +Cc: Jesper Juhl, gbakos, linux-kernel
On Mon, 25 Jul 2005, VASM wrote:
> i had one question
> does the linux kernel support only one default page size even if the
> processor on which it is working supports multiple ?
No. Some architectures have compile-time support for multiple different
page sizes (e.g. Itanium, SPARC64); many have support for a
(non-swappable) `large pages) system, and a filesystem backed by huge
pages. (Often, the kernel is stored in huge pages, to keep the number
of page table entries wasted by the nonswappable kernel to a minimum.)
What is *not* presently supported is using multiple page sizes to
back userspace processes; that size is currently fixed at compile-time,
even on architectures supporting multiple variably-sized pages.
--
`But of course, GR is the very best relativity for the masses.'
--- Wayne Throop
^ permalink raw reply [flat|nested] 10+ messages in thread
* Re: kernel page size explanation
2005-07-24 21:28 ` Nix
@ 2005-07-25 13:42 ` VASM
2005-07-25 15:03 ` Valdis.Kletnieks
0 siblings, 1 reply; 10+ messages in thread
From: VASM @ 2005-07-25 13:42 UTC (permalink / raw)
To: Nix; +Cc: Jesper Juhl, gbakos, linux-kernel
On 7/25/05, Nix <nix@esperi.org.uk> wrote:
> On Mon, 25 Jul 2005, VASM wrote:
> > i had one question
> > does the linux kernel support only one default page size even if the
> > processor on which it is working supports multiple ?
>
> No. Some architectures have compile-time support for multiple different
> page sizes (e.g. Itanium, SPARC64); many have support for a
> (non-swappable) `large pages) system, and a filesystem backed by huge
> pages. (Often, the kernel is stored in huge pages, to keep the number
> of page table entries wasted by the nonswappable kernel to a minimum.)
>
> What is *not* presently supported is using multiple page sizes to
> back userspace processes; that size is currently fixed at compile-time,
> even on architectures supporting multiple variably-sized pages.
>
are there any specific reasons for not using large page size for
userspace processes
> --
> `But of course, GR is the very best relativity for the masses.'
> --- Wayne Throop
>
^ permalink raw reply [flat|nested] 10+ messages in thread
[parent not found: <4sSO3-58H-13@gated-at.bofh.it>]
* Re: kernel page size explanation
[not found] <4sSO3-58H-13@gated-at.bofh.it>
@ 2005-07-22 0:15 ` Robert Hancock
0 siblings, 0 replies; 10+ messages in thread
From: Robert Hancock @ 2005-07-22 0:15 UTC (permalink / raw)
To: linux-kernel
Gaspar Bakos wrote:
> Hi,
>
> Sorry for this nursery-school question.
>
> Could someone briefly explain me :
> 1. what is the kernel page size (any _useful_ pointer on the web is fine),
> 2. how can one tune it (for 2.6.*)?
> 3. what kind of effect does it have on system performance, if it is
> tuneable, and if it worth changing this at all?
This is dependent on the hardware, not really the OS. On x86 the
normally used page size is 4KB. 4MB pages are also supported but are
usually used only for special purposes (ex: hugetlbfs).
As you mentioned some other architectures like Itanium support different
page sizes.
--
Robert Hancock Saskatoon, SK, Canada
To email, remove "nospam" from hancockr@nospamshaw.ca
Home Page: http://www.roberthancock.com/
^ permalink raw reply [flat|nested] 10+ messages in thread
end of thread, other threads:[~2005-07-25 15:03 UTC | newest]
Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2005-07-21 23:31 kernel page size explanation Gaspar Bakos
2005-07-22 1:20 ` Jesper Juhl
2005-07-23 22:09 ` Gaspar Bakos
2005-07-24 18:37 ` Nix
2005-07-24 19:01 ` VASM
2005-07-24 19:24 ` Fawad Lateef
2005-07-24 21:28 ` Nix
2005-07-25 13:42 ` VASM
2005-07-25 15:03 ` Valdis.Kletnieks
[not found] <4sSO3-58H-13@gated-at.bofh.it>
2005-07-22 0:15 ` Robert Hancock
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox