<?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"><channel><title><![CDATA[TrendSpike Systems & Tax Lab]]></title><description><![CDATA[TrendSpike Systems & Tax Lab]]></description><link>https://trendspike.hashnode.dev</link><generator>RSS for Node</generator><lastBuildDate>Thu, 12 Nov 2026 07:17:41 GMT</lastBuildDate><atom:link href="https://trendspike.hashnode.dev/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[Linux Kernel VFS Pathname Lookup: RCU-Walk vs. Ref-Walk and dcache Scaling]]></title><description><![CDATA[In high-concurrency Linux server environments, open(), stat(), and execve() system calls resolve file paths through the Virtual Filesystem (VFS) layer…]]></description><link>https://trendspike.hashnode.dev/linux-kernel-vfs-pathname-lookup-rcu-walk-vs-ref-walk-and-dcache-scaling</link><guid isPermaLink="true">https://trendspike.hashnode.dev/linux-kernel-vfs-pathname-lookup-rcu-walk-vs-ref-walk-and-dcache-scaling</guid><category><![CDATA[Linux]]></category><category><![CDATA[Kernel]]></category><category><![CDATA[C]]></category><category><![CDATA[Systems Programming]]></category><category><![CDATA[performance]]></category><dc:creator><![CDATA[Ab Mughal]]></dc:creator><pubDate>Wed, 11 Nov 2026 22:31:20 GMT</pubDate><content:encoded><![CDATA[<p>In high-concurrency Linux server environments, <code>open()</code>, <code>stat()</code>, and <code>execve()</code> system calls resolve file paths through the Virtual Filesystem (VFS) layer (<code>fs/namei.c</code>). Under multi-core load, naive reference counting on directory entry (<code>struct dentry</code>) structures triggers severe L1/L2 cache-line bouncing across CPU sockets.</p>
<p>To eliminate atomic lock contention along hot directory trees (<code>/usr</code>, <code>/lib</code>, <code>/etc</code>), the Linux kernel splits pathname resolution into two distinct execution modes: <strong>RCU-Walk</strong> (lockless, non-blocking traversal) and <strong>Ref-Walk</strong> (spinlock-backed reference counting).</p>
<hr />
<h3>1. <code>struct nameidata</code> and the Dual-Mode Lookup State Machine</h3>
<p>Every VFS path lookup allocates a stack-local <code>struct nameidata</code> instance that tracks the current <code>struct path</code> (<code>mnt</code> + <code>dentry</code>), traversal flags (<code>LOOKUP_RCU</code>), and saved sequence counters (<code>seq</code> and <code>m_seq</code>).</p>
<pre><code class="language-c">// Simplified from fs/namei.c
struct nameidata {
    struct path     path;
    struct qstr     last;
    struct path     root;
    struct inode    *inode;
    unsigned int    flags;
    unsigned        seq, next_seq, m_seq, r_seq;
    int             last_type;
    unsigned        depth;
};
</code></pre>
]]></content:encoded></item></channel></rss>