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: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Thu,  4 Apr 2013 10:53:39 -0500
From:	Nathan Zimmer <nzimmer@....com>
To:	viro@...iv.linux.org.uk, akpm@...ux-foundation.org
Cc:	linux-kernel@...r.kernel.org, linux-fsdevel@...r.kernel.org,
	Nathan Zimmer <nzimmer@....com>,
	"Eric W. Biederman" <ebiederm@...ssion.com>,
	David Woodhouse <dwmw2@...radead.org>, <stable@...r.kernel.org>
Subject: [PATCH resend] fs/proc: Move kfree outside pde_unload_lock

This moves a kfree outside a spinlock to help scaling on larger (512 core)
systems.  This should be some relief until we can move the section to use
the rcu.

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: "Eric W. Biederman" <ebiederm@...ssion.com> 
Cc: Andrew Morton <akpm@...ux-foundation.org> 
Cc: Alexander Viro <viro@...iv.linux.org.uk>
Cc: David Woodhouse <dwmw2@...radead.org>
Cc: <stable@...r.kernel.org>
Acked-by: Alexey Dobriyan <adobriyan@...il.com>
Signed-off-by: Nathan Zimmer <nzimmer@....com>
---
 fs/proc/inode.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/fs/proc/inode.c b/fs/proc/inode.c
index 439ae688..863608b 100644
--- a/fs/proc/inode.c
+++ b/fs/proc/inode.c
@@ -403,11 +403,10 @@ static int proc_reg_release(struct inode *inode, struct file *file)
 	}
 	pde->pde_users++;
 	release = pde->proc_fops->release;
-	if (pdeo) {
+	if (pdeo)
 		list_del(&pdeo->lh);
-		kfree(pdeo);
-	}
 	spin_unlock(&pde->pde_unload_lock);
+	kfree(pdeo);
 
 	if (release)
 		rv = release(inode, file);
-- 
1.8.1.2

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