Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753418Ab3HaCfo (ORCPT ); Fri, 30 Aug 2013 22:35:44 -0400 Received: from zeniv.linux.org.uk ([195.92.253.2]:35789 "EHLO ZenIV.linux.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752504Ab3HaCfm (ORCPT ); Fri, 30 Aug 2013 22:35:42 -0400 Date: Sat, 31 Aug 2013 03:35:16 +0100 From: Al Viro To: Waiman Long Cc: Linus Torvalds , Ingo Molnar , Benjamin Herrenschmidt , Jeff Layton , Miklos Szeredi , Ingo Molnar , Thomas Gleixner , linux-fsdevel , Linux Kernel Mailing List , Peter Zijlstra , Steven Rostedt , Andi Kleen , "Chandramouleeswaran, Aswin" , "Norton, Scott J" Subject: Re: [PATCH v7 1/4] spinlock: A new lockref structure for lockless update of refcount Message-ID: <20130831023516.GI13318@ZenIV.linux.org.uk> References: <5220E56A.80603@hp.com> <5220F090.5050908@hp.com> <20130830194059.GC13318@ZenIV.linux.org.uk> <5220F811.9060902@hp.com> <20130830202608.GD13318@ZenIV.linux.org.uk> <52210225.60805@hp.com> <20130830204852.GE13318@ZenIV.linux.org.uk> <52214EBC.90100@hp.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <52214EBC.90100@hp.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 2206 Lines: 51 On Fri, Aug 30, 2013 at 10:02:36PM -0400, Waiman Long wrote: > I slapped in the code segment, and the following was logged: > > [ 340.871590] type = tmpfs > [ 340.871712] [] __fput+0x23d/0x270 > [ 340.871715] [] ____fput+0x9/0x10 > [ 340.871719] [] task_work_run+0xb1/0xe0 > [ 340.871724] [] do_notify_resume+0x80/0x1b0 > [ 340.871728] [] ? ipc_lock+0x30/0x50 > [ 340.871732] [] ? remove_vma+0x56/0x60 > [ 340.871736] [] ? do_munmap+0x34f/0x380 > [ 340.871741] [] int_signal+0x12/0x17 > [ 340.871744] ---[ end trace aafa6c45f3388d65 ]--- Aha... OK, I see what's going on. We end up with shm_mnt *not* marked as long-living vfsmount, even though it lives forever. See if the following helps; if it does (and I very much expect it to), we want to put it in -stable. As it is, you get slow path in mntput() each time a file created by shmem_file_setup() gets closed. For no reason whatsoever... Signed-off-by: Al Viro --- diff --git a/mm/shmem.c b/mm/shmem.c index e43dc55..445162c 100644 --- a/mm/shmem.c +++ b/mm/shmem.c @@ -2615,7 +2615,7 @@ int shmem_fill_super(struct super_block *sb, void *data, int silent) * tmpfs instance, limiting inodes to one per page of lowmem; * but the internal instance is left unlimited. */ - if (!(sb->s_flags & MS_NOUSER)) { + if (!(sb->s_flags & MS_KERNMOUNT)) { sbinfo->max_blocks = shmem_default_max_blocks(); sbinfo->max_inodes = shmem_default_max_inodes(); if (shmem_parse_options(data, sbinfo, false)) { @@ -2831,8 +2831,7 @@ int __init shmem_init(void) goto out2; } - shm_mnt = vfs_kern_mount(&shmem_fs_type, MS_NOUSER, - shmem_fs_type.name, NULL); + shm_mnt = kern_mount(&shmem_fs_type); if (IS_ERR(shm_mnt)) { error = PTR_ERR(shm_mnt); printk(KERN_ERR "Could not kern_mount tmpfs\n"); -- 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/