channelNews
DEVOPS+ Research Laboratory Makes New Research Progress on Stale Comment Maintenance in the Linux Kernel


The Linux kernel is under continuous, rapid evolution, and its functions are frequently renamed, split, or removed—yet the code comments that reference them are not automatically updated to match. Such "stale function references" are not merely a readability issue — they can mislead maintainers, hinder code comprehension, and in some cases signal deeper underlying defects. One case (as shown in Figure 1) indicates that a comment referencing the function hw_perf_group_sched_in() remained unchanged even though the function itself had been deleted back in 2010. Upon closer inspection, the researchers found that the conditional branch tied to this comment had, as a result, become unreachable dead code — the kind of unnecessary bloat that concerns both maintainers and security auditors working to reduce the kernel's attack surface.



Figure 1 Out-of-date function and its repair in Linux kernel


Prior research on code-comment consistency has mostly focused on semantic misalignment between a function and its directly associated comment, and struggles to detect broken references caused by the independent evolution of functions defined elsewhere in the codebase. According to the paper's data, among cases where the originally referenced entity could be located, 60.5% of comment references pointed to functions in other files. To address this problem, Associate Professor Hongyu Kuang from the DEVOPS+ Research Laboratory at Nanjing University and his PhD student Kexin Sun, in collaboration with Professor David Lo and his PhD student Yunbo Lyu from Singapore Management University, and Professor Julia Lawall from Inria (French National Institute for Research in Digital Science and Technology), proposed ReCite, a detection-and-repair approach for stale function references in Linux kernel comments, designed to answer how such references can be identified, traced, repaired, and evaluated.


ReCite consists of three stages. First, it extracts function-form symbols (tokens of the form foo()) from comments and combines text search with Coccinelle-based static analysis to determine whether a matching function still exists in the current codebase. Next, ReCite traces back to the historical version of the codebase at which the reference was first introduced into the comment, identifies the code entity the comment originally referred to, and then follows the function's renames, splits, and removals forward through the Git history to construct an evolution tree. Finally, the system feeds the the evolution history and the related context into a large language model to generate a history-grounded repair suggestion.



Figure 2 The overall pipeline of ReCite for detecting and repairing stale function references


The research team evaluated ReCite on Linux kernel v6.18-rc1. From around 62,000 files, the team analyzed 2.27 million code comments and extracted 49,302 distinct function-form symbols, corresponding to 83,241 references. Through staged filtering, entity localization, and evolution tracing, ReCite identified 869 stale function references worth repairing and generated repair suggestions for each. In a manual evaluation of 200 randomly sampled suggestions, 178 (89.0%) provide useful repair guidance, including 85 (42.5%) directly applicable} repairs and 93 (46.5%) partially acceptable ones that need minor manual refinement before direct application.


To test whether these results can genuinely support software maintenance, the research team submitted 75 repair patches to the Linux kernel community. Until the date of publication, 50 patches had been merged into maintainer trees or the Linux mainline. One maintainer, reviewing a patch, remarked: "We must have missed this comment ... a few years ago"—the line from which the paper takes its title.


The resulting paper, "We Must Have Missed This Comment: Detecting and Repairing Stale Function References in Linux Kernel Comments," has been accepted by the 41st IEEE/ACM International Conference on Automated Software Engineering (ASE 2026), a CCF-A Rank international conference. Nanjing University is the first affiliation. Yucong Guan, Jiaqi Sun, Yifeng Pan, Zhenyan Song, and Yuxuan Li also contribute to this study.


Kexin Sun is jointly supervised by Professor Xiaoxing Ma and Associate Professor Hongyu Kuang. Her main research interests include code review, software traceability, and mining software repositories with text and sentiment analysis. Her work has been published in leading software engineering venues such as TSE, ASE, and ICPC. Students who are interested in related research topics are welcomed to join the DevOps+ Research Laboratory and the Sqd.HUM research group (Software's Qualified Development of, by, for the HUManity).