/proc/modules 中标记为 (F) 的模块

/proc/modules 中标记为 (F) 的模块

在我的 3.10 系统上,/proc/modules 中列出的一些模块被标记为 (F)。我想找出这个问题的原因(F)。我确信模块没有被强制加载并且是用内核构建的。您能指出什么内核代码创建了 /proc/modules 吗?

usb_storage 56610 0 - Live 0xffffffffa005d000 (F)

如果我卸载并重新加载该模块,(F) 就会消失。

答案1

输出中的列/proc/modules如下所示。

usb_storage 56610 0    -   Live 0xffffffffa005d000 (F)
  (1)        (2) (3)  (4)  (5)         (6)         (7)

笔记:我发现没有提及似乎是第七列的内容,但我将其标记为这样,因为第六列的描述(见下文)没有涵盖那里显示的信息。

摘录-http://www.centos.org/docs/5/html/Deployment_Guide-en-US/s1-proc-topfiles.html

  • 第一列包含模块的名称。
  • 第二列指模块的内存大小,以字节为单位。
  • 第三列列出当前加载的模块实例数。零值表示已卸载的模块。
  • 第四列说明该模块是否依赖于另一个模块才能运行,并列出了那些其他模块。
  • 第五列列出了模块所处的负载状态:Live、Loading 或 Unloading 是唯一可能的值。
  • 第六列列出了已加载模块的当前内核内存偏移量。此信息可用于调试目的,或用于分析工具(例如 oprofile)。

我相信标有(即第七列)的列(F)来自此文件中的此处 -panic.c

/**
 *  print_tainted - return a string to represent the kernel taint state.
 *
 *  'P' - Proprietary module has been loaded.
 *  'F' - Module has been forcibly loaded.
 *  'S' - SMP with CPUs not designed for SMP.
 *  'R' - User forced a module unload.
 *  'M' - System experienced a machine check exception.
 *  'B' - System has hit bad_page.
 *  'U' - Userspace-defined naughtiness.
 *  'D' - Kernel has oopsed before
 *  'A' - ACPI table overridden.
 *  'W' - Taint on warning.
 *  'C' - modules from drivers/staging are loaded.
 *  'I' - Working around severe firmware bug.
 *  'O' - Out-of-tree module has been loaded.
 *  'E' - Unsigned module has been loaded.
 *
 *  The string is overwritten by the next call to print_tainted().
 */

这些代码是存在于中的位掩码的表示kernel.txt以及参考文档。

tainted:

 Non-zero if the kernel has been tainted.  Numeric values, which
 can be ORed together:

    1 - A module with a non-GPL license has been loaded, this
        includes modules with no license.
        Set by modutils >= 2.4.9 and module-init-tools.
    2 - A module was force loaded by insmod -f.
        Set by modutils >= 2.4.9 and module-init-tools.
    4 - Unsafe SMP processors: SMP with CPUs not designed for SMP.
    8 - A module was forcibly unloaded from the system by rmmod -f.
   16 - A hardware machine check error occurred on the system.
   32 - A bad page was discovered on the system.
   64 - The user has asked that the system be marked "tainted".  This
        could be because they are running software that directly modifies
        the hardware, or for other reasons.
  128 - The system has died.
  256 - The ACPI DSDT has been overridden with one supplied by the user
         instead of using the one provided by the hardware.
  512 - A kernel warning has occurred.
 1024 - A module from drivers/staging was loaded.
 2048 - The system is working around a severe firmware bug.
 4096 - An out-of-tree module has been loaded.
 8192 - An unsigned module has been loaded in a kernel supporting module
        signature.

参考

相关内容