<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Alexander Krizhanovsky on Medium]]></title>
        <description><![CDATA[Stories by Alexander Krizhanovsky on Medium]]></description>
        <link>https://medium.com/@krizhanovsky?source=rss-b384f82e81fc------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*Om5-501pTdAlQ2-HEo8M3A.jpeg</url>
            <title>Stories by Alexander Krizhanovsky on Medium</title>
            <link>https://medium.com/@krizhanovsky?source=rss-b384f82e81fc------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 23 Nov 2026 11:13:12 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@krizhanovsky/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Intelpocalypse: goodbye fast system calls]]></title>
            <link>https://medium.com/@krizhanovsky/intelpocalypse-goodbye-fast-system-calls-a0824683d67e?source=rss-b384f82e81fc------2</link>
            <guid isPermaLink="false">https://medium.com/p/a0824683d67e</guid>
            <category><![CDATA[performance]]></category>
            <category><![CDATA[intel]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[linux]]></category>
            <category><![CDATA[https]]></category>
            <dc:creator><![CDATA[Alexander Krizhanovsky]]></dc:creator>
            <pubDate>Sun, 19 May 2019 15:21:57 GMT</pubDate>
            <atom:updated>2019-05-19T15:21:57.937Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/580/0*NZgUaIesde0aEnFB.jpg" /></figure><p>Intel announces one security vulnerability after another making system calls slower and slower. In May 14 they <a href="https://www.intel.com/content/www/us/en/architecture-and-technology/mds.html">announced</a> MDS (aka ZombieLoad) vulnerability. Earlier, in 2018, there was announced <a href="https://meltdownattack.com/meltdown.pdf">Metdown</a>.</p><p>Modern Linux kernel is compiled with <a href="https://en.wikipedia.org/wiki/Kernel_page-table_isolation">Kernel page table isolation</a> (KPTI) to prevent Metldown. Essentially, KPTI is just a removal of old technique to optimize system calls, aka lazy TLB: kernel space is mapped to all page tables for user space processes, so there is no need to flush 1 layer caches on kernel/user-space context switches. Performance impact is serious: up to <a href="https://www.phoronix.com/scan.php?page=article&amp;item=linux-419-mitigations&amp;num=4">20% for Nginx</a> (<a href="https://mariadb.org/myisam-table-scan-performance-kpti/">MariaDB got even 40% for certain workloads</a>).</p><p>The numbers are for systems with <a href="https://groups.google.com/forum/m/#!topic/mechanical-sympathy/L9mHTbeQLNU">PCID</a> (the feature is available for all modern processors in recent years). Without PCID you may hit up to <a href="https://mariadb.org/myisam-table-scan-performance-kpti/">90% performance impact</a>. PCID introduces tagging for TLB, so that you can keep some cached page mappings and don’t need to invalidate L1 TLB cache twice on each system call.</p><p>MDS goes further in <a href="https://www.kernel.org/doc/html/latest/x86/mds.html">slowing down system calls</a>, it introduces mds_clear_cpu_buffers() called on each context switch. Performance impact seems <a href="https://www.intel.com/content/www/us/en/architecture-and-technology/mds.html">not so huge</a> as for the Meltdown prevention, but it’s clear that system calls become even more slow.</p><p>The good news is that <a href="https://github.com/tempesta-tech/tempesta/">Tempesta FW</a> works in kernel space, so there is no context switches and KPTI and MDS do not affect our performance at all. Moreover, we accurately program our most performance crucial code (HTTP processing) in assembly and use <a href="https://support.google.com/faqs/answer/7625886">retpoline</a> <a href="https://spectreattack.com/spectre.pdf">Spectre</a> prevention only where it’s <a href="https://github.com/tempesta-tech/tempesta/pull/1249#discussion_r284287316">necessary</a>. Retpoline may have up to 15% performance impact, but, fortunately, not each indirect jump must use retpoline to be safe against Spectre.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a0824683d67e" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>