Lustre Upstreaming to Linux Kernel: Difference between revisions

From Lustre Wiki
Jump to navigation Jump to search
(Update to reflect move away from Intel JIRA site and new upstream tree.)
(link more major orgs using Lustre)
 
(40 intermediate revisions by 3 users not shown)
Line 1: Line 1:
== Getting started ==
The Lustre upstreaming effort is currently being managed as part of the <code>master</code> Lustre development branch, and submitted patches should follow the normal [[Development|Lustre patch development process]], which includes fixing issues reported by checkpatch.pl, so that the code follows the upstream kernel style guidelines.  Once all issues in the Lustre code that are known to be blocking upstream submission have been addressed, then the filesystem will be resubmitted to the upstream kernel.


The upstream Lustre client code is currently hosted in the staging area of the linux kernel tree. All current efforts for the upstream client are done with the git staging repo and that work then goes into Linus's tree during the merge window shortly after a Linux kernel release is cut. The git staging tree has several branches but the one of interest for contributing is the staging-testing branch. Any patches created against the other branches will likely not even apply correctly so please ensure  you are working and testing with the staging-testing branch. Before we can start developing patches we need to obtain the source repo, build and install the Lustre enabled kernel with the proper utilities. The steps to getting started are listed below. In my example I named by git repo top directory lustre-upstream but you can name it whatever you want.


    cd your-work-directory
== Upstream Filesystem Requirements ==
    git clone https://github.com/neilbrown/linux lustre-upstream
    cd lustre-upstream
    git checkout -b lustre origin/lustre


=== Kernel configuration ===
The Linux kernel has [https://github.com/torvalds/linux/blob/master/Documentation/filesystems/adding-new-filesystems.rst documented requirements] for accepting new filesystems. The following section discussed those requirements.


With the lustre client source tree available the next step will be configuring your kernel to enable Lustre. The easiest way to configure a kernel is to run make menuconfig. If this fails it most likely is due to the missing libncurses library that is required. Running the make menuconfig will present you the top level menu. The section for Lustre is located in the Device Drivers section:
=== Do You Need a New In-Kernel Filesystem? ===


    < > Volume Management Device Driver
<blockquote>"Before proposing a new in-kernel filesystem, consider whether one of the alternatives might be more appropriate."</blockquote>
    [*] Networking support  --->
    Device Drivers  --->
    Firmware Drivers  --->


Once in the Device Drivers menu you want to enable the Staging driver menu as shown here:
{| class="wikitable"
! Question !! Answer
|-
| Does an existing in-kernel filesystem cover the same use case?
| Lustre targets high performance scale-out network file storage use-cases. The closest analogs in the kernel are pNFS and Ceph. Lustre has a more mature implementation and is generally higher performance than either pNFS or Ceph.<ref>https://io500.org/</ref>  Lustre has a fully open-source server, unlike most pNFS implementations where they are only using the Linux client and keeping the server proprietary.
|-
| Can we use FUSE?
| One of Lustre's highest priorities is performance. FUSE imposes an unacceptable performance tradeoff.
|}


    Virtio drivers  --->
=== Technical Requirements ===
    Microsoft Hyper-V guest support  ----
    [*] Staging drivers  --->
    [ ] X86 Platform Specific Device Drivers  --->


Enable the staging driver allows you to display the options of that menu. Scroll down to the Staging drivers option and hit enter to go to the Staging menu.
{| class="wikitable"
In the menu you will see something similar to:
! Requirement !! Upstream guidance !! Lustre status
|-
| rowspan="3" | Use modern VFS interfaces
| "Do not use interfaces listed in Documentation/process/deprecated.rst."
| &nbsp;
|-
| "Use folios rather than raw page operations for page cache management."
| Lustre is well underway in converting both the client and the server IO paths to folios.<ref>[https://jira.whamcloud.com/browse/LU-17916 LU-17916]</ref>
|-
| "Network filesystems should consider using the netfs library Documentation/filesystems/netfs_library.rst, or be prepared to explain why it is not a good fit."
| Lustre stripes files over several storage servers. It needs to maintain cache coherence whenever any server revokes a lock for a file range. This requires special callbacks that netfs doesn't support.
|-
| rowspan="2" | Provide userspace utilities
| "A mkfs tool is expected ..."
| Lustre maintains a mkfs.lustre tool.<ref>[https://github.com/lustre/lustre-release/blob/master/lustre/utils/mkfs_lustre.c mkfs_lustre.c]</ref>
|-
| "A fsck tool is strongly recommended ..."
| Lustre uses existing local-disk filesystems (modified ext4 -> ldiskfs) for the individual storage targets, and e2fsck is used to repair local filesystem inconsistencies/corruption.  Lustre has a dedicated online repair tool, [https://doc.lustre.org/lustre_manual.xhtml#lfsckadmin LFSCK], that can detect and repair inconsistencies between the individual target filesystems.
|-
| Be testable
| "The filesystem must be testable in a meaningful way." "The fstests framework (also known as xfstests) is the standard testing infrastructure for Linux filesystems and its use is highly recommended." "At a minimum, there must be a credible and documented way to test the filesystem and detect regressions. When submitting, include a summary of test results indicating which tests pass, fail, or are not applicable."
| Lustre has a large body of existing tests<ref>[https://github.com/lustre/lustre-release/blob/master/lustre/tests/ lustre/tests/]</ref> that are run continuously on all patches before integration<ref>[https://testing.whamcloud.com/ test sessions]</ref>. Lustre is testable via fstests.  We intend to submit fstests support when Lustre is being submitted upstream.
|-
| Provide documentation
| "A documentation file under Documentation/filesystems/ describing the filesystem, its on-disk format, mount options, and any notable design decisions is recommended."
| Lustre has a lot of existing documentation included in the sources for command-line tools and developers<ref>[https://github.com/lustre/lustre-release/blob/master/Documentation/ lustre-release Documentation]</ref> that we will submit alongside the filesystem as appropriate. Lustre also has extensive online documentation for usage and administration.<ref>[https://doc.lustre.org/lustre_manual.xhtml Lustre Operations Manual]</ref><ref>[https://wiki.lustre.org/Main_Page Lustre Wiki]</ref>
|}


    < >  GCT GDM724x LTE support>
=== Community and Maintainership Expectations ===
    < >  TTY over Firewire
    < >  Lustre networking subsystem (LNet)
    < >  Digi Neo and Classic PCI Products


You want to select Lustre networking subsystem which will in turn enable several other options.
{| class="wikitable"
! Requirement !! Upstream guidance !! Lustre status
|-
| Identified maintainers
| &nbsp;
| In no particular order - James Simmons, Timothy Day, Andreas Dilger, Oleg Drokin
|-
| Demonstrated commitment
| "A track record of maintaining kernel code -- for example, in other subsystems -- significantly strengthens the case for a new filesystem."
| Andreas Dilger is one of the long-time contributors to ext2/ext3/ext4/e2fsprogs.  Many of the other Lustre developers contributed substantial features to ext4/e2fsprogs.
|-
| Sustained backing
| "Major filesystems in Linux have organizational or corporate support behind their development."
| A non-exhaustive list of domains of contributing organizations in the past 3 years: whamcloud.com, ddn.com, hpe.com, aeoncomputing.com, amazon.com, thelustrecollective.com, infradead.org, cea.fr, nvidia.com, oracle.com, suse.de, lanl.gov, google.com, llnl.gov, linaro.org, openchip.com, microsoft.com, tintri.com, gluesys.com, stanford.edu, cray.com, ornl.gov, jlab.org, intel.com, iastate.edu, eviden.com, codewreck.org, canonical.com, atos.net
|-
| Responsiveness
| "The maintainer is expected to respond to bug reports, address review feedback, and adapt the filesystem to VFS infrastructure changes such as folio conversions, iomap migration, and mount API updates."
| There is a longstanding [https://jira.whamcloud.com/projects/LU/issues Lustre issue tracking system] that is open to the public (need free account to post issues) as well as [[mailing lists|Mailing_Lists_and_IRC]] for users, lustre-devel list for developers, and [https://join.slack.com/t/lustreupstreamclient/shared_invite/zt-23pl0xxsi-1PwfkpjP_vphW8nqoUnUBA Slack channel].
|-
| User base
| "Clearly describe who the users of this filesystem are and the scale of the user base."
| Lustre users are widespread across universities and research organizations around the world (e.g. Stanford, UFlorida, ORNL, LLNL, LANL, NCSA, Cambridge, HLRS, CINECA, SFU, NASA), weather forecasting (NOAA, NCAR, DKRZ, ECMWF, BoM, UKMET), energy (CEA, BP, Total), medicine/genomics (Sanger, BGI, Cornell), LLM (NVIDIA, xAI, Anthropic, Softbank), and many other organizations that need high performance and high capacity storage.  About 70% of the Top-500 supercomputers for the past 15+ years use Lustre, which implies at least many thousands of large systems use it, and at least hundreds of thousands of direct users.  Lustre is freely available through multiple channels, so there is no way to tell the total number of users.  There are also multiple vendors selling Lustre-based storage hardware and support offerings directly or indirectly: [https://github.com/Cray/lustre HPE], [https://aws.amazon.com/fsx/lustre/ AWS], [https://www.ddn.com/products/lustre-file-system-exascaler/ DDN], [https://cloud.google.com/products/managed-lustre Google], [https://learn.microsoft.com/en-us/azure/azure-managed-lustre/amlfs-overview Azure], [https://www.oracle.com/cloud/storage/file-storage-with-lustre/ Oracle], [https://www.aeoncomputing.com/ Aeon], [https://thelustrecollective.com/ TLC]
|-
| Building your track record
| "A practical way to demonstrate many of the qualities above is to maintain the filesystem out-of-tree for a period before requesting a merge."
| Lustre has been in active development out-of-tree for over 25 years and has dozens of full-time developers and many more contributors.
|}


    < >  GCT GDM724x LTE support
=== References ===
    < >  TTY over Firewire
    <M>  Lustre networking subsystem (LNet)
     (1048576) Lustre lnet max transfer payload (default 1MB)
    <M>    Lustre networking self testing
    <M>    LNET infiniband support
    <M>    Lustre file system client support
    (8192)    Lustre obd max ioctl buffer bytes (default 8KB)
    [ ]      Enable Lustre DEBUG checks
    < >  Digi Neo and Classic PCI Products
    < >  Xilinx FPGA firmware download module


These default values will be enough to get you on your way to building a lustre client. Help sections are provided for all the entries to help you understand your options.
<references />
Once you have made your selections then the normal build process of make bzImage and make modules on x86 machines will produce the lustre client modules. For
other platforms or if you want to create debian or rpm packages please consult freely available documentation about kernel building on the web. Also feel free to ask
for help on the lustre-devel mailing list. Once your kernel is ready just install it as you normally would a new kernel and reboot.


=== Building the Lustre utilities ===


To use the lustre upstream client properly you will need to install the lustre utilities RPM or Debian packages. First you will need to download the latest Lustre OpenSFS/Intel repository.
== Pending Work ==
Like the upstream repo checkout you can name it something different than '''lustre-intel-branch''' in this example.


    cd my-work-space
Significant work has gone into improving the Lustre codebase since the Lustre client was removed from staging. Below are listed some of the major areas of ongoing work. This list is not comprehensive. The first ticket <code>LU-12511</code> links to a lot of work that has been completed historically. This table will be updated periodically as new requirements emerge and as work becomes completed.
    git clone git://git.hpdd.intel.com/fs/lustre-release lustre-intel-branch
    cd lustre-intel-branch
    sh ./autogen.sh
    ./configure --disable-server
    make rpm  -  make debs


Once it completes you will have the debian based packages stored in the debs directory or the rpms in the top level source directory. In either case you only need the utilities package.
{| class="wikitable sortable"
In the rpm case it is the '''lustre-''version''*.rpm''' and the debian package of interest is '''lustre-utils_*.deb'''. Besides the utility package the other package that could be of interest is the lustre-tests-* package which contains an test suite used to validate Lustre to avoid potential regressions observed in the past. If you are interested in full fledged testing then I recommend reading the [[TestingLustreCode | How to test Lustre Code]] section.


Once all your packages are installed you will need to setup a lustre file system. An excellent link to get the newcomer going is https://wiki.hpdd.intel.com/display/PUB/Create+and+Mount+a+Lustre+Filesystem.
|-
As always if you have questions feel free to ask on the [[Mailing_Lists_and_IRC|lustre-devel]] mailing and people will gladly help you.
! Task !! Status !! Notes !! Jira !! Patch(es)
|-


== Developing for upstream client ==
|-
| Prepare Lustre for Adoption in the Linux kernel || Incomplete || This is the main Jira ticket - which links to other subtasks || [https://jira.whamcloud.com/browse/LU-12511 LU-12511] || Various
|-


This section goes over how to become actively involved in the upstream client work. The process of creating and sending patches is a very different from what is done for the OpenSFS/Intel branch.
|-
We will go over the setup of sending patches as well as meeting the coding standards for acceptance.
| IPv6 Support || Complete || Initial support in 2.16, finalized support in 2.17 || [https://jira.whamcloud.com/browse/LU-18417 LU-18417] || Various
 
|-
=== git setup for patch submitting ===
Now that you are familiar with Lustre setup and would like to contribute the next step is to configure '''.gitconfig''' to send patches to Greg and the staging tree. I will show my '''.gitconfig''' I use for pushing patches upstream.


    [sendemail]
|-
        to = NeilBrown <neilb@suse.com>
| Enforce Linux kernel coding style || Mostly Complete || The majority of checkpatch.pl warnings have been addressed. We hope to get the baseline for Lustre similar to other in-tree filesystems. || [https://jira.whamcloud.com/browse/LU-6142 LU-6142] || Various
        to = Oleg Drokin <green@whamcloud.com>
|-
        to = Andreas Dilger <adilger@whamcloud.com>
        to = James Simmons <[email protected]>
        cc = Lustre Development List <lustre-[email protected]>
        confirm = auto
    [diff]
        renames = true


Basically the '''.gitconfig''' is set to email patches to the correct people. I also add a '''[diff]''' field to handle renaming of files for when it does happen. Most users will most like never use that functionality. After you merge your patches the easiest way to prepare to send them by:
|-
| Convert to kernel-doc comments || Partially Complete || Work is currently underway. || [https://jira.whamcloud.com/browse/LU-9633 LU-9633] || Various
|-


    git send-email -"# of patches" --compose
|-
    Edit your cover letter
| Unify Lustre kernel modules || Incomplete || Reduce the total number of Lustre kernel modules || [https://jira.whamcloud.com/browse/LU-17862 LU-17862] || [https://review.whamcloud.com/c/fs/lustre-release/+/55153 55153]
|-


=== Coding Style ===
|-
All patches submitted must adhered to the linux kernel standard. Details about this coding standard can be read at https://www.kernel.org/doc/Documentation/CodingStyle which is very similar to the [[Lustre Coding Style Guidelines]]. For those used to working with the OpenSFS/Intel tree you will find most of the standard match what the Linux kernel requires. Some differences do exist which we will go over here to make people aware of them.
| Split userspace, compat, and kernel code || Mostly Complete || Split the core filesystem from the compatibility code needed to support older kernels || [https://jira.whamcloud.com/browse/LU-18687 LU-18687] || Various
|-


==== Code style changes different from the Lustre tree ====
|-
| Replace libcfs hashing code with rhashtable || In progress || Most of the users on the client have been removed; the majority of the work is server-side || [https://jira.whamcloud.com/browse/LU-8130 LU-8130] || Various
|-


1) The linux kernel disapproves of '''if (ptr == NULL)''', and '''if (rc == 0)''' testing (though the latter is acceptable if checking a numeric field for zero). The preferred way is '''if (ptr)''' or '''if (!rc)'''.
|-
| Adapt Lustre Infiniband driver to latest APIs || In progress || This is pending the transition to p2pdma API || [https://jira.whamcloud.com/browse/LU-8874 LU-8874] || Various
|-


2) No extra spaces between types and variables (this is now also true for Lustre patches).
|-
| Remove ProcFS users || Incomplete || Most of the users on the client have been removed; the majority of the work is server-side || [https://jira.whamcloud.com/browse/LU-8066 LU-8066] || Various
|-


:Don't define variables like this:
|-
        int                foo;
| Remove custom interval-tree || Complete || - || [https://jira.whamcloud.com/browse/LU-11085 LU-11085] || Various
        int                rc;
|-
 
:Don't use white space when setting variables
        var              = value;
        var2              = value2;


3) Don't use generic label names such as "'''goto out'''". Make those labels meaningful such as "'''goto out_obd_device'''" where the "'''obd_device'''" and all prior allocation/setup is cleaned up.
|-
| Transition completely to folios || In progress || A lot of callbacks have been implemented; still have dependency on mm/folio-compat.c; large folio support is in-flight || [https://jira.whamcloud.com/browse/LU-17916 LU-17916] || Various
|-


4) Avoid many returns in a function. This is covered in the kernel coding style documents but is worth going over. It is encourage to use goto instead.
|-
| ->writepage could likely be deprecated || In progress || Mostly a factor to ensure Lustre still behaves with this removed - [https://lwn.net/Articles/893512/ context] || [https://jira.whamcloud.com/browse/LU-18675 LU-18675] || [https://review.whamcloud.com/c/fs/lustre-release/+/57894 57894]
|-


5) Check for errors and not success when handling function return codes. When writing code it is preferred to handle the return codes:
|-
| Transition to p2pdma || In progress || Lustre should use upstream p2pdma framework rather than interfacing with out-of-tree modules || [https://jira.whamcloud.com/browse/LU-19848 LU-19848] || Various
|-


        rc = my_function(...)
|-
        if (rc) {
| Don't use Autotools for kernel modules || Mostly Complete || Lustre kernel modules should not be built with Autotools || [https://jira.whamcloud.com/browse/LU-18876 LU-18876] || Various
                Handle error condition;
|-
                goto out_cleanup;
        }


5) For kernel code never return '''-1''' for a error (which is '''-EPERM'''), use a proper '''-ESOMETHING''' return code.
|-
| Don't use inline #ifdef for kernel compatibility || In progress || The core Lustre kernel docs should be free from extraneous #ifdefs || - || Various
|-


6) Lastly, the 80 character per line limit can be relaxed in some cases. The kernel maintainer value readable code over the 80 character limit, though it is normally preferred to restructure code rather than have too much indentation. The main exception is in the case of strings - do not break them across multiple lines. The reasoning is that if a person encounters an error message in the logs it will be easier to locate a continuous string in the code to help track down an issue. The above covers the most common difference between the style difference between the OpenSFS/Intel branch and the upstream kernel client. Any further questions on this topic can be asked on the [[Mailing_Lists_and_IRC|lustre-devel]] mailing list.
|-
| Ensure that Lustre builds on all support architectures || Incomplete || Builds and runs on mainline 64-bit architectures (x86, aarch64, riscv), unlikely to ever be used on 32-bit or embedded platforms. || - || Various
|-


7) Much of the coding style information can be found in lustre-upstream/Documentation/process/*
|-
| Ensure Lustre can build !MODULE || Mostly Complete || Fix bugs when building Lustre into the kernel image || [https://jira.whamcloud.com/browse/LU-19874 LU-19874] || Various
|-


=== Preparing the patch ===
|}


Once you you have made your changes to the staging tree the next step is preparing the patch. Two standard patch formats exist depending one if it is an original work or a patch being ported from the OpenSFS/Intel branch.  See [[Commit Comments]] and [[Commit Comments#Patch_porting_examples|Patch Porting Examples]] for details on what the commit comments should contain.
== Proposed Transition to an Upstream-first Development Model ==
The simple case is an original fix that is not present in the OpenSFS/Intel branch. For this case when you create your patch please put in the format:


    lustre: ''subsystem'':  my fix to apply
[[Image:Split_lustre_tree.png]]
    Details of the fix to apply.
    Signed-off-by: Your Name <my.email@address>


Also accepted is "'''lustre/''subsystem'': my fix to apply'''" depending on your personal style. Also in the case your patch expands across the source tree using ''subsystem'' is not needed.
==== Background ====


When porting a patch from the OpenSFS/Intel branch to master requires more details to be added in the patch. Patches that are merged into the OpenSFS tree have a particular format which is mostly preserved when porting to the upstream client. The changes needed to port a OpenSFS/Intel patch to the upstream client are:
Currently, the Lustre kernel modules are maintained as an out-of-tree driver. This driver supports a variety of vendor kernels (primarily on RHEL and Ubuntu). Code is developed first for these vendors kernels. It is later updated to support newer kernel as they are released. The core filesystem code and the compatibility code are intermixed.


# major differences are the title of the commit message is changes from the "'''LU-XXXX ''subsystem'': my bug fix'''" to "'''staging: lustre:''subsystem'': my bug fix'''". If the original patch touched multiple subsystems then ''subsystem'' is optional in the commit message.
For upstreaming to work, the normal development flow has to generate patches to mainline Linux. However, we must still support the older distribution kernels that most people use to run Lustre. To achieve this - we must invert the development model. Code must be developed first for the upstream kernel. Afterwards, this code will be supported on older kernels via a compatibility layer maintained by the Lustre development community. These next sections provide a high-level overview and defines a clear roadmap with tangible milestones on our path to upstream. This transition will occur in stages and will proceed in parallel with normal development - without interrupting ongoing feature work.
# Replace ''Change-Id: I6346753...'' line with ''WC-bug-id: https://jira.whamcloud.com/browse/LU-XXXX''
# Remove ''Tested-by: ****'' lines (e.g. Jenkins, Maloo, etc) unless the patch was tested by a real person.
# Add your own ''Signed-off-by:'' line so who ported the patch can be kept track of.


In the end your patch to email should look like the following:
The timelines provided are approximate.


    lustre: libcfs: delete linux-mem.h
==== Tenets ====
   
    The header linux-mem.h is no longer needed after all macros were removed.
    Delete this file.
    Signed-off-by: ''original patch author'' <author@address>
    WC-bug-id: https://jira.whamcloud.com/browse/LU-XXXX
    Reviewed-on: http://review.whamcloud.com/YYYYY
    Reviewed-by: Reviewer1 <reviewer1@someaddress>
    Reviewed-by: Reviewer2 <reviewer2@yetanotheraddress>
    Signed-off-by: Your Name <my.email@address>


With the case of porting patches to the upstream client please remember to change the authorship of the patch. The git command to accomplish this is:
There are several important considerations we must account for when undertaking this work (in order of importance):


    git commit --amend --author "original author real name <author@address>"
* '''Mainline Linux is the source of truth''' - Every Lustre release must be derived from a mainline Linux release. Code change to Lustre should target mainline Linux first - and later be backported as needed. We should not block upstream improvements to facilitate backporting.


After your patch is ready, generate it with '''git format-patch''' and run the result through the kernel '''scripts/checkpatch.pl''' to ensure no style issues are introduced. Remember earlier in this documentation style issues were discussed so apply common sense with some of the checkpatch errors. Common checkpatch errors are strings being reported over 80 characters in length which can be safely ignored as a example. Once you have fixed your patch to address any real warnings reported by '''checkpatch.pl''' you can run git send-email to publish your patch. If you are unfamiliar with this part of the git process please reference the git man pages or you can freely ask questions on the [[Mailing_Lists_and_IRC|lustre-devel]] mailing list.
* '''Do not complicate the process of contributing to Lustre''' - Lustre has an active developer community and a large amount of pre-existing test infrastructure. Our existing processes have worked well. We should maintain the beneficial aspects of our existing workflows while transitioning to an upstream-first model.


[[Category:Development]]
* '''Integrate with the wider filesystem community''' - We should strive to share Lustre's improvements and advancements with the wider filesystem community. We should regularly collaborate with others in the community to facilitate kernel-wide improvements.
 
==== [I] Separate the kernel code, compatibility code, and userspace code ====
 
'''''ETA: June 2026'''''
 
The Lustre tree should be reorganized to have a clear separation of concerns:
 
<pre>
lustre/            -> Lustre filesystem kernel modules
lnet/              -> Lustre Networking kernel modules
lnet/debug/        -> Lustre debugging code
lustre_compat/    -> Kernel backwards compatibility code
tests/            -> Regression tests
utils/            -> Userspace tools
</pre>
 
The functional components of <code>libcfs/</code> will be split into <code>lustre/</code>, <code>lnet/</code>, and <code>debug/</code>. The kernel backwards compatibility components would live in <code>lustre_compat/</code>. Centralizing the compatibility code makes it easier to maintain and update and allows us to start removing the compatibility code (and #ifdefs) from the modules themselves. <code>lustre_compat/</code> will be compiled into <code>libcfs.ko</code>. The debugging code in <code>debug/</code> will be compiled into <code>lnet.ko</code> (or perhaps a standalone module).
 
The compatibility code will provide interfaces that mirror the upstream kernel-tree. After a new upstream kernel (with Lustre included) is released, we will update the compatibility layer as-needed to support that release on older kernels. A user of Lustre could either use the upstream kernel
as-is with the in-tree Lustre modules - or they could compile and use those same modules on an LTS kernel release via the compatibility layer.
 
==== [II] Get lustre/ and lnet/ to natively compile on a mainline kernel ====
 
'''''ETA: August 2026'''''
 
Once the compatibility code is isolated, we must get <code>lustre/</code> and <code>lnet/</code> to natively compile on a mainline kernel - without any Autotools magic, #ifdefs, or <code>lustre_compat/</code> layer.
 
This would be enforced by adding build validation to each patch submitted to the Lustre Gerrit. The kernel version would be pinned in the Lustre build scripts and we'd periodically update it and fix any new build failures.
 
Once this is achieved, we'll have a clean, idiomatic, mainline Linux client and server that can be run on older distributions via a compatibility layer.
 
==== [III] Move lustre/ and lnet/ to a separate kernel tree ====
 
'''''ETA: February 2027''''' (This would immediately precede submission for inclusion)
 
Transition to maintaining <code>lustre/</code> and <code>lnet/</code> as a series on patches on top of a mainline kernel release. At this point, we'll generating patches to mainline Linux while retaining the ability to support older distro kernels via <code>lustre_compat/</code>. Similar to the previous step, we periodically rebase our Lustre patch series - fixing <code>lustre_compat/</code> as needed.
 
This is the only step that requires a significant change the Lustre development workflow - patches would have to be split and sent to two different repositories. This step will be delayed until we're ready to submit Lustre upstream.
 
==== [IV] Submit the patch series for inclusion ====
 
'''''ETA: February 2027'''''
 
Once we are comfortable with the above process, we can submit the initial patches to add Lustre support to the kernel. Our normal development flow will generate a batch of patches to be submitted during each merge window. After the merge window, we can focus on testing and making sure that our backport to older distro kernels is still functional.
 
 
 
 
 
== FAQ ==
 
; Who will actually run the Lustre code in mainline Linux?
: Everyone who uses Lustre would prefer that it is available via their existing kernel. Releases for older distros will be a combination of the upstream Lustre combined with <code>lustre_compat/</code> and whatever stuff the kernel won't allow.
 
; What will a Lustre release look like?
: Userspace tools would be available separately from the kernel modules for users who use Lustre from the mainline kernel.  For users with older kernels, we would generate packages/tarballs by combining an upstream Lustre release from mainline along with <code>lustre_compat/</code> and the userspace tools. Vendors and third-parties can base their versions of Lustre on those packages/tarballs. Every time a new kernel releases - new Lustre release packages/tarball will be created. Lustre LTS releases can center around the LTS kernel releases.
 
; How will we validate that lustre/ and lnet/ build on mainline before upstream submission?
: A bot, [https://tim-day-387.github.io/upstream-patch-review/# ktest], will perform minimum build, boot, and mount testing for Lustre clients and servers on the latest mainline kernels. We will investigate integrating with [https://docs.kernelci.org/ KernelCI] in the future.
 
; Does anyone else have a similar model? Does this even work?
: DRBD was upstreamed previously and maintains an out-of-tree [https://github.com/LINBIT/drbd copy of this code] for support on LTS kernels. AMD GPU also seems to have a similar approach. We hope to talk to other developers working in a model similar to this.
 
<br>
 
 
== Testing ==
 
Currently, [https://tim-day-387.github.io/upstream-patch-review/# ktest] is used to validate that Lustre continues to build and run when integrated with the latest mainline kernels. In the future, it will also validate various kernel configurations and architecture builds. It will also perform various static checks and validations.
 
Lustre also has extensive [https://build.whamcloud.com/ build] and [https://testing.whamcloud.com/test_sessions testing] against LTS kernels, as well as multiple static analysis tools checking the patches before integration.
 
<br>
 
 
== Past Talks and Coverage ==
 
This section covers previous talks and coverage about the Lustre upstreaming process.
 
==== Lustre Administrators and Developers (LAD) ====
 
[https://www.youtube.com/watch?v=Sjbpq73SoIE LAD 2022: Native Linux client Status - James Simmons]
 
[https://www.youtube.com/watch?v=g8xOy7HTo3w LAD 2020: Linux Lustre Client State - James Simmons]
 
==== Lustre User Group (LUG) ====
 
[https://www.opensfs.org/wp-content/uploads/03-LUG_2026_Upstream_Efforts_Progress.pdf LUG 2026: Upstream Efforts Progress - James Simmons]
 
[https://www.youtube.com/watch?v=nOPpWygOreI LUG 2025: Lustre Upstreaming Efforts - James Simmons]
 
[https://www.youtube.com/watch?v=jPTGlazji3A&t=1s LUG 2024: Native Linux client Status - James Simmons]
 
[https://vimeo.com/339571280 LUG 2019: Lustre - A view from the outside - Neil Brown]
 
==== LSF/MM/eBPF ====
 
[https://wiki.lustre.org/images/f/f9/LUG2025-Lustre_Upstream_Kernel_Client-Day.pdf Lustre Upstreaming]
 
==== Linux Weekly News (LWN) ====
 
[https://lwn.net/Articles/1025268/ Getting Lustre upstream]
 
[https://lwn.net/Articles/756565/ Will staging lose its Lustre?]
 
== Mailing List Archives ==
 
This is a collection of mailing list threads of interest - any useful discussion related to upstreaming Lustre.
 
[https://lore.kernel.org/linux-fsdevel/[email protected]/T/#u Lustre Upstreaming Project Update (2026)]
 
[https://lore.kernel.org/linux-fsdevel/[email protected]/T/#t LSF/MM (2025)]
 
[http://lists.lustre.org/pipermail/lustre-devel-lustre.org/2025-January/thread.html Discussing Lustre Upstreaming with Lustre Developers (2025)]
 
[https://lwn.net/ml/linux-fsdevel/[email protected]/ Lustre removed from staging]

Latest revision as of 15:25, 23 July 2026

The Lustre upstreaming effort is currently being managed as part of the master Lustre development branch, and submitted patches should follow the normal Lustre patch development process, which includes fixing issues reported by checkpatch.pl, so that the code follows the upstream kernel style guidelines. Once all issues in the Lustre code that are known to be blocking upstream submission have been addressed, then the filesystem will be resubmitted to the upstream kernel.


Upstream Filesystem Requirements

The Linux kernel has documented requirements for accepting new filesystems. The following section discussed those requirements.

Do You Need a New In-Kernel Filesystem?

"Before proposing a new in-kernel filesystem, consider whether one of the alternatives might be more appropriate."

Question Answer
Does an existing in-kernel filesystem cover the same use case? Lustre targets high performance scale-out network file storage use-cases. The closest analogs in the kernel are pNFS and Ceph. Lustre has a more mature implementation and is generally higher performance than either pNFS or Ceph.[1] Lustre has a fully open-source server, unlike most pNFS implementations where they are only using the Linux client and keeping the server proprietary.
Can we use FUSE? One of Lustre's highest priorities is performance. FUSE imposes an unacceptable performance tradeoff.

Technical Requirements

Requirement Upstream guidance Lustre status
Use modern VFS interfaces "Do not use interfaces listed in Documentation/process/deprecated.rst."  
"Use folios rather than raw page operations for page cache management." Lustre is well underway in converting both the client and the server IO paths to folios.[2]
"Network filesystems should consider using the netfs library Documentation/filesystems/netfs_library.rst, or be prepared to explain why it is not a good fit." Lustre stripes files over several storage servers. It needs to maintain cache coherence whenever any server revokes a lock for a file range. This requires special callbacks that netfs doesn't support.
Provide userspace utilities "A mkfs tool is expected ..." Lustre maintains a mkfs.lustre tool.[3]
"A fsck tool is strongly recommended ..." Lustre uses existing local-disk filesystems (modified ext4 -> ldiskfs) for the individual storage targets, and e2fsck is used to repair local filesystem inconsistencies/corruption. Lustre has a dedicated online repair tool, LFSCK, that can detect and repair inconsistencies between the individual target filesystems.
Be testable "The filesystem must be testable in a meaningful way." "The fstests framework (also known as xfstests) is the standard testing infrastructure for Linux filesystems and its use is highly recommended." "At a minimum, there must be a credible and documented way to test the filesystem and detect regressions. When submitting, include a summary of test results indicating which tests pass, fail, or are not applicable." Lustre has a large body of existing tests[4] that are run continuously on all patches before integration[5]. Lustre is testable via fstests. We intend to submit fstests support when Lustre is being submitted upstream.
Provide documentation "A documentation file under Documentation/filesystems/ describing the filesystem, its on-disk format, mount options, and any notable design decisions is recommended." Lustre has a lot of existing documentation included in the sources for command-line tools and developers[6] that we will submit alongside the filesystem as appropriate. Lustre also has extensive online documentation for usage and administration.[7][8]

Community and Maintainership Expectations

Requirement Upstream guidance Lustre status
Identified maintainers   In no particular order - James Simmons, Timothy Day, Andreas Dilger, Oleg Drokin
Demonstrated commitment "A track record of maintaining kernel code -- for example, in other subsystems -- significantly strengthens the case for a new filesystem." Andreas Dilger is one of the long-time contributors to ext2/ext3/ext4/e2fsprogs. Many of the other Lustre developers contributed substantial features to ext4/e2fsprogs.
Sustained backing "Major filesystems in Linux have organizational or corporate support behind their development." A non-exhaustive list of domains of contributing organizations in the past 3 years: whamcloud.com, ddn.com, hpe.com, aeoncomputing.com, amazon.com, thelustrecollective.com, infradead.org, cea.fr, nvidia.com, oracle.com, suse.de, lanl.gov, google.com, llnl.gov, linaro.org, openchip.com, microsoft.com, tintri.com, gluesys.com, stanford.edu, cray.com, ornl.gov, jlab.org, intel.com, iastate.edu, eviden.com, codewreck.org, canonical.com, atos.net
Responsiveness "The maintainer is expected to respond to bug reports, address review feedback, and adapt the filesystem to VFS infrastructure changes such as folio conversions, iomap migration, and mount API updates." There is a longstanding Lustre issue tracking system that is open to the public (need free account to post issues) as well as Mailing_Lists_and_IRC for users, lustre-devel list for developers, and Slack channel.
User base "Clearly describe who the users of this filesystem are and the scale of the user base." Lustre users are widespread across universities and research organizations around the world (e.g. Stanford, UFlorida, ORNL, LLNL, LANL, NCSA, Cambridge, HLRS, CINECA, SFU, NASA), weather forecasting (NOAA, NCAR, DKRZ, ECMWF, BoM, UKMET), energy (CEA, BP, Total), medicine/genomics (Sanger, BGI, Cornell), LLM (NVIDIA, xAI, Anthropic, Softbank), and many other organizations that need high performance and high capacity storage. About 70% of the Top-500 supercomputers for the past 15+ years use Lustre, which implies at least many thousands of large systems use it, and at least hundreds of thousands of direct users. Lustre is freely available through multiple channels, so there is no way to tell the total number of users. There are also multiple vendors selling Lustre-based storage hardware and support offerings directly or indirectly: HPE, AWS, DDN, Google, Azure, Oracle, Aeon, TLC
Building your track record "A practical way to demonstrate many of the qualities above is to maintain the filesystem out-of-tree for a period before requesting a merge." Lustre has been in active development out-of-tree for over 25 years and has dozens of full-time developers and many more contributors.

References


Pending Work

Significant work has gone into improving the Lustre codebase since the Lustre client was removed from staging. Below are listed some of the major areas of ongoing work. This list is not comprehensive. The first ticket LU-12511 links to a lot of work that has been completed historically. This table will be updated periodically as new requirements emerge and as work becomes completed.

Task Status Notes Jira Patch(es)
Prepare Lustre for Adoption in the Linux kernel Incomplete This is the main Jira ticket - which links to other subtasks LU-12511 Various
IPv6 Support Complete Initial support in 2.16, finalized support in 2.17 LU-18417 Various
Enforce Linux kernel coding style Mostly Complete The majority of checkpatch.pl warnings have been addressed. We hope to get the baseline for Lustre similar to other in-tree filesystems. LU-6142 Various
Convert to kernel-doc comments Partially Complete Work is currently underway. LU-9633 Various
Unify Lustre kernel modules Incomplete Reduce the total number of Lustre kernel modules LU-17862 55153
Split userspace, compat, and kernel code Mostly Complete Split the core filesystem from the compatibility code needed to support older kernels LU-18687 Various
Replace libcfs hashing code with rhashtable In progress Most of the users on the client have been removed; the majority of the work is server-side LU-8130 Various
Adapt Lustre Infiniband driver to latest APIs In progress This is pending the transition to p2pdma API LU-8874 Various
Remove ProcFS users Incomplete Most of the users on the client have been removed; the majority of the work is server-side LU-8066 Various
Remove custom interval-tree Complete - LU-11085 Various
Transition completely to folios In progress A lot of callbacks have been implemented; still have dependency on mm/folio-compat.c; large folio support is in-flight LU-17916 Various
->writepage could likely be deprecated In progress Mostly a factor to ensure Lustre still behaves with this removed - context LU-18675 57894
Transition to p2pdma In progress Lustre should use upstream p2pdma framework rather than interfacing with out-of-tree modules LU-19848 Various
Don't use Autotools for kernel modules Mostly Complete Lustre kernel modules should not be built with Autotools LU-18876 Various
Don't use inline #ifdef for kernel compatibility In progress The core Lustre kernel docs should be free from extraneous #ifdefs - Various
Ensure that Lustre builds on all support architectures Incomplete Builds and runs on mainline 64-bit architectures (x86, aarch64, riscv), unlikely to ever be used on 32-bit or embedded platforms. - Various
Ensure Lustre can build !MODULE Mostly Complete Fix bugs when building Lustre into the kernel image LU-19874 Various

Proposed Transition to an Upstream-first Development Model

Split lustre tree.png

Background

Currently, the Lustre kernel modules are maintained as an out-of-tree driver. This driver supports a variety of vendor kernels (primarily on RHEL and Ubuntu). Code is developed first for these vendors kernels. It is later updated to support newer kernel as they are released. The core filesystem code and the compatibility code are intermixed.

For upstreaming to work, the normal development flow has to generate patches to mainline Linux. However, we must still support the older distribution kernels that most people use to run Lustre. To achieve this - we must invert the development model. Code must be developed first for the upstream kernel. Afterwards, this code will be supported on older kernels via a compatibility layer maintained by the Lustre development community. These next sections provide a high-level overview and defines a clear roadmap with tangible milestones on our path to upstream. This transition will occur in stages and will proceed in parallel with normal development - without interrupting ongoing feature work.

The timelines provided are approximate.

Tenets

There are several important considerations we must account for when undertaking this work (in order of importance):

  • Mainline Linux is the source of truth - Every Lustre release must be derived from a mainline Linux release. Code change to Lustre should target mainline Linux first - and later be backported as needed. We should not block upstream improvements to facilitate backporting.
  • Do not complicate the process of contributing to Lustre - Lustre has an active developer community and a large amount of pre-existing test infrastructure. Our existing processes have worked well. We should maintain the beneficial aspects of our existing workflows while transitioning to an upstream-first model.
  • Integrate with the wider filesystem community - We should strive to share Lustre's improvements and advancements with the wider filesystem community. We should regularly collaborate with others in the community to facilitate kernel-wide improvements.

[I] Separate the kernel code, compatibility code, and userspace code

ETA: June 2026

The Lustre tree should be reorganized to have a clear separation of concerns:

lustre/            -> Lustre filesystem kernel modules
lnet/              -> Lustre Networking kernel modules
lnet/debug/        -> Lustre debugging code
lustre_compat/     -> Kernel backwards compatibility code
tests/             -> Regression tests
utils/             -> Userspace tools

The functional components of libcfs/ will be split into lustre/, lnet/, and debug/. The kernel backwards compatibility components would live in lustre_compat/. Centralizing the compatibility code makes it easier to maintain and update and allows us to start removing the compatibility code (and #ifdefs) from the modules themselves. lustre_compat/ will be compiled into libcfs.ko. The debugging code in debug/ will be compiled into lnet.ko (or perhaps a standalone module).

The compatibility code will provide interfaces that mirror the upstream kernel-tree. After a new upstream kernel (with Lustre included) is released, we will update the compatibility layer as-needed to support that release on older kernels. A user of Lustre could either use the upstream kernel as-is with the in-tree Lustre modules - or they could compile and use those same modules on an LTS kernel release via the compatibility layer.

[II] Get lustre/ and lnet/ to natively compile on a mainline kernel

ETA: August 2026

Once the compatibility code is isolated, we must get lustre/ and lnet/ to natively compile on a mainline kernel - without any Autotools magic, #ifdefs, or lustre_compat/ layer.

This would be enforced by adding build validation to each patch submitted to the Lustre Gerrit. The kernel version would be pinned in the Lustre build scripts and we'd periodically update it and fix any new build failures.

Once this is achieved, we'll have a clean, idiomatic, mainline Linux client and server that can be run on older distributions via a compatibility layer.

[III] Move lustre/ and lnet/ to a separate kernel tree

ETA: February 2027 (This would immediately precede submission for inclusion)

Transition to maintaining lustre/ and lnet/ as a series on patches on top of a mainline kernel release. At this point, we'll generating patches to mainline Linux while retaining the ability to support older distro kernels via lustre_compat/. Similar to the previous step, we periodically rebase our Lustre patch series - fixing lustre_compat/ as needed.

This is the only step that requires a significant change the Lustre development workflow - patches would have to be split and sent to two different repositories. This step will be delayed until we're ready to submit Lustre upstream.

[IV] Submit the patch series for inclusion

ETA: February 2027

Once we are comfortable with the above process, we can submit the initial patches to add Lustre support to the kernel. Our normal development flow will generate a batch of patches to be submitted during each merge window. After the merge window, we can focus on testing and making sure that our backport to older distro kernels is still functional.



FAQ

Who will actually run the Lustre code in mainline Linux?
Everyone who uses Lustre would prefer that it is available via their existing kernel. Releases for older distros will be a combination of the upstream Lustre combined with lustre_compat/ and whatever stuff the kernel won't allow.
What will a Lustre release look like?
Userspace tools would be available separately from the kernel modules for users who use Lustre from the mainline kernel. For users with older kernels, we would generate packages/tarballs by combining an upstream Lustre release from mainline along with lustre_compat/ and the userspace tools. Vendors and third-parties can base their versions of Lustre on those packages/tarballs. Every time a new kernel releases - new Lustre release packages/tarball will be created. Lustre LTS releases can center around the LTS kernel releases.
How will we validate that lustre/ and lnet/ build on mainline before upstream submission?
A bot, ktest, will perform minimum build, boot, and mount testing for Lustre clients and servers on the latest mainline kernels. We will investigate integrating with KernelCI in the future.
Does anyone else have a similar model? Does this even work?
DRBD was upstreamed previously and maintains an out-of-tree copy of this code for support on LTS kernels. AMD GPU also seems to have a similar approach. We hope to talk to other developers working in a model similar to this.



Testing

Currently, ktest is used to validate that Lustre continues to build and run when integrated with the latest mainline kernels. In the future, it will also validate various kernel configurations and architecture builds. It will also perform various static checks and validations.

Lustre also has extensive build and testing against LTS kernels, as well as multiple static analysis tools checking the patches before integration.



Past Talks and Coverage

This section covers previous talks and coverage about the Lustre upstreaming process.

Lustre Administrators and Developers (LAD)

LAD 2022: Native Linux client Status - James Simmons

LAD 2020: Linux Lustre Client State - James Simmons

Lustre User Group (LUG)

LUG 2026: Upstream Efforts Progress - James Simmons

LUG 2025: Lustre Upstreaming Efforts - James Simmons

LUG 2024: Native Linux client Status - James Simmons

LUG 2019: Lustre - A view from the outside - Neil Brown

LSF/MM/eBPF

Lustre Upstreaming

Linux Weekly News (LWN)

Getting Lustre upstream

Will staging lose its Lustre?

Mailing List Archives

This is a collection of mailing list threads of interest - any useful discussion related to upstreaming Lustre.

Lustre Upstreaming Project Update (2026)

LSF/MM (2025)

Discussing Lustre Upstreaming with Lustre Developers (2025)

Lustre removed from staging