From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (qmail 29471 invoked from network); 12 Jan 1999 19:48:31 -0000 Received: from mail.redhat.com (199.183.24.239) by lists.redhat.com with SMTP; 12 Jan 1999 19:48:31 -0000 Received: from piglet.twiddle.net (rth@[207.104.6.26]) by mail.redhat.com (8.8.7/8.8.7) with ESMTP id OAA10289 for ; Tue, 12 Jan 1999 14:26:33 -0500 Received: (from rth@localhost) by piglet.twiddle.net (8.8.7/8.8.7) id LAA05052 for axp-list@redhat.com; Tue, 12 Jan 1999 11:27:52 -0800 Message-ID: <19990112112751.A5014@piglet.twiddle.net> Date: Tue, 12 Jan 1999 11:27:51 -0800 From: Richard Henderson To: axp-list@redhat.com Subject: Re: rpcc References: <19990111205928.A3760@piglet.twiddle.net> <278f407d.u10t12e.e7d00-axp@amazing.ch> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.93.2 In-Reply-To: <278f407d.u10t12e.e7d00-axp@amazing.ch>; from Christoph Dworzak on Tue, Jan 12, 1999 at 04:59:00PM +0000 On Tue, Jan 12, 1999 at 04:59:00PM +0000, Christoph Dworzak wrote: > > (2) page colouring. this affects the efficiency of the caches. > > there is no way under linux to control your page colour. > > What is page colouring? Could you explain this or do you > know where I can read about it? It should be found in most operating system or system architecture textbooks, in the location in which they talk about memory caches. Caches work by indexing off the middle bits of an address, also referred to as the address' `colour'. The exact range of middle bits has to do with the cache line size on the low end, and the size of the cache / set associativeness of the cache on the high end. If the high bits of two addresses are different, but their colours are the same, the two addresses alias. The set associativeness of the cache determines how many aliases we can have in the cache at one time. If the physical memory for a process is all contiguous, we get the maximal distribution of colours, and so optimal cache efficiency. This rarely happens in practice. What does happen is that, due to physical memory fragmentation, the kernel uses a page from here and a page from there. On a system that has been up a while, the colour any particular page a process owns is effectively random. Worst case, one could receive a set of pages all with the same colour. In this case the process would spend a great deal of its time waiting on main memory because cache efficiency would be abysmal. This also rarely happens in practice. DaveM experimented with page colouring allocator -- one that would be more likely to give a maximal distribution of colours -- midway through the 2.1 series. But on top of the buddy-system page allocation system we have, that lead to serious memory fragmentation, fell over and died in low memory situations. Perhaps it will be revisited in the 2.3 series; who knows. It's only a real issue for benchmarks, when one wants to have reproducible numbers, so it's a fairly low-priority thing. r~