From: Valerii Chernous <vchernou@cisco.com>
To: linux-modules@vger.kernel.org
Cc: xe-linux-external@cisco.com, Nicolas Schier <n.schier@avm.de>,
Lucas De Marchi <lucas.de.marchi@gmail.com>
Subject: [MODALTS v0.1 4/4] add modules deps alternatives description
Date: Fri, 10 May 2024 04:21:28 -0700 [thread overview]
Message-ID: <20240510112128.2417494-4-vchernou@cisco.com> (raw)
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
next reply other threads:[~2024-05-10 11:22 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-10 11:21 Valerii Chernous [this message]
2024-06-28 21:55 ` [MODALTS v0.1 4/4] add modules deps alternatives description 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)
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240510112128.2417494-4-vchernou@cisco.com \
--to=vchernou@cisco.com \
--cc=linux-modules@vger.kernel.org \
--cc=lucas.de.marchi@gmail.com \
--cc=n.schier@avm.de \
--cc=xe-linux-external@cisco.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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.