From owner-freebsd-hackers@freebsd.org Sun Mar 20 12:33:02 2016 Return-Path: Delivered-To: freebsd-hackers@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 5036EAD4D12 for ; Sun, 20 Mar 2016 12:33:02 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id D377934F for ; Sun, 20 Mar 2016 12:33:01 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from tom.home (kostik@localhost [127.0.0.1]) by kib.kiev.ua (8.15.2/8.15.2) with ESMTPS id u2KCWuUg000564 (version=TLSv1 cipher=DHE-RSA-CAMELLIA256-SHA bits=256 verify=NO); Sun, 20 Mar 2016 14:32:57 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.10.3 kib.kiev.ua u2KCWuUg000564 Received: (from kostik@localhost) by tom.home (8.15.2/8.15.2/Submit) id u2KCWuZO000563; Sun, 20 Mar 2016 14:32:56 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Sun, 20 Mar 2016 14:32:56 +0200 From: Konstantin Belousov To: Timothy Macintyre Cc: "freebsd-hackers@freebsd.org" Subject: Re: Fw: FreeBSD 9.0 16kb Page Size Message-ID: <20160320123256.GH1741@kib.kiev.ua> References: <20160319132752.932a5a1e.freebsd@edvax.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.24 (2015-08-30) X-Spam-Status: No, score=-2.0 required=5.0 tests=ALL_TRUSTED,BAYES_00, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on tom.home X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Mar 2016 12:33:02 -0000 On Sun, Mar 20, 2016 at 10:16:37AM +0000, Timothy Macintyre wrote: > Hi, > > I originally asked this on freebsd-questions (below) and was forwarded here. I have tried updating the page size of the latest release (10) and the kernel still crashes, I imagine I'm missing something like an invalid struct size but not sure where. Any help would be greatly appreciated. > You did not added the patch which would show what have you done so far. First, I am interesting why do you want to use 16K pages on amd64. I am aware that somebody did an experiment with 8K pages on i386 or amd64, not sure which arch was it. The goal was to reduce memory allocation cost in CPU cycles, but the pay for it was more severe memory underutilization and in fact more CPU use in pmap. Note that hardware only supports 4K/2M/1G page sizes, so 16K pages require different code than what is currently present in amd64/pmap.c. You cannot get away with just redefining constants. One on the issue is software->hardware flow. One PTE only maps 4K still, so to map the whole 16K page you need to fill 4 consequtive PTEs. Note that the pmap code assumes atomic pte updates, you would need to consider this requirement when doing the adjustments. Another issue is hardware->software. Since one page is mapped with 4 PTEs, you have 4 accessed/modified bits from PTEs to reflect to the high-level vm_page_t state. This is related to the atomicity issue I noted above. Summary is, what you want to do (for whatever reason) cannot be achieved by changing compilation constants, it requires code changes, some of them are delicate. > Thanks. > > ________________________________________ > From: Polytropon > Sent: 19 March 2016 12:27 > To: Timothy Macintyre > Cc: freebsd-questions@freebsd.org > Subject: Re: FreeBSD 9.0 16kb Page Size > > On Fri, 18 Mar 2016 11:11:17 +0000, Timothy Macintyre wrote: > > I'm trying to do some testing on FreeBSD 9.0 with the page size > > set to 16kb on amd64 but I'm having trouble building a stable kernel. > > > > I've changed the PAGE_SHIFT to 14 under param.h and also updated > > pmap.h/c with the following values so it doesn't complain about > > invalid struct sizes at compile but I'm getting a crash after > > install and reboot. Is there something I'm missing here? > > > > > > #define _NPCM 12 > > #define _NPCPV 677 > > You should probably repeat that experiment with a currently > supported code base. FreeBSD 9.0 is already EOL. The best > idea would be to use the FreeBSD 10.2 release (amd64) and > make the required changes. > > In case you have a valid reason not to use FreeBSD 10, but > instead need to keep FreeBSD 9, try the most current release, > which is FreeBSD 9.3. Remember: it's a legacy release, not a > production release. > > If you have done this and you're still experiencing problems, > write to the freebsd-hackers@ mailing list, which is primarily > intended for higher-level "Technical Discussions relating to > FreeBSD", as freebsd-questions@ is mostly a users' question > list (less technical, often focused on "easy" problems). > Messing with the bowels of the kernel's memory management > isn't a typical "user question". ;-) > > > > > -- > Polytropon > Magdeburg, Germany > Happy FreeBSD user since 4.0 > Andra moi ennepe, Mousa, ... > _______________________________________________ > freebsd-hackers@freebsd.org mailing list > https://lists.freebsd.org/mailman/listinfo/freebsd-hackers > To unsubscribe, send any mail to "freebsd-hackers-unsubscribe@freebsd.org"