<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Kernel memory page size in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374143#M196142</link>
    <description>Ted,&lt;BR /&gt; &lt;BR /&gt;rest assured, not remotely.&lt;BR /&gt; &lt;BR /&gt;I was just curious to learn more about HP-UX Kernel innards.&lt;BR /&gt;I've even come accross an excellent book from HP (whose title I cannot recall) about the nitty gritty of kernel structs, memory management etc.&lt;BR /&gt;Unfortunately, there's always too little time to read (and hopefully remember) these more in-depth coverages on HP-UX&lt;BR /&gt;(Besides we're also blessed (or cursed) with other HW platforms and server OS's such as AIX, Solaris, Linux, OpenBSD etc., of which there is also so much to get known)</description>
    <pubDate>Thu, 09 Sep 2004 02:30:34 GMT</pubDate>
    <dc:creator>Ralph Grothe</dc:creator>
    <dc:date>2004-09-09T02:30:34Z</dc:date>
    <item>
      <title>Kernel memory page size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374136#M196135</link>
      <description>I know this has been already many times asked and answered.&lt;BR /&gt;Unfortunately I at the moment cannot query the knowledge base, that's why I post this once again, sorry.&lt;BR /&gt; &lt;BR /&gt;kmtune reports 4 KB page size.&lt;BR /&gt;The unistd.h header file has a deviating (to my understanding) preprocessor macro definition.&lt;BR /&gt;How come?&lt;BR /&gt;  &lt;BR /&gt;# uname -srv;getconf KERNEL_BITS&lt;BR /&gt;HP-UX B.11.00 U&lt;BR /&gt;64&lt;BR /&gt; &lt;BR /&gt;# grep _SC_PAGE_SIZE /usr/include/sys/unistd.h &lt;BR /&gt;#  define _SC_PAGE_SIZE        3001 /* PAGE_SIZE: Software page size */&lt;BR /&gt;#  define _SC_PAGESIZE               _SC_PAGE_SIZE&lt;BR /&gt; &lt;BR /&gt;# kmtune -lq vps_pagesize&lt;BR /&gt;Parameter:      vps_pagesize        &lt;BR /&gt;Value:          4                                                           &lt;BR /&gt;Default:        4                                                           &lt;BR /&gt;Minimum:        -                                                           &lt;BR /&gt;Module:         -                             &lt;BR /&gt;</description>
      <pubDate>Wed, 08 Sep 2004 03:05:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374136#M196135</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2004-09-08T03:05:04Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel memory page size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374137#M196136</link>
      <description>Hi Ralph,&lt;BR /&gt;&lt;BR /&gt;_SC_PAGE_SIZE is used to call sysconf to&lt;BR /&gt;get the current pagesize.&lt;BR /&gt;&lt;BR /&gt;## more m.c&lt;BR /&gt;#include &lt;UNISTD.H&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;  printf ("PAGESIZE= %ld\n",sysconf(_SC_PAGE_SIZE));&lt;BR /&gt;}&lt;BR /&gt; cc m.c -o m&lt;BR /&gt;./usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (m.o) was detected. The linked output may not run on a PA 1.x system.&lt;BR /&gt;# ./m&lt;BR /&gt;PAGESIZE= 4096&lt;BR /&gt;&lt;/UNISTD.H&gt;</description>
      <pubDate>Wed, 08 Sep 2004 03:14:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374137#M196136</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2004-09-08T03:14:23Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel memory page size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374138#M196137</link>
      <description>Hi Ralph,&lt;BR /&gt;&lt;BR /&gt;_SC_PAGE_SIZE is used to call sysconf to&lt;BR /&gt;get the current pagesize.&lt;BR /&gt;&lt;BR /&gt;## more m.c&lt;BR /&gt;#include &lt;UNISTD.H&gt;&lt;BR /&gt;main()&lt;BR /&gt;{&lt;BR /&gt;  printf ("PAGESIZE= %ld\n",sysconf(_SC_PAGE_SIZE));&lt;BR /&gt;}&lt;BR /&gt; cc m.c -o m&lt;BR /&gt;./usr/ccs/bin/ld: (Warning) At least one PA 2.0 object file (m.o) was detected. The linked output may not run on a PA 1.x system.&lt;BR /&gt;# ./m&lt;BR /&gt;PAGESIZE= 4096&lt;BR /&gt;# getconf PAGE_SIZE&lt;BR /&gt;4096&lt;BR /&gt;&lt;/UNISTD.H&gt;</description>
      <pubDate>Wed, 08 Sep 2004 03:15:07 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374138#M196137</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2004-09-08T03:15:07Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel memory page size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374139#M196138</link>
      <description>Laurent,&lt;BR /&gt; &lt;BR /&gt;yes, I should have found out myself by looking at the manpages of sysconf() syscall and the getconf utility.&lt;BR /&gt;However, now I've come accross yet another oddity, i.e. the _SC_CLK_TCK&lt;BR /&gt;I also compiled your little C snippet&lt;BR /&gt; &lt;BR /&gt;$ cat psize.c&lt;BR /&gt;#include &lt;SYS&gt;&lt;BR /&gt;int main(void) {&lt;BR /&gt;    printf("Pagesize=%u\n", sysconf(_SC_PAGE_SIZE));&lt;BR /&gt;    printf("Clockticks=%u\n", sysconf(_SC_CLK_TCK));&lt;BR /&gt;    return(0);&lt;BR /&gt;}&lt;BR /&gt; &lt;BR /&gt;$ ./psize                                                       &lt;BR /&gt;Pagesize=4096&lt;BR /&gt;Clockticks=100&lt;BR /&gt; &lt;BR /&gt;However when I query the kernel I get another clock speed displayed&lt;BR /&gt; &lt;BR /&gt;$ echo itick_per_usec/D|su root -c "adb /stand/vmunix /dev/kmem"&lt;BR /&gt;Password: &lt;BR /&gt;Error from elf64_getehdr(application core file)&lt;BR /&gt;Not an Elf file: No Elf header&lt;BR /&gt;itick_per_usec:&lt;BR /&gt;itick_per_usec: 440&lt;BR /&gt; &lt;BR /&gt;Any explanation?&lt;BR /&gt; &lt;BR /&gt;To my relieve I can even use Perl for those queries.&lt;BR /&gt; &lt;BR /&gt;$ perl -MPOSIX -e 'printf"Clockticks=%u\n",POSIX::sysconf(POSIX::_SC_CLK_TCK)'&lt;BR /&gt;Clockticks=100&lt;BR /&gt;&lt;/SYS&gt;</description>
      <pubDate>Wed, 08 Sep 2004 03:43:41 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374139#M196138</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2004-09-08T03:43:41Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel memory page size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374140#M196139</link>
      <description>&amp;gt; $ ./psize&lt;BR /&gt;&amp;gt; Pagesize=4096&lt;BR /&gt;&amp;gt; Clockticks=100&lt;BR /&gt;This means 100 ticks/sec&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;However when I query the kernel I get another clock speed displayed&lt;BR /&gt;&lt;BR /&gt;&amp;gt; $ echo itick_per_usec/D| adb /stand/vmunix /dev/kmem&lt;BR /&gt;&amp;gt; itick_per_usec:&lt;BR /&gt;&amp;gt; itick_per_usec: 440&lt;BR /&gt;&lt;BR /&gt;&amp;gt; Any explanation?&lt;BR /&gt;iticks_per_usec is the number of cpu cycles per microsec.&lt;BR /&gt;This means you have a 440Mhz cpu.&lt;BR /&gt;iticks are relative to itimer - register CR16 of the cpu-&lt;BR /&gt;&lt;BR /&gt;To my relieve I can even use Perl for those queries.&lt;BR /&gt;&lt;BR /&gt;$ perl -MPOSIX -e 'printf"Clockticks=%u\n",POSIX::sysconf(POSIX::_SC_CLK_TCK)'&lt;BR /&gt;Clockticks=100</description>
      <pubDate>Wed, 08 Sep 2004 05:02:22 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374140#M196139</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2004-09-08T05:02:22Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel memory page size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374141#M196140</link>
      <description>Besides the _SC_PAGE_SIZE stuff (answered above) -- you're also misinterpreting the vps_pagesize tunable. That does not control the base page size of the system (which is what _SC_PAGE_SIZE reports). The underlying base page size is entirely a combination of what the architecture supports and the kernel is written to use.&lt;BR /&gt;&lt;BR /&gt;What vps_pagesize controls is (with vps_ceiling) the hint to the kernel of what virtual page size (aka large page) to give to users by default. If you use chatr on the binary to specify a page size, it is ignored.. otherwise the kernel makes a "best guess" based on the system configuration and the object size being created. That guess is then checked to be between (inclusively) vps_pagesize [minimum] and vps_ceiling [maximum] and adjusted appropriately.&lt;BR /&gt;&lt;BR /&gt;So if you want your applications to get 16k large pages as much as possible by default -- you'd adjust vps_pagesize to 16. If you know that you'll be setting up large but sparse virtual ranges you might want to lower vps_ceiling to make sure the kernel doesn't give you 64k (or 16k or whatnot) pages when you touch that one byte.&lt;BR /&gt;&lt;BR /&gt;There are man pages for both tunables on docs.hp.com (look under 11.11 -- that information should be relevant for 11.0).&lt;BR /&gt;For later releases, the man pages are on the system.</description>
      <pubDate>Wed, 08 Sep 2004 09:00:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374141#M196140</guid>
      <dc:creator>Don Morris_1</dc:creator>
      <dc:date>2004-09-08T09:00:48Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel memory page size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374142#M196141</link>
      <description>You do NOT want to alter the kernel page size.  You can play with performance optimized page sizes for applications, particularily if you create them yourself.</description>
      <pubDate>Wed, 08 Sep 2004 20:18:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374142#M196141</guid>
      <dc:creator>Ted Buis</dc:creator>
      <dc:date>2004-09-08T20:18:40Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel memory page size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374143#M196142</link>
      <description>Ted,&lt;BR /&gt; &lt;BR /&gt;rest assured, not remotely.&lt;BR /&gt; &lt;BR /&gt;I was just curious to learn more about HP-UX Kernel innards.&lt;BR /&gt;I've even come accross an excellent book from HP (whose title I cannot recall) about the nitty gritty of kernel structs, memory management etc.&lt;BR /&gt;Unfortunately, there's always too little time to read (and hopefully remember) these more in-depth coverages on HP-UX&lt;BR /&gt;(Besides we're also blessed (or cursed) with other HW platforms and server OS's such as AIX, Solaris, Linux, OpenBSD etc., of which there is also so much to get known)</description>
      <pubDate>Thu, 09 Sep 2004 02:30:34 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374143#M196142</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2004-09-09T02:30:34Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel memory page size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374144#M196143</link>
      <description>The best book I have seen is "hp-ux 11i internals" by Chris Cooper and Chris Moore.  I also like the book by Robert Sauers on "hp-ux 11i tuning and performance" which is now the second edition.  I really think that the kernel page size should be expanded, but I will wait patiently for the hp kernel experts to do that work.</description>
      <pubDate>Thu, 09 Sep 2004 08:03:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374144#M196143</guid>
      <dc:creator>Ted Buis</dc:creator>
      <dc:date>2004-09-09T08:03:53Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel memory page size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374145#M196144</link>
      <description>Ted,&lt;BR /&gt; &lt;BR /&gt;that was the title I had a chance to browse through in our local technical bookstore.&lt;BR /&gt;But because of lack of time (the content at least looked quite demanding) I couldn't decide on buying a copy.</description>
      <pubDate>Thu, 09 Sep 2004 08:17:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374145#M196144</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2004-09-09T08:17:13Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel memory page size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374146#M196145</link>
      <description>Ralph,&lt;BR /&gt;&lt;BR /&gt;To be honest, much of it is beyond my real level of interest and ability to absorb.  However, I have gained some insights that I didn't have before, and when I finish it I expect to have a few more.  It has a good discussion on the paging system, including psuedo-swap.  According to the book, vps_pagesize is the parameter that sets the base page size and defaults to 4Kbytes.  It seems that the vps_cieling and vps_chatr_cieling are more reasonable to change.  "The page size is determined by a 5-bit field in the htbl/pdir entry.  The current implemented sizes range from 1 to 256K page frames (each progressively larger size is 4X the previous small size)."</description>
      <pubDate>Thu, 09 Sep 2004 08:57:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374146#M196145</guid>
      <dc:creator>Ted Buis</dc:creator>
      <dc:date>2004-09-09T08:57:24Z</dc:date>
    </item>
    <item>
      <title>Re: Kernel memory page size</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374147#M196146</link>
      <description>We can get it with dmesg too as,&lt;BR /&gt;&lt;BR /&gt;dmesg | grep -iE 'Memory|Physical'&lt;BR /&gt;&lt;BR /&gt;It will give informations about Physical page size and memory there.&lt;BR /&gt;&lt;BR /&gt;It is updated there too.</description>
      <pubDate>Thu, 09 Sep 2004 09:49:27 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/kernel-memory-page-size/m-p/3374147#M196146</guid>
      <dc:creator>Muthukumar_5</dc:creator>
      <dc:date>2004-09-09T09:49:27Z</dc:date>
    </item>
  </channel>
</rss>

