Project

General

Profile

Actions

Feature #14560

open

nvme has unnecessary dependency on misc/sata

Added by Thirteen Oxide 4 months ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Start date:
Due date:
% Done:

0%

Estimated time:
Difficulty:
Bite-size
Tags:
Gerrit CR:

Description

The nvme driver has a DT_NEEDED entry for misc/sata; the sole function it consumes from this module is `sata_split_model` which references no other functions or data in misc/sata and consists of 19 lines of basic string parsing. Because misc/sata also depends on misc/scsi, around 538 K of otherwise unnecessary modules have to be delivered and loaded into memory even on machines that have no SATA or SCSI devices (which includes machines that can never have any hardware support whatsoever for these technologies). While that may seem trivial, it can be significant in constrained miniroots and would be worse if we wanted to support embedded platforms. However insignificant the problem may seem, the solution is even more trivial: this function can be made generic and moved into its own misc module, but it's so tiny that it could simply be inlined into a header instead. The function compiles to 173 bytes and is called from exactly 3 sites, one each in drv/mptsas, drv/nvme, and misc/sata itself. On increasingly common NVMe-only machines, that's a free half MiB of DRAM in exchange for 346 bytes (practically speaking, 0 bytes since it's unlikely to spill onto another page) on machines that actually have SATA.

No data to display

Actions

Also available in: Atom PDF