linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] fs/proc: Move kfree outside pde_unload_lock
@ 2012-08-22 16:38 Nathan Zimmer
  2012-08-22 16:38 ` [PATCH] fs/prof: Update comment on pde_unload_lock Nathan Zimmer
  2012-08-22 18:28 ` [PATCH] fs/proc: Move kfree outside pde_unload_lock Eric Dumazet
  0 siblings, 2 replies; 15+ messages in thread
From: Nathan Zimmer @ 2012-08-22 16:38 UTC (permalink / raw)
  Cc: linux-kernel, linux-fsdevel, adobriyan, Nathan Zimmer,
	Alexander Viro, David Woodhouse

This moves a kfree outside a spinlock to help scaling on larger (512 core)
systems.

I ran a simple test which just reads from /proc/cpuinfo.
Lower is better, as you can see the worst case scenario is improved.

	baseline	moved kfree
tasks	read-sec	read-sec
1	0.0141		0.0141
2	0.0140		0.0140
4	0.0140		0.0141
8	0.0145		0.0145
16	0.0553		0.0548
32	0.1688		0.1622
64	0.5017		0.3856
128	1.7005		0.9710
256	5.2513		2.6519
512	8.0529		6.2976

Cc: Alexander Viro <viro@zeniv.linux.org.uk>
Cc: David Woodhouse <dwmw2@infradead.org>
Acked-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: Nathan Zimmer <nzimmer@sgi.com>
---
 fs/proc/inode.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 7ac817b..bf36266 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -403,9 +403,9 @@ static int proc_reg_release(struct inode *inode, struct file *file)
 	release = pde->proc_fops->release;
 	if (pdeo) {
 		list_del(&pdeo->lh);
-		kfree(pdeo);
 	}
 	spin_unlock(&pde->pde_unload_lock);
+	kfree(pdeo);
 
 	if (release)
 		rv = release(inode, file);
-- 
1.6.0.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-09-17 15:57 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-22 16:38 [PATCH] fs/proc: Move kfree outside pde_unload_lock Nathan Zimmer
2012-08-22 16:38 ` [PATCH] fs/prof: Update comment on pde_unload_lock Nathan Zimmer
2012-08-22 18:28 ` [PATCH] fs/proc: Move kfree outside pde_unload_lock Eric Dumazet
2012-08-22 21:42   ` Eric Dumazet
2012-08-23 17:54     ` Nathan Zimmer
2012-08-24 14:48     ` Nathan Zimmer
2012-08-24 14:58       ` Eric Dumazet
2012-08-24 16:45         ` Nathan Zimmer
2012-08-24 21:43           ` Nathan Zimmer
2012-08-28 20:38     ` Alexey Dobriyan
2012-08-29  4:11       ` Eric Dumazet
2012-08-29  8:32         ` Alexey Dobriyan
2012-08-29 13:50         ` Alexey Dobriyan
2012-08-29 14:24           ` Eric Dumazet
2012-09-17 15:57             ` Nathan Zimmer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).