<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>Kernel on Nitin Gupta</title>
    <link>https://nitingupta.dev/tags/kernel/</link>
    <description>Recent content in Kernel on Nitin Gupta</description>
    <generator>Hugo</generator>
    <language>en</language>
    <managingEditor>ngupta@nitingupta.dev (Nitin Gupta)</managingEditor>
    <webMaster>ngupta@nitingupta.dev (Nitin Gupta)</webMaster>
    <lastBuildDate>Wed, 12 Aug 2020 00:00:00 +0000</lastBuildDate>
    <atom:link href="https://nitingupta.dev/tags/kernel/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>Proactive Compaction</title>
      <link>https://nitingupta.dev/post/proactive-compaction/</link>
      <pubDate>Sat, 07 Mar 2020 22:33:52 -0800</pubDate><author>ngupta@nitingupta.dev (Nitin Gupta)</author>
      <guid>https://nitingupta.dev/post/proactive-compaction/</guid>
      <description>&lt;p&gt;&lt;em&gt;This feature has now been &lt;a href=&#34;https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/mm/compaction.c?id=facdaa917c4d5a376d09d25865f5a863f906234a&#34;&gt;&lt;strong&gt;accepted and merged&lt;/strong&gt;&lt;/a&gt; in the upstream kernel and will be part of kernel release 5.9. This post has been updated to match the upstream version of this feature.&lt;/em&gt;&lt;/p&gt;&#xA;&lt;hr&gt;&#xA;&lt;p&gt;In my &lt;a href=&#34;https://nitingupta.dev/post/linux-kernel-hugepage-allocation-latencies/&#34;&gt;previous post&lt;/a&gt;, I described how on-demand compaction scheme hurts hugepage allocation latencies on Linux. To improve the situation, I have been working on Proactive Compaction for the Linux kernel, which tries to reduce higher-order allocation latencies by compacting memory in the background.&lt;/p&gt;</description>
    </item>
    <item>
      <title>Linux kernel hugepage allocation latencies</title>
      <link>https://nitingupta.dev/post/linux-kernel-hugepage-allocation-latencies/</link>
      <pubDate>Tue, 04 Feb 2020 00:00:00 +0000</pubDate><author>ngupta@nitingupta.dev (Nitin Gupta)</author>
      <guid>https://nitingupta.dev/post/linux-kernel-hugepage-allocation-latencies/</guid>
      <description>&lt;p&gt;Some drivers needs to allocate almost all memory as hugepages to reduce (on-device or CPU) TLB pressure. However, on a running system, higher order allocations can fail if the memory is fragmented. Linux kernel can do &lt;strong&gt;on-demand compaction&lt;/strong&gt; as we request more hugepages but this style of compaction incurs very high latency.&lt;/p&gt;&#xA;&lt;p&gt;To show the effect of on-demand compaction on hugepage allocation latency, I created a test program &amp;ldquo;frag&amp;rdquo; which allocates almost all available system memory followed by freeing $\frac{3}{4}$ of pages from each hugepage-sized aligned chunk. This allocation pattern results in ~300% fragmented address space w.r.t order 9 i.e. physical mappings of our VA space is spread over 3x the number of hugepage-aligned chunks than what is ideally required.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
