[lkml]   [1996]   [Sep]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
SubjectRe: Module Versioning Problems
On Mon, 16 Sep 1996, Hans Lermen wrote:

> On Sun, 15 Sep 1996, Alan Cox wrote:
> > We have a nasty module version bug at the moment as genksyms version ids
> > for SMP and uniprocessor kernels match but the code doesnt work from
> > one to the other (in fact getting it wrong can lose you things like
> > file systems).
> >
> > [ ... ]
> > Am I right in thinking I can do this... and if so would the modules folks
> > care to confirm it and submit the change to Linus
> >
> > #ifdef __SMP__ /* SMP machine */
> > /* Generate symbol_S0123456 */
> > #define _set_ver(sym,vers) sym ## _S ## vers
> > #else
> > /* Generate symbol_R0123456 */
> > #define _set_ver(sym,vers) sym ## _R ## vers
> > #endif /* SMP */
> >
> Yes, I guess this would work though it needs to adapt the modules package.
> However, it doesn't solve the problem for non-MODVERSION compilations.
> For these we would need a variable in kernel (e.g. smp_num_cpus), which
> is compiled in also in non-SMP kernel (currently it is #ifdef __SMP__).
> The modules, if compiled under SMP should have a reference to this
> variable (could be in <linux/module.h>) and insmod could take care of the rest.
> This solution would solve both cases, with or without MODVERSION and the
> changes in the modules package are minimal.

To avoid confusion, SMP module should be thrown in
/lib/modules/kernel-version.SMP/. This would allow one to boot a SMP
kernel and then a non SMP kernel and still have all his modules
operationnal. A simple change in modprobe/depmod would select the proper
directory. Currently, the default is to select the directory this way

/lib/modules/`uname -r`/

We could define a different scheme (by looking in /proc/somewhere) to look
up the proper directory.

As for a solution to fully differentiate non versioned module, we should
simply define a simpler mangling such as just add _S at the end of any
kernel symbol using the same strategy as used for versionning. Not even a
change to the module package, except to automate the location.

What do you think!

Jacques Gelinas (
Linuxconf: The ultimate administration system for Linux.

 \ /
  Last update: 2005-03-22 13:38    [W:0.076 / U:3.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site