The Linux 7.1 kernel's change from unsigned long to u64 for the inode->i_ino field, while beneficial for 64-bit systems, may cause cache line alignment and slab sizing issues for 32-bit users.
The upcoming Linux 7.1 kernel release brings a significant change to the VFS (Virtual File System) layer that could have unintended consequences for users still running 32-bit Linux distributions. The change involves widening the inode->i_ino field from an unsigned long to a u64, a modification that promises cleaner code for modern 64-bit systems but may introduce performance implications for 32-bit architectures.
The Technical Background
The inode->i_ino field has historically been an unsigned long, which means it's 32 bits on 32-bit architectures and 64 bits on 64-bit architectures. This limitation has forced many filesystems to implement workarounds or "hacks" to hash 64-bit identifiers into the 32-bit field, depriving the kernel of a universal identifier for inodes.
Jeff Layton, who spearheaded this change, explained that the work in the pull request changes the inode->i_ino field from an unsigned long to a u64. "This shouldn't make any material difference on 64-bit hosts, but 32-bit hosts will see struct inode grow by at least 4 bytes," Layton noted. "This could have effects on slabcache sizes and field alignment."
The 32-bit Impact
The most immediate concern for 32-bit users is the increased size of the struct inode. With the i_ino field expanding from 32 to 64 bits, the overall structure grows by at least 4 bytes on 32-bit systems. This seemingly small change can have cascading effects:
- Cache line alignment issues: The larger struct may no longer fit optimally within cache lines, potentially leading to more cache misses and reduced performance.
- Slab sizing implications: Memory allocation for inodes may become less efficient, affecting overall system memory usage and performance.
- Filesystem compatibility: Some filesystems that implemented specific workarounds for the 32-bit limitation may need updates to function optimally.
The 64-bit Benefits
For modern 64-bit systems, this change is largely transparent and beneficial. The kernel gains a true universal identifier for inodes, eliminating the need for filesystem-specific hacks. This simplification can lead to cleaner, more maintainable code and potentially enable future optimizations.
Layton mentioned that with this change, some inode structures could be shrunk in the future. For example, struct nfs_inode currently has a fileid field that holds the 64-bit inode number. With the i_ino field now properly sized, this redundant field could potentially be eliminated.
The Development Process
Interestingly, much of the patchset was generated with the assistance of a large language model, specifically Claude. Layton clarified his approach to LLM usage: "Much of this set was generated by LLM, but I attributed it to myself since I consider this to be in the 'menial tasks' category of LLM usage."
This represents an interesting case study in modern kernel development, where AI tools are being used to handle routine coding tasks while human developers focus on the architectural decisions and potential implications.
The Broader Context
The timing of this change is noteworthy given ongoing discussions about deprecating 32-bit architectures in the Linux kernel. The kernel community has been gradually moving away from supporting 32-bit systems as they become increasingly niche in the server and desktop markets.
Layton acknowledged this context when first proposing the change in February: "We're actively talking about deprecating 32-bit arches in the future however, so maybe we can rationalize that away."
Performance Considerations
While the kernel developers believe this change is ultimately positive, 32-bit users should be aware of potential performance impacts:
- Memory usage: The larger inode structures will consume more memory, which could be significant on systems with limited RAM.
- Cache efficiency: If the struct inode no longer aligns optimally with cache lines, there could be measurable performance degradation, especially in filesystem-intensive workloads.
- Slab allocator behavior: Changes to slab sizing could affect memory allocation patterns and potentially impact overall system responsiveness.
Looking Forward
This change in Linux 7.1 represents a microcosm of the broader evolution of the Linux kernel. As the ecosystem continues to mature and 32-bit systems become increasingly rare, the kernel can shed historical constraints and optimize for modern hardware.
For users still running 32-bit Linux distributions, this serves as a reminder to monitor kernel updates closely and be prepared for potential performance changes. While the kernel community strives to maintain compatibility, some trade-offs are inevitable as the codebase evolves.

The inode->i_ino field change is just one example of how kernel development must balance backward compatibility with forward progress. As Layton noted, the bulk of the changes were to format strings and tracepoints, since the kernel itself doesn't care that much about the i_ino field. However, the memory layout implications for 32-bit systems demonstrate how even seemingly minor changes can have far-reaching effects.
For most users on modern 64-bit systems, this change will be entirely transparent and beneficial. For the remaining 32-bit users, it's a reminder that the Linux kernel's future is firmly rooted in 64-bit computing, and some growing pains may be inevitable as the kernel continues to evolve.

Comments
Please log in or register to join the discussion