fs: don't use module helpers in non-modular code
Get series with b4
b4 am [email protected]Versions newest first · linked by author and title
- v2 Latest8 patches 5 repliesIn review
- v110 patches 5 repliesSuperseded
Patches in v2 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/8 | hugetlb: make mm and fs code explicitly non-modularfs/ mm/ | +3 | 2 replies | |
| 2/8 | fs: make notify dnotify.c explicitly non-modularfs/ | +1 | 0 replies | |
| 3/8 | fs: make fcntl.c explicitly non-modularfs/ | +1 | 0 replies | |
| 4/8 | fs: make filesystems.c explicitly non-modularfs/ | +1 | 0 replies | |
| 5/8 | fs: make locks.c explicitly non-modularfs/ | +1 | 1 reply | |
| 6/8 | fs: make direct-io.c explicitly non-modularfs/ | +2 | 0 replies | |
| 7/8 | fs: make devpts/inode.c explicitly non-modularfs/ | +1 | 2 replies | |
| 8/8 | fs: make binfmt_elf.c explicitly non-modularfs/ | +1 | 0 replies |
Reviews trailers per patch
2 of 8 patches have a Reviewed-by or Acked-by.
| Patch | Jeff Layton | Mike Kravetz | Davidlohr Bueso |
|---|---|---|---|
| 1/8 | R-b | A-b | |
| 2/8 | |||
| 3/8 | |||
| 4/8 | |||
| 5/8 | A-b | ||
| 6/8 | |||
| 7/8 | |||
| 8/8 |
Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 3 reviewers.
Cover letter [PATCH v2 0/8] fs: don't use module helpers in non-modular code
This series of commits is a slice of a larger project to ensure people don't needlessly use modular support functions in non-modular code. Overall there was roughly 5k lines of unused _exit code and ".remove" functions in the kernel due to this. So far we've fixed several areas, like tty, x86, net, etc. and we continue here in fs/
There are several reasons to not use module helpers for code that can never be built as a module, but the big ones are:
(1) it is easy to accidentally code up an unused module_exit function
(2) it can be misleading when reading the source, thinking it can be modular when the Makefile and/or Kconfig prohibit it
(3) it requires the include of the module.h header file which in turn includes nearly everything else, thus increasing CPP overhead.
Fortunately the code here is core fs code and not strictly a driver in the sense that a UART or GPIO driver is. So we don't have a lot of unused code to remove, and mainly gain in avoiding #2 and #3 above.
Here we convert some module_init() calls into fs_initcall(). In doing so we must note that this changes the init ordering slightly, since module_init() becomes device_initcall() in the non-modular case, and that comes after fs_initcall().
We could have used device_initcall here to strictly preserve the old ordering, and that largely makes sense for drivers/* dirs. But using device_initcall in the fs/ dir just seems wrong when we have the staged initcall system and a fs_initcall bucket in that tiered system.
The hugetlb patch warrants special mention. It has code in both the fs dir and the mm dir, with initcalls in each. There is an implicit requirement that the mm one be executed prior to the fs one, else the runtime will splat. Currently we achieve that only by luck of the link order. With the changes made here, we use our existing initcall buckets properly to guarantee that ordering.
Since I have a large queue, I'm hoping to get as many of these as possible in via maintainers, so that I'm not left someday asking Linus to pull a giant series.
[v1 --> v2: drop 2 patches merged elsewhere, combine mm & fs chunks
of hugetlb patch into one & update log accordingly.]
---
The following changes since commit 9f9499ae8e6415cefc4fe0a96ad0e27864353c89:
Linux 4.4-rc5 (2015-12-13 17:42:58 -0800)
are available in the git repository at:
git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux.git fs_initcall
for you to fetch changes up to 7763d3b42ca62dc967cc56218df8007401e63cd0:
fs: make binfmt_elf.c explicitly non-modular (2015-12-17 12:11:19 -0500)
----------------------------------------------------------------
Paul Gortmaker (8):
hugetlb: make mm and fs code explicitly non-modular
fs: make notify dnotify.c explicitly non-modular
fs: make fcntl.c explicitly non-modular
fs: make filesystems.c explicitly non-modular
fs: make locks.c explicitly non-modular
fs: make direct-io.c explicitly non-modular
fs: make devpts/inode.c explicitly non-modular
fs: make binfmt_elf.c explicitly non-modular
fs/binfmt_elf.c | 11 +---------- fs/devpts/inode.c | 3 +-- fs/direct-io.c | 4 ++-- fs/fcntl.c | 4 +--- fs/filesystems.c | 2 +- fs/hugetlbfs/inode.c | 27 ++------------------------- fs/locks.c | 3 +-- fs/notify/dnotify/dnotify.c | 4 +--- mm/hugetlb.c | 39 +-------------------------------------- 9 files changed, 11 insertions(+), 86 deletions(-)
Signature · 7 lines
2.6.1 -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"[email protected]"> [email protected] </a>