-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor struct device to reduce RAM demands #26072
Comments
Some data on options: #25208 makes
#26127 moves immutable data to
Note that you cannot compare between the two PRs because they have different bases. I'd have to rebase 25208 on the same master commit as 26127 for a fair comparison. Also note that the difference due to master changes between the base versions is comparable to the difference from applying either approach. We're looking at memory usage changes that are on the order of one or two percent of real application RAM usage. At this point absent consensus it may be best to just keep going with the current architecture until there's a plan for device rework that's based on validated requirements and supported by committed resources. |
struct device is now const. We don't yet have generic device RAM support, but that's not this issue. |
#22941 proposes a suite of upgrades to the device infrastructure. An initial step made in that process was to move values from a separate
config_info
structure intostruct device
directly. This was driven by a goal of makingstruct device
instancesconst
qualified and so storable in ROM, based on the observation that the only required non-const portion of that structure is a flag that indicates whether the device successfully initiated (flag currently implemented as nulling the API pointer).#25208 evaluated the practicality of this change concluding that it's not feasible, in part because too much API expects to represent
struct device *
invoid *
, and castingconst
away opens the possibility of writing through a pointer-to-const which produces undefined behavior. Dev-review also raised the possibility of runtime instantiation of devices.We must make a decision whether to support const
struct device
instances. If not, we should reverse the course initiated by #23407 and instead move the immutable portions ofstruct device
back to a secondary structure that isconst
-qualified.This affects progress on #22545 which requires adding more immutable state to
struct device
to represent dependency information.The text was updated successfully, but these errors were encountered: