All of lore.kernel.org
 help / color / mirror / Atom feed
* [MODALTS v0.1 4/4] add modules deps alternatives description
@ 2024-05-10 11:21 Valerii Chernous
  2024-06-28 21:55 ` Lucas De Marchi
  0 siblings, 1 reply; 7+ messages in thread
From: Valerii Chernous @ 2024-05-10 11:21 UTC (permalink / raw)
  To: linux-modules; +Cc: xe-linux-external, Nicolas Schier, Lucas De Marchi

Cc: xe-linux-external@cisco.com
Cc: Valerii Chernous <vchernou@cisco.com>
Signed-off-by: Valerii Chernous <vchernou@cisco.com>
---
 README.deps.alternatives.txt | 40 ++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)
 create mode 100644 README.deps.alternatives.txt

diff --git a/README.deps.alternatives.txt b/README.deps.alternatives.txt
new file mode 100644
index 0000000..9ad3ce5
--- /dev/null
+++ b/README.deps.alternatives.txt
@@ -0,0 +1,40 @@
+Modules alternatives feature allow to calculate dependency alternatives
+during build time and aviod to regenerate modules db into runtime
+
+To enable deps alternatives calculation use "-D" flag with depmod,
+it will create indexes modules.alternatives and modules.alternatives.bin
+This indexes will be used by modprobe in runtime
+By default modprobe will load first(primary/major) dependency from list
+If it required to load alternative module, it should be done manually before
+loading main modules set.
+For example systemd service that detect platform type can load required platform
+modules and after it run main device initialization
+In case when alternative module loaded, modprobe detect this and skip to load primary
+dependency
+
+modules deps alternatives generation basic algorithm description
+1. Load modules information(imported/exported symbols)
+2. Find depended symbol alternatives(create list available symbols
+   alternatives instead of storing last one)
+3. Choise primary/major alternative per depended symbol correspond to
+   build time dependency(build time deps getting from module info section)
+4. Create a list of dependency modules alternatives correspond to next rule:
+4.1 All modules alternatives for module dependency should provide all symbols
+    from primary/major dependency module
+5 Store modules alternatives index(modules.alternatives) as key:value where
+key is a pair depended#_#primary_depency,
+value is list of all modules that provide all symbols from primary_depency
+for depended module
+
+Note:
+Current implementation/algorithm doesn't cover variant where requred symbols
+from primary deps provided by more that one modules. Exporting all symbols in
+alternative depency that used by depended module from primary_depency is
+mandatory!
+
+Note:
+modules.dep index different for standard/basic and modules alternatives algorithms
+modules.dep for modules alternatives algorithm contain only direct dependencies and
+full dependency list will be calculated into runtime correspond to preferred alternative.
+modules.dep for standard/basic algorithm contain full dependency list for module and
+can't be changed during runtime without rebuild database via depmod
-- 
2.35.6


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2024-07-24 12:54 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-05-10 11:21 [MODALTS v0.1 4/4] add modules deps alternatives description Valerii Chernous
2024-06-28 21:55 ` Lucas De Marchi
2024-07-01  9:23   ` Valerii Chernous -X (vchernou - GLOBALLOGIC INC at Cisco)
2024-07-01 11:33     ` Nicolas Schier
2024-07-01 12:51       ` Valerii Chernous -X (vchernou - GLOBALLOGIC INC at Cisco)
2024-07-03 14:27         ` Lucas De Marchi
2024-07-24 12:53           ` Valerii Chernous -X (vchernou - GLOBALLOGIC INC at Cisco)

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.