lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <1450379466-23115-1-git-send-email-paul.gortmaker@windriver.com>
Date:	Thu, 17 Dec 2015 14:10:58 -0500
From:	Paul Gortmaker <paul.gortmaker@...driver.com>
To:	<linux-kernel@...r.kernel.org>
CC:	Paul Gortmaker <paul.gortmaker@...driver.com>,
	Al Viro <viro@...iv.linux.org.uk>,
	Andrew Morton <akpm@...ux-foundation.org>,
	David Howells <dhowells@...hat.com>,
	Davidlohr Bueso <dave@...olabs.net>,
	David Rientjes <rientjes@...gle.com>,
	Eric Paris <eparis@...isplace.org>,
	Hillf Danton <hillf.zj@...baba-inc.com>,
	"J. Bruce Fields" <bfields@...ldses.org>,
	Jeff Layton <jlayton@...chiereds.net>,
	Josh Triplett <josh@...htriplett.org>,
	Mike Kravetz <mike.kravetz@...cle.com>,
	Nadia Yvette Chambers <nyc@...omorphy.com>,
	Naoya Horiguchi <n-horiguchi@...jp.nec.com>,
	Peter Hurley <peter@...leysoftware.com>,
	<linux-fsdevel@...r.kernel.org>, <linux-mm@...ck.org>
Subject: [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.]

---

Cc: Al Viro <viro@...iv.linux.org.uk>
Cc: Andrew Morton <akpm@...ux-foundation.org>
Cc: David Howells <dhowells@...hat.com>
Cc: Davidlohr Bueso <dave@...olabs.net>
Cc: David Rientjes <rientjes@...gle.com>
Cc: Eric Paris <eparis@...isplace.org>
Cc: Hillf Danton <hillf.zj@...baba-inc.com>
Cc: "J. Bruce Fields" <bfields@...ldses.org>
Cc: Jeff Layton <jlayton@...chiereds.net>
Cc: Josh Triplett <josh@...htriplett.org>
Cc: Mike Kravetz <mike.kravetz@...cle.com>
Cc: Nadia Yvette Chambers <nyc@...omorphy.com>
Cc: Naoya Horiguchi <n-horiguchi@...jp.nec.com>
Cc: Peter Hurley <peter@...leysoftware.com>
Cc: linux-fsdevel@...r.kernel.org
Cc: linux-mm@...ck.org

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(-)

-- 
2.6.1

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ