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
| ||
|
Date: Fri, 01 Mar 2013 16:16:32 -0800 From: Davidlohr Bueso <davidlohr.bueso@...com> To: Rik van Riel <riel@...hat.com>, Linus Torvalds <torvalds@...ux-foundation.org> Cc: Thomas Gleixner <tglx@...utronix.de>, Steven Rostedt <rostedt@...dmis.org>, "Vinod, Chegu" <chegu_vinod@...com>, "Low, Jason" <jason.low2@...com>, linux-tip-commits@...r.kernel.org, Peter Zijlstra <a.p.zijlstra@...llo.nl>, "H. Peter Anvin" <hpa@...or.com>, Andrew Morton <akpm@...ux-foundation.org>, aquini@...hat.com, Michel Lespinasse <walken@...gle.com>, Ingo Molnar <mingo@...nel.org>, Larry Woodman <lwoodman@...hat.com>, Linux Kernel Mailing List <linux-kernel@...r.kernel.org> Subject: [RFC PATCH 0/2] ipc: do not hold ipc lock more than necessary The following set of not-thoroughly-tested patches are based on the discussion of holding the ipc lock unnecessarily, such as for permissions and security checks: https://lkml.org/lkml/2013/2/28/540 Patch 0/1: Introduces new functions, analogous to ipc_lock and ipc_lock_check in the ipc utility code, allowing to obtain the ipc object without holding the lock. Patch 0/2: Use the new functions and only acquire the ipc lock when needed. With Rik's semop-multi.c microbenchmark we can see the following results: 256 sems without patches: + 59.40% a.out [kernel.kallsyms] [k] _raw_spin_lock + 6.14% a.out [kernel.kallsyms] [k] sys_semtimedop + 3.84% a.out [kernel.kallsyms] [k] avc_has_perm_flags + 3.64% a.out [kernel.kallsyms] [k] __audit_syscall_exit + 2.06% a.out [kernel.kallsyms] [k] copy_user_enhanced_fast_string + 1.86% a.out [kernel.kallsyms] [k] ipc_lock + 1.75% a.out [kernel.kallsyms] [k] __audit_syscall_entry + 1.69% a.out [kernel.kallsyms] [k] ipc_has_perm.isra.21 + 1.47% a.out [kernel.kallsyms] [k] do_smart_update + 1.43% a.out [kernel.kallsyms] [k] pid_vnr + 1.39% a.out [kernel.kallsyms] [k] try_atomic_semop.isra.5 total operations: 151452270, ops/sec 5048409 256 sems with patches: + 17.47% a.out [kernel.kallsyms] [k] _raw_spin_lock + 11.08% a.out [kernel.kallsyms] [k] sys_semtimedop + 8.81% a.out [kernel.kallsyms] [k] avc_has_perm_flags + 7.96% a.out [kernel.kallsyms] [k] ipc_has_perm.isra.21 + 6.50% a.out [kernel.kallsyms] [k] __audit_syscall_exit + 4.67% a.out [kernel.kallsyms] [k] ipc_obtain_object_check + 4.19% a.out [kernel.kallsyms] [k] ipcperms + 3.75% a.out [kernel.kallsyms] [k] copy_user_enhanced_fast_string + 3.38% a.out [kernel.kallsyms] [k] system_call + 3.05% a.out [kernel.kallsyms] [k] try_atomic_semop.isra.5 + 2.70% a.out [kernel.kallsyms] [k] do_smart_update + 2.60% a.out [kernel.kallsyms] [k] __audit_syscall_entry total operations: 266502912, ops/sec 8883430 While the _raw_spin_lock time is drastically reduced, others do increase. This results in an overall speedup of ~1.7x regarding ops/sec. -- 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