<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: mmap()</title>
	<atom:link href="http://mituzas.lt/2008/08/17/mmap/feed/" rel="self" type="application/rss+xml" />
	<link>http://mituzas.lt/2008/08/17/mmap/</link>
	<description>where ideas come and die</description>
	<lastBuildDate>Fri, 26 Feb 2010 17:15:26 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0-alpha</generator>
	<item>
		<title>By: Aistis</title>
		<link>http://mituzas.lt/2008/08/17/mmap/comment-page-1/#comment-184583</link>
		<dc:creator>Aistis</dc:creator>
		<pubDate>Thu, 21 Aug 2008 15:42:52 +0000</pubDate>
		<guid isPermaLink="false">http://dammit.lt/?p=187#comment-184583</guid>
		<description>visiskai nerealus thread&#039;as lkml&#039;e. aciu ;))</description>
		<content:encoded><![CDATA[<p>visiskai nerealus thread&#8217;as lkml&#8217;e. aciu ;))</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Domas Mituzas</title>
		<link>http://mituzas.lt/2008/08/17/mmap/comment-page-1/#comment-183380</link>
		<dc:creator>Domas Mituzas</dc:creator>
		<pubDate>Tue, 19 Aug 2008 08:12:49 +0000</pubDate>
		<guid isPermaLink="false">http://dammit.lt/?p=187#comment-183380</guid>
		<description>Indeed, there&#039;re multiple cases when mmap() can be helpful, if used correctly - but there&#039;re many ways to make mistakes too.

Software has to be really helping the OS with madvise() - though the interface is quite limited (it is just extreme flushing of cache, not reducing priorities).</description>
		<content:encoded><![CDATA[<p>Indeed, there&#8217;re multiple cases when mmap() can be helpful, if used correctly &#8211; but there&#8217;re many ways to make mistakes too.</p>
<p>Software has to be really helping the OS with madvise() &#8211; though the interface is quite limited (it is just extreme flushing of cache, not reducing priorities).</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anonymouse</title>
		<link>http://mituzas.lt/2008/08/17/mmap/comment-page-1/#comment-183098</link>
		<dc:creator>Anonymouse</dc:creator>
		<pubDate>Mon, 18 Aug 2008 15:43:28 +0000</pubDate>
		<guid isPermaLink="false">http://dammit.lt/?p=187#comment-183098</guid>
		<description>Just a clarification: With the default options, mmap() does not allocate the pages until you access them, so the memory pressure is really more related to the working set size, not the file size.

mmap() really wins when you can use the data directly, without processing it, and due to the secondary effects on the file cache (if you read() data and put that into anonymous pages, it may force pages out of the file cache, which does not happen with mmap).

In some cases it also eases development, since mmap()&#039;ing data is almost zero-cost when the data is already in the cache, so you can save on initialization time.</description>
		<content:encoded><![CDATA[<p>Just a clarification: With the default options, mmap() does not allocate the pages until you access them, so the memory pressure is really more related to the working set size, not the file size.</p>
<p>mmap() really wins when you can use the data directly, without processing it, and due to the secondary effects on the file cache (if you read() data and put that into anonymous pages, it may force pages out of the file cache, which does not happen with mmap).</p>
<p>In some cases it also eases development, since mmap()&#8217;ing data is almost zero-cost when the data is already in the cache, so you can save on initialization time.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Mark R</title>
		<link>http://mituzas.lt/2008/08/17/mmap/comment-page-1/#comment-183005</link>
		<dc:creator>Mark R</dc:creator>
		<pubDate>Mon, 18 Aug 2008 09:06:56 +0000</pubDate>
		<guid isPermaLink="false">http://dammit.lt/?p=187#comment-183005</guid>
		<description>The case where mmap() is really good is where we can reduce the number of copies of data made with it. The MyISAM key buffer is an example where I tried - not very successfully - to use it. 

If we can get/put data directly from a mmap()&#039;d location, instead of copying it from an OS buffer (as with pread / pwrite) then we save a copy operation.

If, of course, the code is written so that it assumes it has a private copy of the page to mess around with (I&#039;m pretty sure MyISAM DOES do this), then you have to copy it anyway (e.g. with memcpy) which pretty much negates the advantage (I expect).

My performance data from mmap()ing MyISAM keys suggested that the benefits were modest anyway.

Mark</description>
		<content:encoded><![CDATA[<p>The case where mmap() is really good is where we can reduce the number of copies of data made with it. The MyISAM key buffer is an example where I tried &#8211; not very successfully &#8211; to use it. </p>
<p>If we can get/put data directly from a mmap()&#8217;d location, instead of copying it from an OS buffer (as with pread / pwrite) then we save a copy operation.</p>
<p>If, of course, the code is written so that it assumes it has a private copy of the page to mess around with (I&#8217;m pretty sure MyISAM DOES do this), then you have to copy it anyway (e.g. with memcpy) which pretty much negates the advantage (I expect).</p>
<p>My performance data from mmap()ing MyISAM keys suggested that the benefits were modest anyway.</p>
<p>Mark</p>
]]></content:encoded>
	</item>
</channel>
</rss>
