Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752749AbbLNQOI (ORCPT ); Mon, 14 Dec 2015 11:14:08 -0500 Received: from mail5.windriver.com ([192.103.53.11]:41689 "EHLO mail5.wrs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752653AbbLNQOG (ORCPT ); Mon, 14 Dec 2015 11:14:06 -0500 Date: Mon, 14 Dec 2015 11:14:03 -0500 From: Paul Gortmaker To: CC: Nadia Yvette Chambers , Alexander Viro , Subject: Re: [PATCH 09/10] fs: make hugetlbfs/inode.c explicitly non-modular Message-ID: <20151214161403.GA1067@windriver.com> References: <1449955812-10149-1-git-send-email-paul.gortmaker@windriver.com> <1449955812-10149-10-git-send-email-paul.gortmaker@windriver.com> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline In-Reply-To: <1449955812-10149-10-git-send-email-paul.gortmaker@windriver.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5315 Lines: 140 [[PATCH 09/10] fs: make hugetlbfs/inode.c explicitly non-modular] On 12/12/2015 (Sat 16:30) Paul Gortmaker wrote: > The Kconfig currently controlling compilation of this code is: > > config HUGETLBFS > bool "HugeTLB file system support" > > ...meaning that it currently is not being built as a module by anyone. > > Lets remove the modular code that is essentially orphaned, so that > when reading the driver there is no doubt it is builtin-only. > > Since module_init translates to device_initcall in the non-modular > case, the init ordering gets bumped to one level earlier when we > use the more appropriate fs_initcall here. However we've made similar > changes before without any fallout and none is expected here either. Famous last words. Turns out the 0-day builder found some fallout from what is presumably the initlevel change in one of its qemu boot tests, as per the snippet below that didn't show up in my testing. So we can't use this one as-is. Currently investigating the implicit initlevel dependency here to understand why it happens... Paul. -- BUG: unable to handle kernel NULL pointer dereference at 0000000000000018 IP: [] __lock_acquire+0x160/0x1a3f PGD 1b6a7067 PUD 1b711067 PMD 0 Oops: 0000 [#1] PREEMPT DEBUG_PAGEALLOC Modules linked in: CPU: 0 PID: 139 Comm: mount Not tainted 4.4.0-rc4-00009-g2e9d30b #1 Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS Debian-1.8.2-1 04/01/2014 task: ffff88001bcc0000 ti: ffff88001b720000 task.ti: ffff88001b720000 RIP: 0010:[] [] __lock_acquire+0x160/0x1a3f RSP: 0018:ffff88001b723890 EFLAGS: 00010002 RAX: 0000000000000046 RBX: 0000000000000000 RCX: 0000000000000000 RDX: 0000000000000000 RSI: 0000000000000000 RDI: 0000000000000018 RBP: ffff88001b723960 R08: 0000000000000001 R09: 0000000000000001 R10: ffff88001b723980 R11: 0000000000001e27 R12: 0000000000000000 R13: ffff88001bcc0000 R14: 0000000000000018 R15: 0000000000000001 FS: 00007f77a46bb840(0000) GS:ffffffff93220000(0000) knlGS:0000000000000000 CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 CR2: 0000000000000018 CR3: 000000001b703000 CR4: 00000000000006f0 Stack: 0000000000000400 0000000000000002 ffff88001bcc0000 0000000000000002 ffffffff9297f5b7 0000000100000000 ffff880000000000 0000000000000000 ffff88001bcc0000 ffff880000000000 ffffffff928ae160 ffff88001bcc0000 Call Trace: [] ? deactivate_slab+0x41c/0x919 [] ? mark_held_locks+0x5e/0x74 [] ? get_page_from_freelist+0x819/0xd4f [] lock_acquire+0x121/0x1c2 [] ? lock_acquire+0x121/0x1c2 [] ? deactivate_slab+0x41c/0x919 [] _raw_spin_lock+0x32/0x41 [] ? deactivate_slab+0x41c/0x919 [] deactivate_slab+0x41c/0x919 [] ? print_context_stack+0x6a/0xb6 [] ? preempt_count_sub+0x34/0x3f [] ? dump_trace+0x28a/0x2a2 [] ? hugetlbfs_alloc_inode+0x99/0xcc > > We delete the MODULE_LICENSE tag and capture that information at the > top of the file alongside author comments, etc. > > We don't replace module.h with init.h since the file already has that. > Also note that MODULE_ALIAS is a no-op for non-modular code. > > Cc: Nadia Yvette Chambers > Cc: Alexander Viro > Cc: linux-fsdevel@vger.kernel.org > Signed-off-by: Paul Gortmaker > --- > fs/hugetlbfs/inode.c | 27 ++------------------------- > 1 file changed, 2 insertions(+), 25 deletions(-) > > diff --git a/fs/hugetlbfs/inode.c b/fs/hugetlbfs/inode.c > index a1cb8fd2289b..47789292a582 100644 > --- a/fs/hugetlbfs/inode.c > +++ b/fs/hugetlbfs/inode.c > @@ -4,11 +4,11 @@ > * Nadia Yvette Chambers, 2002 > * > * Copyright (C) 2002 Linus Torvalds. > + * License: GPL > */ > > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > > -#include > #include > #include > #include /* remove ASAP */ > @@ -1202,7 +1202,6 @@ static struct file_system_type hugetlbfs_fs_type = { > .mount = hugetlbfs_mount, > .kill_sb = kill_litter_super, > }; > -MODULE_ALIAS_FS("hugetlbfs"); > > static struct vfsmount *hugetlbfs_vfsmount[HUGE_MAX_HSTATE]; > > @@ -1356,26 +1355,4 @@ static int __init init_hugetlbfs_fs(void) > out2: > return error; > } > - > -static void __exit exit_hugetlbfs_fs(void) > -{ > - struct hstate *h; > - int i; > - > - > - /* > - * Make sure all delayed rcu free inodes are flushed before we > - * destroy cache. > - */ > - rcu_barrier(); > - kmem_cache_destroy(hugetlbfs_inode_cachep); > - i = 0; > - for_each_hstate(h) > - kern_unmount(hugetlbfs_vfsmount[i++]); > - unregister_filesystem(&hugetlbfs_fs_type); > -} > - > -module_init(init_hugetlbfs_fs) > -module_exit(exit_hugetlbfs_fs) > - > -MODULE_LICENSE("GPL"); > +fs_initcall(init_hugetlbfs_fs) > -- > 2.6.1 > -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/