arXiv:2610.21925cs.SEOct 2026

Manuscript Offprint

arXiv:2610.21925

Benchmarking and Enhancing Design-Aware Code Review in the Linux Kernel

Zhenhao Zhou, Kai Yu, Ying Wang, Zhiqiang Yuan, Junhao Zeng, Yijian Wu, Chong Wang, Xin Peng

ZHENHAO ZHOU, Fudan University, China

KAI YU, Fudan University, China

YING WANG, Fudan University, China

ZHIQIANG YUAN, Fudan University, China

JUNHAO ZENG, Fudan University, China

YIJIAN WU, Fudan University, China

CHONG WANG, Nanyang Technological University, Singapore

XIN PENG ∗^{*}, Fudan University, China

Code review often requires reasoning beyond local correctness. In mature software systems, reviewers must recognize design trade-offs introduced by a proposed change, compare alternative solutions, and reason about their compatibility with project-specific constraints. We refer to this problem as design-aware code review. However, existing automated review approaches primarily focus on defects and correctness, while the design knowledge accumulated in historical review discussions remains difficult to reuse.

To address these challenges, we present DESIGNLORE, a knowledge-augmented approach that extracts design decisions from historical review discussions, organizes them into an adaptive design taxonomy, and reuses relevant historical knowledge to guide code review. We further construct DESIGNREVIEWBENCH, a benchmark derived from real patch-review histories for systematically evaluating design-aware code review. Our evaluation shows that design-aware review remains challenging for current coding agents, with the strongest baseline achieving an F1 of only 0.213 on design trade-off detection. In comparison, DESIGNLORE achieves an F1 of 0.259, a 21.6% relative improvement, and consistently delivers gains across different agent systems and backbone. These results highlight the importance of design-aware review and demonstrate the potential of recovering and reusing historical design knowledge to support it.

CCS Concepts: • Software and its engineering → Software evolution; Software verification and validation; • General and reference → Empirical studies.

Additional Key Words and Phrases: code review, Linux kernel, design knowledge, LLM agents

1 Introduction

Code review is a central quality-assurance activity in software development, particularly in long-lived systems such as the Linux kernel, where reviewers examine proposed changes before integration to identify and resolve potential problems [3]. With recent advances in large language models (LLMs) and LLM-based agents [13, 22, 41], a growing number of automated code-review approaches and benchmarks have been proposed [18–21, 40, 42]. These efforts, including the recent agent-based Sashiko [29], primarily focus on functional correctness or defects of the code changes.

In practice, effective review often extends beyond detecting local defects or checking functional correctness to evaluating design trade-offs. A proposed change reflects one design choice, but alternative solutions may also satisfy the same functional requirements with different advantages. Reviewers therefore need to understand the trade-offs among viable alternatives and determine which choice better fits the project's design principles and long-term needs. This consideration is particularly important in Linux kernel development, where development guidance explicitly asks contributors to consider how code will be maintained years after it is merged [35]. For example, when clearing huge pages in the memfd patch shown in Figure 1, reviewers suggested replacing folio_zero_range() with folio_zero_user(). Both are functionally correct but make different

∗^{*}Corresponding author.

Zhenhao Zhou, Kai Yu, Ying Wang, Zhiqiang Yuan, Junhao Zeng, Yijian Wu, Chong Wang, and Xin Peng

Figure

Fig. 1. A motivating example from the Linux kernel mm subsystem.

trade-offs: the former favors throughput, while the latter favors scheduling responsiveness. The choice depends on the preemption configuration rather than functional correctness alone.

We refer to this problem as design-aware code review, which goes beyond local correctness checking to identify and reason about the design trade-offs underlying code changes. Such reasoning may draw on information recorded in historical review discussions [5, 39, 47]. In the Linux kernel, these discussions take place on public mailing lists and capture design considerations at multiple levels of granularity, including the alternatives considered, their advantages and disadvantages, and the reasoning behind the final decisions. They may therefore offer useful context when similar design problems arise in future patches. For example, as shown in Figure 1, an April 2025 discussion of a different patch series considered the trade-off between bulk clearing and scheduling responsiveness, with a reviewer proposing bounded clearing batches with periodic rescheduling. The discussion thus provides relevant context for the later choice in the memfd patch.

However, whether this opportunity matters in practice remains unclear: how frequently code review entails design trade-offs and how often similar design problems recur in ways that make historical decisions relevant. To answer these questions, we conduct a formative study on the memory-management (mm) subsystem of the Linux kernel, whose public review process provides rich historical discussions and traceable patch revisions. Analyzing design decisions across many review threads through manual inspection alone is impractical. Relevant reasoning is often fragmented across multiple replies, interleaved with implementation details and procedural discussions, and expressed at different levels of abstraction. We therefore propose an automated pipeline that reconstructs each design decision discussed in a thread, together with the alternatives considered and their trade-offs, into a structured decision case. Applying it to 600 threads sampled between 2021 and 2026 yields 1,774 decision cases, whose quality we validate through human evaluation.

Based on the mined cases, the study confirms that design trade-offs are common in practice: 60.29% of the sampled threads involve at least one design trade-off, and 33.91% contain a problem with a relevant historical precedent. It also shows that exploiting such precedents is non-trivial: the reasoning behind a decision must first be recovered from fragmented discussions, a relevant precedent often concerns different code and terminology than the new patch, and a historical resolution applies only if its conditions still hold in the current code. The challenge is therefore not the absence of historical design knowledge, but how to recover, organize, and reuse it effectively.

Guided by the findings, we present DESIGNLORE, a knowledge-augmented approach for design-aware code review. DESIGNLORE first applies the extraction pipeline to review history to build a knowledge base of decision cases, then organizes them into an adaptive, project-specific design taxonomy based on the code patterns that trigger each case, enabling precedents to be retrieved from a new patch's code rather than surface text. At review time, DESIGNLORE uses the taxonomy and relevant historical decisions to guide the analysis of a target patch, helping the agent identify and validate design trade-offs against the current code and project context.

We construct DESIGNREVIEWBENCH from real patch-review histories of the Linux kernel, comprising 72 patch series and 79 reference design trade-offs. Each benchmark instance pairs a proposed patch series with the codebase snapshot available at review time and captures the design trade-offs revealed by subsequent human review. We compare DESIGNLORE with state-of-the-art general-purpose coding agents, specialized code-review systems, and retrieval-augmented agents that access raw historical review emails. The results show that design-aware code review remains challenging for current agents: the strongest baseline, Sashiko [29], achieves an F1 of 0.213. In contrast, DESIGNLORE achieves the best trade-off detection performance, with an F1 of 0.259, a 21.6% relative improvement at roughly half of Sashiko's review cost. The improvement persists across three agent systems and four backbone models. The cumulative ablation shows incremental F1 improvements, with the largest increase observed when adding the planning and validation workflow.

In summary, this paper makes the following contributions:

• An empirical characterization of design-aware code review. We analyze historical Linux kernel reviews to characterize the prevalence and recurrence of design trade-offs and the challenges of reusing historical design knowledge.

• A knowledge-augmented agentic code review approach. We present DESIGNLORE, which extracts design knowledge from historical reviews, organizes it into an adaptive design taxonomy, and reuses relevant decisions to guide new patch reviews.

• A benchmark for design-aware code review. We construct DESIGNREVIEWBENCH from real historical patch-review discussions to evaluate whether coding agents can identify design trade-offs exposed by proposed changes.

• A comprehensive empirical evaluation. We evaluate DESIGNLORE against general-purpose, review-specialized, and retrieval-augmented coding agents, demonstrating its effectiveness across diverse agents and backbone models.

References (20)