mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Eric Dumazet <dada1@cosmosbay.com>,
	David Miller <davem@davemloft.net>,
	rjw@sisk.pl, linux-kernel@vger.kernel.org,
	kernel-testers@vger.kernel.org, cl@linux-foundation.org,
	efault@gmx.de, a.p.zijlstra@chello.nl,
	Stephen Hemminger <shemminger@vyatta.com>
Subject: (avc_has_perm_noaudit()) Re: [Bug #11308] tbench regression on each kernel release from 2.6.22 -&gt; 2.6.28
Date: Mon, 17 Nov 2008 21:20:18 +0100	[thread overview]
Message-ID: <20081117202018.GB12020@elte.hu> (raw)
In-Reply-To: <20081117184951.GA5585@elte.hu>


* Ingo Molnar <mingo@elte.hu> wrote:

> 100.000000 total
> ................
>   3.934833 avc_has_perm_noaudit

this one seems spread out:

                      hits (total: 393483 hits)
                 .........
ffffffff80312af3:     1426 <avc_has_perm_noaudit>:
ffffffff80312af3:     1426 	41 57                	push   %r15
ffffffff80312af5:     6124 	41 56                	push   %r14
ffffffff80312af7:        0 	41 55                	push   %r13
ffffffff80312af9:     1443 	41 89 f5             	mov    %esi,%r13d
ffffffff80312afc:     1577 	41 54                	push   %r12
ffffffff80312afe:        0 	41 89 fc             	mov    %edi,%r12d
ffffffff80312b01:     1310 	55                   	push   %rbp
ffffffff80312b02:     1531 	53                   	push   %rbx
ffffffff80312b03:        3 	48 83 ec 68          	sub    $0x68,%rsp
ffffffff80312b07:     2202 	85 c9                	test   %ecx,%ecx
ffffffff80312b09:        0 	89 4c 24 0c          	mov    %ecx,0xc(%rsp)
ffffffff80312b0d:      550 	44 89 44 24 08       	mov    %r8d,0x8(%rsp)
ffffffff80312b12:     1572 	4c 89 0c 24          	mov    %r9,(%rsp)
ffffffff80312b16:        0 	66 89 54 24 12       	mov    %dx,0x12(%rsp)
ffffffff80312b1b:      588 	75 04                	jne    ffffffff80312b21 <avc_has_perm_noaudit+0x2e>
ffffffff80312b1d:        0 	0f 0b                	ud2a   
ffffffff80312b1f:        0 	eb fe                	jmp    ffffffff80312b1f <avc_has_perm_noaudit+0x2c>
ffffffff80312b21:     1646 	0f b7 44 24 12       	movzwl 0x12(%rsp),%eax
ffffffff80312b26:      829 	48 c7 c2 d0 26 93 80 	mov    $0xffffffff809326d0,%rdx
ffffffff80312b2d:      589 	89 44 24 14          	mov    %eax,0x14(%rsp)
ffffffff80312b31:      698 	65 8b 04 25 24 00 00 	mov    %gs:0x24,%eax
ffffffff80312b38:        0 	00 
ffffffff80312b39:      791 	89 c0                	mov    %eax,%eax
ffffffff80312b3b:      549 	48 c1 e0 03          	shl    $0x3,%rax
ffffffff80312b3f:      791 	48 03 05 fa 30 5a 00 	add    0x5a30fa(%rip),%rax        # ffffffff808b5c40 <_cpu_pda>
ffffffff80312b46:      864 	48 8b 00             	mov    (%rax),%rax
ffffffff80312b49:      533 	48 03 50 08          	add    0x8(%rax),%rdx
ffffffff80312b4d:      732 	ff 02                	incl   (%rdx)
ffffffff80312b4f:      860 	8b 54 24 14          	mov    0x14(%rsp),%edx
ffffffff80312b53:     1259 	e8 54 fc ff ff       	callq  ffffffff803127ac <avc_hash>
ffffffff80312b58:     2087 	48 98                	cltq   
ffffffff80312b5a:     1015 	48 89 44 24 18       	mov    %rax,0x18(%rsp)
ffffffff80312b5f:        0 	48 c1 e0 04          	shl    $0x4,%rax
ffffffff80312b63:     2944 	4c 8d b8 60 6b a9 80 	lea    -0x7f5694a0(%rax),%r15
ffffffff80312b6a:       71 	48 8b 80 60 6b a9 80 	mov    -0x7f5694a0(%rax),%rax
ffffffff80312b71:     3943 	eb 1a                	jmp    ffffffff80312b8d <avc_has_perm_noaudit+0x9a>
ffffffff80312b73:     5184 	44 3b 23             	cmp    (%rbx),%r12d
ffffffff80312b76:    62007 	75 11                	jne    ffffffff80312b89 <avc_has_perm_noaudit+0x96>
ffffffff80312b78:       11 	66 8b 44 24 12       	mov    0x12(%rsp),%ax
ffffffff80312b7d:        0 	66 3b 43 08          	cmp    0x8(%rbx),%ax
ffffffff80312b81:    11115 	75 06                	jne    ffffffff80312b89 <avc_has_perm_noaudit+0x96>
ffffffff80312b83:        4 	44 3b 6b 04          	cmp    0x4(%rbx),%r13d
ffffffff80312b87:    14224 	74 1a                	je     ffffffff80312ba3 <avc_has_perm_noaudit+0xb0>
ffffffff80312b89:        1 	48 8b 43 28          	mov    0x28(%rbx),%rax
ffffffff80312b8d:     6921 	48 8d 58 d8          	lea    -0x28(%rax),%rbx
ffffffff80312b91:     9654 	48 8b 43 28          	mov    0x28(%rbx),%rax
ffffffff80312b95:      414 	0f 18 08             	prefetcht0 (%rax)
ffffffff80312b98:      227 	48 8d 43 28          	lea    0x28(%rbx),%rax
ffffffff80312b9c:     9617 	4c 39 f8             	cmp    %r15,%rax
ffffffff80312b9f:     1402 	75 d2                	jne    ffffffff80312b73 <avc_has_perm_noaudit+0x80>
ffffffff80312ba1:        0 	eb 41                	jmp    ffffffff80312be4 <avc_has_perm_noaudit+0xf1>
ffffffff80312ba3:        0 	83 7b 20 01          	cmpl   $0x1,0x20(%rbx)
ffffffff80312ba7:      671 	0f 84 70 02 00 00    	je     ffffffff80312e1d <avc_has_perm_noaudit+0x32a>
ffffffff80312bad:        0 	c7 43 20 01 00 00 00 	movl   $0x1,0x20(%rbx)
ffffffff80312bb4:        0 	e9 64 02 00 00       	jmpq   ffffffff80312e1d <avc_has_perm_noaudit+0x32a>
ffffffff80312bb9:     2118 	65 8b 14 25 24 00 00 	mov    %gs:0x24,%edx
ffffffff80312bc0:        0 	00 
ffffffff80312bc1:     8245 	89 d2                	mov    %edx,%edx
ffffffff80312bc3:        0 	48 c7 c0 d0 26 93 80 	mov    $0xffffffff809326d0,%rax
ffffffff80312bca:      511 	48 c1 e2 03          	shl    $0x3,%rdx
ffffffff80312bce:    11308 	48 03 15 6b 30 5a 00 	add    0x5a306b(%rip),%rdx        # ffffffff808b5c40 <_cpu_pda>
ffffffff80312bd5:        0 	48 8b 12             	mov    (%rdx),%rdx
ffffffff80312bd8:       35 	48 03 42 08          	add    0x8(%rdx),%rax
ffffffff80312bdc:     2224 	ff 40 04             	incl   0x4(%rax)
ffffffff80312bdf:        1 	e9 06 01 00 00       	jmpq   ffffffff80312cea <avc_has_perm_noaudit+0x1f7>
ffffffff80312be4:        0 	65 8b 14 25 24 00 00 	mov    %gs:0x24,%edx
ffffffff80312beb:        0 	00 
ffffffff80312bec:        0 	89 d2                	mov    %edx,%edx
ffffffff80312bee:        0 	48 c7 c0 d0 26 93 80 	mov    $0xffffffff809326d0,%rax
ffffffff80312bf5:        0 	48 8d 6c 24 30       	lea    0x30(%rsp),%rbp
ffffffff80312bfa:        0 	48 c1 e2 03          	shl    $0x3,%rdx
ffffffff80312bfe:        0 	48 03 15 3b 30 5a 00 	add    0x5a303b(%rip),%rdx        # ffffffff808b5c40 <_cpu_pda>
ffffffff80312c05:        0 	44 89 ee             	mov    %r13d,%esi
ffffffff80312c08:        0 	4c 8d 45 0c          	lea    0xc(%rbp),%r8
ffffffff80312c0c:        0 	44 89 e7             	mov    %r12d,%edi
ffffffff80312c0f:        0 	48 8b 12             	mov    (%rdx),%rdx
ffffffff80312c12:        0 	48 03 42 08          	add    0x8(%rdx),%rax
ffffffff80312c16:        0 	ff 40 08             	incl   0x8(%rax)
ffffffff80312c19:        0 	8b 4c 24 0c          	mov    0xc(%rsp),%ecx
ffffffff80312c1d:        0 	8b 54 24 14          	mov    0x14(%rsp),%edx
ffffffff80312c21:        0 	e8 ee 0a 01 00       	callq  ffffffff80323714 <security_compute_av>
ffffffff80312c26:        0 	85 c0                	test   %eax,%eax
ffffffff80312c28:        0 	41 89 c6             	mov    %eax,%r14d
ffffffff80312c2b:        0 	0f 85 02 02 00 00    	jne    ffffffff80312e33 <avc_has_perm_noaudit+0x340>
ffffffff80312c31:        0 	8b 7c 24 4c          	mov    0x4c(%rsp),%edi
ffffffff80312c35:        0 	be 01 00 00 00       	mov    $0x1,%esi
ffffffff80312c3a:        0 	e8 a5 fb ff ff       	callq  ffffffff803127e4 <avc_latest_notif_update>
ffffffff80312c3f:        0 	85 c0                	test   %eax,%eax
ffffffff80312c41:        0 	0f 85 9c 00 00 00    	jne    ffffffff80312ce3 <avc_has_perm_noaudit+0x1f0>
ffffffff80312c47:        0 	e8 23 fd ff ff       	callq  ffffffff8031296f <avc_alloc_node>
ffffffff80312c4c:        0 	48 85 c0             	test   %rax,%rax
ffffffff80312c4f:        0 	48 89 c3             	mov    %rax,%rbx
ffffffff80312c52:        0 	0f 84 8b 00 00 00    	je     ffffffff80312ce3 <avc_has_perm_noaudit+0x1f0>
ffffffff80312c58:        0 	8b 4c 24 14          	mov    0x14(%rsp),%ecx
ffffffff80312c5c:        0 	49 89 e8             	mov    %rbp,%r8
ffffffff80312c5f:        0 	44 89 e6             	mov    %r12d,%esi
ffffffff80312c62:        0 	48 89 c7             	mov    %rax,%rdi
ffffffff80312c65:        0 	44 89 ea             	mov    %r13d,%edx
ffffffff80312c68:        0 	e8 5d fb ff ff       	callq  ffffffff803127ca <avc_node_populate>
ffffffff80312c6d:        0 	48 8b 44 24 18       	mov    0x18(%rsp),%rax
ffffffff80312c72:        0 	48 8d 2c 85 60 8b a9 	lea    -0x7f5674a0(,%rax,4),%rbp
ffffffff80312c79:        0 	80 
ffffffff80312c7a:        0 	48 89 ef             	mov    %rbp,%rdi
ffffffff80312c7d:        0 	e8 44 3c 20 00       	callq  ffffffff805168c6 <_spin_lock_irqsave>
ffffffff80312c82:        0 	49 8b 37             	mov    (%r15),%rsi
ffffffff80312c85:        0 	49 89 c6             	mov    %rax,%r14
ffffffff80312c88:        0 	eb 24                	jmp    ffffffff80312cae <avc_has_perm_noaudit+0x1bb>
ffffffff80312c8a:        0 	44 39 26             	cmp    %r12d,(%rsi)
ffffffff80312c8d:        0 	75 1b                	jne    ffffffff80312caa <avc_has_perm_noaudit+0x1b7>
ffffffff80312c8f:        0 	44 39 6e 04          	cmp    %r13d,0x4(%rsi)
ffffffff80312c93:        0 	75 15                	jne    ffffffff80312caa <avc_has_perm_noaudit+0x1b7>
ffffffff80312c95:        0 	66 8b 44 24 12       	mov    0x12(%rsp),%ax
ffffffff80312c9a:        0 	66 39 46 08          	cmp    %ax,0x8(%rsi)
ffffffff80312c9e:        0 	75 0a                	jne    ffffffff80312caa <avc_has_perm_noaudit+0x1b7>
ffffffff80312ca0:        0 	48 89 df             	mov    %rbx,%rdi
ffffffff80312ca3:        0 	e8 9e fb ff ff       	callq  ffffffff80312846 <avc_node_replace>
ffffffff80312ca8:        0 	eb 2c                	jmp    ffffffff80312cd6 <avc_has_perm_noaudit+0x1e3>
ffffffff80312caa:        0 	48 8b 76 28          	mov    0x28(%rsi),%rsi
ffffffff80312cae:        0 	48 83 ee 28          	sub    $0x28,%rsi
ffffffff80312cb2:        0 	48 8b 56 28          	mov    0x28(%rsi),%rdx
ffffffff80312cb6:        0 	48 8d 46 28          	lea    0x28(%rsi),%rax
ffffffff80312cba:        0 	4c 39 f8             	cmp    %r15,%rax
ffffffff80312cbd:        0 	0f 18 0a             	prefetcht0 (%rdx)
ffffffff80312cc0:        0 	75 c8                	jne    ffffffff80312c8a <avc_has_perm_noaudit+0x197>
ffffffff80312cc2:        0 	48 8d 43 28          	lea    0x28(%rbx),%rax
ffffffff80312cc6:        0 	48 89 53 28          	mov    %rdx,0x28(%rbx)
ffffffff80312cca:        0 	4c 89 78 08          	mov    %r15,0x8(%rax)
ffffffff80312cce:        0 	48 89 46 28          	mov    %rax,0x28(%rsi)
ffffffff80312cd2:        0 	48 89 42 08          	mov    %rax,0x8(%rdx)
ffffffff80312cd6:        0 	4c 89 f6             	mov    %r14,%rsi
ffffffff80312cd9:        0 	48 89 ef             	mov    %rbp,%rdi
ffffffff80312cdc:        0 	e8 20 3d 20 00       	callq  ffffffff80516a01 <_spin_unlock_irqrestore>
ffffffff80312ce1:        0 	eb 07                	jmp    ffffffff80312cea <avc_has_perm_noaudit+0x1f7>
ffffffff80312ce3:        0 	48 8d 44 24 30       	lea    0x30(%rsp),%rax
ffffffff80312ce8:        0 	eb 06                	jmp    ffffffff80312cf0 <avc_has_perm_noaudit+0x1fd>
ffffffff80312cea:     2116 	48 89 d8             	mov    %rbx,%rax
ffffffff80312ced:     7632 	45 31 f6             	xor    %r14d,%r14d
ffffffff80312cf0:        1 	48 83 3c 24 00       	cmpq   $0x0,(%rsp)
ffffffff80312cf5:      404 	74 10                	je     ffffffff80312d07 <avc_has_perm_noaudit+0x214>
ffffffff80312cf7:     1804 	48 8d 70 0c          	lea    0xc(%rax),%rsi
ffffffff80312cfb:        0 	b9 05 00 00 00       	mov    $0x5,%ecx
ffffffff80312d00:      378 	48 8b 3c 24          	mov    (%rsp),%rdi
ffffffff80312d04:     8174 	fc                   	cld    
ffffffff80312d05:    26860 	f3 a5                	rep movsl %ds:(%rsi),%es:(%rdi)
ffffffff80312d07:    11573 	8b 40 0c             	mov    0xc(%rax),%eax
ffffffff80312d0a:     1997 	f7 d0                	not    %eax
ffffffff80312d0c:        0 	85 44 24 0c          	test   %eax,0xc(%rsp)
ffffffff80312d10:        0 	0f 84 1d 01 00 00    	je     ffffffff80312e33 <avc_has_perm_noaudit+0x340>
ffffffff80312d16:        0 	f6 44 24 08 01       	testb  $0x1,0x8(%rsp)
ffffffff80312d1b:        0 	0f 85 f4 00 00 00    	jne    ffffffff80312e15 <avc_has_perm_noaudit+0x322>
ffffffff80312d21:        0 	83 3d 5c 66 78 00 00 	cmpl   $0x0,0x78665c(%rip)        # ffffffff80a99384 <selinux_enforcing>
ffffffff80312d28:        0 	74 10                	je     ffffffff80312d3a <avc_has_perm_noaudit+0x247>
ffffffff80312d2a:        0 	44 89 e7             	mov    %r12d,%edi
ffffffff80312d2d:        0 	e8 87 f9 00 00       	callq  ffffffff803226b9 <security_permissive_sid>
ffffffff80312d32:        0 	85 c0                	test   %eax,%eax
ffffffff80312d34:        0 	0f 84 db 00 00 00    	je     ffffffff80312e15 <avc_has_perm_noaudit+0x322>
ffffffff80312d3a:        0 	e8 30 fc ff ff       	callq  ffffffff8031296f <avc_alloc_node>
ffffffff80312d3f:        0 	48 85 c0             	test   %rax,%rax
ffffffff80312d42:        0 	48 89 c5             	mov    %rax,%rbp
ffffffff80312d45:        0 	0f 84 e8 00 00 00    	je     ffffffff80312e33 <avc_has_perm_noaudit+0x340>
ffffffff80312d4b:        0 	48 8b 44 24 18       	mov    0x18(%rsp),%rax
ffffffff80312d50:        0 	48 8d 04 85 60 8b a9 	lea    -0x7f5674a0(,%rax,4),%rax
ffffffff80312d57:        0 	80 
ffffffff80312d58:        0 	48 89 c7             	mov    %rax,%rdi
ffffffff80312d5b:        0 	48 89 44 24 28       	mov    %rax,0x28(%rsp)
ffffffff80312d60:        0 	e8 61 3b 20 00       	callq  ffffffff805168c6 <_spin_lock_irqsave>
ffffffff80312d65:        0 	49 8b 1f             	mov    (%r15),%rbx
ffffffff80312d68:        0 	48 89 44 24 20       	mov    %rax,0x20(%rsp)
ffffffff80312d6d:        0 	eb 1a                	jmp    ffffffff80312d89 <avc_has_perm_noaudit+0x296>
ffffffff80312d6f:        0 	44 3b 23             	cmp    (%rbx),%r12d
ffffffff80312d72:        0 	75 11                	jne    ffffffff80312d85 <avc_has_perm_noaudit+0x292>
ffffffff80312d74:        0 	44 3b 6b 04          	cmp    0x4(%rbx),%r13d
ffffffff80312d78:        0 	75 0b                	jne    ffffffff80312d85 <avc_has_perm_noaudit+0x292>
ffffffff80312d7a:        0 	66 8b 44 24 12       	mov    0x12(%rsp),%ax
ffffffff80312d7f:        0 	66 3b 43 08          	cmp    0x8(%rbx),%ax
ffffffff80312d83:        0 	74 1a                	je     ffffffff80312d9f <avc_has_perm_noaudit+0x2ac>
ffffffff80312d85:        0 	48 8b 5b 28          	mov    0x28(%rbx),%rbx
ffffffff80312d89:        0 	48 83 eb 28          	sub    $0x28,%rbx
ffffffff80312d8d:        0 	48 8b 43 28          	mov    0x28(%rbx),%rax
ffffffff80312d91:        0 	0f 18 08             	prefetcht0 (%rax)
ffffffff80312d94:        0 	48 8d 43 28          	lea    0x28(%rbx),%rax
ffffffff80312d98:        0 	4c 39 f8             	cmp    %r15,%rax
ffffffff80312d9b:        0 	75 d2                	jne    ffffffff80312d6f <avc_has_perm_noaudit+0x27c>
ffffffff80312d9d:        0 	eb 29                	jmp    ffffffff80312dc8 <avc_has_perm_noaudit+0x2d5>
ffffffff80312d9f:        0 	8b 4c 24 14          	mov    0x14(%rsp),%ecx
ffffffff80312da3:        0 	44 89 e6             	mov    %r12d,%esi
ffffffff80312da6:        0 	48 89 ef             	mov    %rbp,%rdi
ffffffff80312da9:        0 	49 89 d8             	mov    %rbx,%r8
ffffffff80312dac:        0 	44 89 ea             	mov    %r13d,%edx
ffffffff80312daf:        0 	e8 16 fa ff ff       	callq  ffffffff803127ca <avc_node_populate>
ffffffff80312db4:        0 	8b 44 24 0c          	mov    0xc(%rsp),%eax
ffffffff80312db8:        0 	09 45 0c             	or     %eax,0xc(%rbp)
ffffffff80312dbb:        0 	48 89 de             	mov    %rbx,%rsi
ffffffff80312dbe:        0 	48 89 ef             	mov    %rbp,%rdi
ffffffff80312dc1:        0 	e8 80 fa ff ff       	callq  ffffffff80312846 <avc_node_replace>
ffffffff80312dc6:        0 	eb 3c                	jmp    ffffffff80312e04 <avc_has_perm_noaudit+0x311>
ffffffff80312dc8:        0 	48 8b 3d a9 65 78 00 	mov    0x7865a9(%rip),%rdi        # ffffffff80a99378 <avc_node_cachep>
ffffffff80312dcf:        0 	48 89 ee             	mov    %rbp,%rsi
ffffffff80312dd2:        0 	e8 7b c6 f7 ff       	callq  ffffffff8028f452 <kmem_cache_free>
ffffffff80312dd7:        0 	65 8b 04 25 24 00 00 	mov    %gs:0x24,%eax
ffffffff80312dde:        0 	00 
ffffffff80312ddf:        0 	89 c0                	mov    %eax,%eax
ffffffff80312de1:        0 	48 c7 c2 d0 26 93 80 	mov    $0xffffffff809326d0,%rdx
ffffffff80312de8:        0 	48 c1 e0 03          	shl    $0x3,%rax
ffffffff80312dec:        0 	48 03 05 4d 2e 5a 00 	add    0x5a2e4d(%rip),%rax        # ffffffff808b5c40 <_cpu_pda>
ffffffff80312df3:        0 	48 8b 00             	mov    (%rax),%rax
ffffffff80312df6:        0 	48 03 50 08          	add    0x8(%rax),%rdx
ffffffff80312dfa:        0 	ff 42 14             	incl   0x14(%rdx)
ffffffff80312dfd:        0 	f0 ff 0d 60 65 78 00 	lock decl 0x786560(%rip)        # ffffffff80a99364 <avc_cache+0x2804>
ffffffff80312e04:        0 	48 8b 74 24 20       	mov    0x20(%rsp),%rsi
ffffffff80312e09:        0 	48 8b 7c 24 28       	mov    0x28(%rsp),%rdi
ffffffff80312e0e:        0 	e8 ee 3b 20 00       	callq  ffffffff80516a01 <_spin_unlock_irqrestore>
ffffffff80312e13:        0 	eb 1e                	jmp    ffffffff80312e33 <avc_has_perm_noaudit+0x340>
ffffffff80312e15:        0 	41 be f3 ff ff ff    	mov    $0xfffffff3,%r14d
ffffffff80312e1b:        0 	eb 16                	jmp    ffffffff80312e33 <avc_has_perm_noaudit+0x340>
ffffffff80312e1d:    35502 	8b 44 24 0c          	mov    0xc(%rsp),%eax
ffffffff80312e21:     4360 	23 43 10             	and    0x10(%rbx),%eax
ffffffff80312e24:        0 	3b 44 24 0c          	cmp    0xc(%rsp),%eax
ffffffff80312e28:        0 	0f 85 b6 fd ff ff    	jne    ffffffff80312be4 <avc_has_perm_noaudit+0xf1>
ffffffff80312e2e:   104641 	e9 86 fd ff ff       	jmpq   ffffffff80312bb9 <avc_has_perm_noaudit+0xc6>
ffffffff80312e33:     2106 	48 83 c4 68          	add    $0x68,%rsp
ffffffff80312e37:        1 	44 89 f0             	mov    %r14d,%eax
ffffffff80312e3a:     2068 	5b                   	pop    %rbx
ffffffff80312e3b:        0 	5d                   	pop    %rbp
ffffffff80312e3c:        8 	41 5c                	pop    %r12
ffffffff80312e3e:     2001 	41 5d                	pop    %r13
ffffffff80312e40:        0 	41 5e                	pop    %r14
ffffffff80312e42:      162 	41 5f                	pop    %r15
ffffffff80312e44:     2107 	c3                   	retq   

its main callsite is:

  ffffffff8031368c:     2809 <avc_has_perm>:
  [...]
  ffffffff803136b6:      651 	e8 38 f4 ff ff       	callq  ffffffff80312af3 <avc_has_perm_noaudit>

avc_has_perm() usage is spread out amongst 3 callsites in 2 selinux 
functions:

selinux_ip_postroute():
  ffffffff80314d02:      491 	e8 85 e9 ff ff       	callq  ffffffff8031368c <avc_has_perm>

selinux_socket_sock_rcv_skb():
  ffffffff80314eea:      461 	e8 9d e7 ff ff       	callq  ffffffff8031368c <avc_has_perm>
  ffffffff80314faf:      476 	e8 d8 e6 ff ff       	callq  ffffffff8031368c <avc_has_perm>

related to networking.

regarding avc_has_perm_noaudit() itself, it has a couple of hot spots:

ffffffff80312b73:     5184 	44 3b 23             	cmp    (%rbx),%r12d
ffffffff80312b76:    62007 	75 11                	jne    ffffffff80312b89 <avc_has_perm_noaudit+0x96>

quick guess: cache-cold-miss site.

ffffffff80312d04:     8174 	fc                   	cld    
ffffffff80312d05:    26860 	f3 a5                	rep movsl %ds:(%rsi),%es:(%rdi)

quick guess: unnecessary initialization of something largish via 
memset. Probably:

  security/selinux/avc.c:avc_has_perm_noaudit()'s:
  [...]
        if (avd)
                memcpy(avd, &p_ae->avd, sizeof(*avd));

but one of the fattest ones:

ffffffff80312e28:        0 	0f 85 b6 fd ff ff    	jne    ffffffff80312be4 <avc_has_perm_noaudit+0xf1>
ffffffff80312e2e:   104641 	e9 86 fd ff ff       	jmpq   ffffffff80312bb9 <avc_has_perm_noaudit+0xc6>
ffffffff80312e33:     2106 	48 83 c4 68          	add    $0x68,%rsp

that seems to be either a branch mispredict (seems a tad expensive for 
that though), or a cachemiss delayed to the first non-predicted 
branch. Ah, that's most likely the case, we fall through straight from 
here:

ffffffff80312dfd:        0      f0 ff 0d 60 65 78 00    lock decl 0x786560(%rip)

that's an atomic op of some global address, in the hotpath. Not good.

the wider context is:

ffffffff80312e1d:    35502 	8b 44 24 0c          	mov    0xc(%rsp),%eax
ffffffff80312e21:     4360 	23 43 10             	and    0x10(%rbx),%eax
ffffffff80312e24:        0 	3b 44 24 0c          	cmp    0xc(%rsp),%eax
ffffffff80312e28:        0 	0f 85 b6 fd ff ff    	jne    ffffffff80312be4 <avc_has_perm_noaudit+0xf1>
ffffffff80312e2e:   104641 	e9 86 fd ff ff       	jmpq   ffffffff80312bb9 <avc_has_perm_noaudit+0xc6>
ffffffff80312e33:     2106 	48 83 c4 68          	add    $0x68,%rsp

ah, yes. My guess is that the "and (%rbx)" at ffffffff80312e21 
generated this miss, and this all is avc_update_node()'s 
for-each-list-loop, and:

        spin_lock_irqsave(&avc_cache.slots_lock[hvalue], flag);

that hash doesnt seem to be working well here. It's done via:

static inline int avc_hash(u32 ssid, u32 tsid, u16 tclass)
{
        return (ssid ^ (tsid<<2) ^ (tclass<<4)) & (AVC_CACHE_SLOTS - 1);
}

AVC_CACHE_SLOTS is 512 - but my usecase is likely has a much narrower 
hash key space than that. Increasing the hash wont work, these kind of 
things really only start scaling once some natural per-CPU construct 
is found to it.

And things like this:

        /* cache hit */
        if (atomic_read(&ret->ae.used) != 1)
                atomic_set(&ret->ae.used, 1);

in avc_search_node() dont really help either as they immediately dirty 
the cacheline in the cache-hit case. Hashed fastpath lookup really 
should only be used to validate security rules in a read-mostly way, 
and cachelines should never be dirtied, as long as it can be avoided.

Anyway, this function needs a good scalability look as it represents 
3.9% of the total tbench cost. I'd not be surprised if it was possible 
more than half of that cost via not too ugly changes.

	Ingo

  parent reply	other threads:[~2008-11-17 20:21 UTC|newest]

Thread overview: 185+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-16 17:38 2.6.28-rc5: Reported regressions 2.6.26 -> 2.6.27 Rafael J. Wysocki
2008-11-16 17:38 ` [Bug #11207] VolanoMark regression with 2.6.27-rc1 Rafael J. Wysocki
2008-11-16 17:40 ` [Bug #11308] tbench regression on each kernel release from 2.6.22 -&gt; 2.6.28 Rafael J. Wysocki
2008-11-17  9:06   ` Ingo Molnar
2008-11-17  9:14     ` David Miller
2008-11-17 11:01       ` Ingo Molnar
2008-11-17 11:20         ` Eric Dumazet
2008-11-17 16:11           ` Ingo Molnar
2008-11-17 16:35             ` Eric Dumazet
2008-11-17 17:08               ` Ingo Molnar
2008-11-17 17:25                 ` Ingo Molnar
2008-11-17 17:33                   ` Eric Dumazet
2008-11-17 17:38                     ` Linus Torvalds
2008-11-17 17:42                       ` Eric Dumazet
2008-11-17 18:23                       ` Ingo Molnar
2008-11-17 18:33                         ` Linus Torvalds
2008-11-17 18:49                         ` Ingo Molnar
2008-11-17 19:30                           ` Eric Dumazet
2008-11-17 19:39                           ` David Miller
2008-11-17 19:43                             ` Eric Dumazet
2008-11-17 19:55                             ` Linus Torvalds
2008-11-17 20:16                               ` David Miller
2008-11-17 20:30                                 ` Linus Torvalds
2008-11-17 20:58                                   ` David Miller
2008-11-18  9:44                                     ` Nick Piggin
2008-11-18 15:58                                       ` Linus Torvalds
2008-11-19  4:31                                         ` Nick Piggin
2008-11-20  9:14                                         ` David Miller
2008-11-20  9:06                                       ` David Miller
2008-11-18 12:29                             ` Mike Galbraith
2008-11-17 19:57                           ` Ingo Molnar
2008-11-17 20:20                           ` Ingo Molnar [this message]
2008-11-17 20:32                           ` ip_queue_xmit(): " Ingo Molnar
2008-11-17 20:57                             ` Eric Dumazet
2008-11-18  9:12                             ` Nick Piggin
2008-11-17 20:47                           ` Ingo Molnar
2008-11-17 20:56                             ` Eric Dumazet
2008-11-17 20:55                           ` skb_release_head_state(): " Ingo Molnar
2008-11-17 21:01                             ` David Miller
2008-11-17 21:04                             ` Eric Dumazet
2008-11-17 21:34                             ` Linus Torvalds
2008-11-17 21:38                               ` Ingo Molnar
2008-11-17 21:09                           ` tcp_ack(): " Ingo Molnar
2008-11-17 21:19                           ` tcp_recvmsg(): " Ingo Molnar
2008-11-17 21:26                           ` eth_type_trans(): " Ingo Molnar
2008-11-17 21:40                             ` Eric Dumazet
2008-11-17 23:41                               ` Eric Dumazet
2008-11-18  0:01                                 ` Linus Torvalds
2008-11-18  8:35                                   ` Eric Dumazet
2008-11-17 21:52                             ` Linus Torvalds
2008-11-18  5:16                             ` David Miller
2008-11-18  5:35                               ` Eric Dumazet
2008-11-18  7:00                                 ` David Miller
2008-11-18  8:30                               ` Ingo Molnar
2008-11-18  8:49                                 ` Eric Dumazet
2008-11-17 21:35                           ` __inet_lookup_established(): " Ingo Molnar
2008-11-17 22:14                             ` Eric Dumazet
2008-11-17 21:59                           ` system_call() - " Ingo Molnar
2008-11-17 22:09                             ` Linus Torvalds
2008-11-17 22:08                           ` Ingo Molnar
2008-11-17 22:15                             ` Eric Dumazet
2008-11-17 22:26                               ` Ingo Molnar
2008-11-17 22:39                                 ` Eric Dumazet
2008-11-18  5:23                               ` David Miller
2008-11-18  8:45                                 ` Ingo Molnar
2008-11-17 22:14                           ` tcp_transmit_skb() - " Ingo Molnar
2008-11-17 22:19                           ` Ingo Molnar
2008-11-17 19:36                 ` David Miller
2008-11-17 19:31             ` David Miller
2008-11-17 19:47               ` Linus Torvalds
2008-11-17 19:51                 ` David Miller
2008-11-17 19:53                 ` Ingo Molnar
2008-11-17 22:47               ` Ingo Molnar
2008-11-17 19:21         ` David Miller
2008-11-17 19:48           ` Linus Torvalds
2008-11-17 19:52             ` David Miller
2008-11-17 19:57               ` Linus Torvalds
2008-11-17 20:18                 ` David Miller
2008-11-19 19:43     ` Christoph Lameter
2008-11-19 20:14       ` Ingo Molnar
2008-11-20 23:52       ` Christoph Lameter
2008-11-21  8:30         ` Ingo Molnar
2008-11-21  8:51           ` Eric Dumazet
2008-11-21  9:05             ` David Miller
2008-11-21 12:51               ` Eric Dumazet
2008-11-21 15:13                 ` [PATCH] fs: pipe/sockets/anon dentries should not have a parent Eric Dumazet
2008-11-21 15:21                   ` Ingo Molnar
2008-11-21 15:28                     ` Eric Dumazet
2008-11-21 15:34                       ` Ingo Molnar
2008-11-26 23:27                         ` [PATCH 0/6] fs: Scalability of sockets/pipes allocation/deallocation on SMP Eric Dumazet
2008-11-27  1:37                           ` Christoph Lameter
2008-11-27  6:27                             ` Eric Dumazet
2008-11-27 14:44                               ` Christoph Lameter
2008-11-27  9:39                           ` Christoph Hellwig
2008-11-28 18:03                           ` Ingo Molnar
2008-11-28 18:47                             ` Peter Zijlstra
2008-11-29  6:38                               ` Christoph Hellwig
2008-11-29  8:07                                 ` Eric Dumazet
2008-11-29  8:43                           ` [PATCH v2 0/5] " Eric Dumazet
2008-12-11 22:38                             ` [PATCH v3 0/7] " Eric Dumazet
2008-12-11 22:38                             ` [PATCH v3 1/7] fs: Use a percpu_counter to track nr_dentry Eric Dumazet
2007-07-24  1:24                               ` Nick Piggin
2008-12-16 21:04                               ` Paul E. McKenney
2008-12-11 22:39                             ` [PATCH v3 2/7] fs: Use a percpu_counter to track nr_inodes Eric Dumazet
2007-07-24  1:30                               ` Nick Piggin
2008-12-12  5:11                                 ` Eric Dumazet
2008-12-16 21:10                               ` Paul E. McKenney
2008-12-11 22:39                             ` [PATCH v3 3/7] fs: Introduce a per_cpu last_ino allocator Eric Dumazet
2007-07-24  1:34                               ` Nick Piggin
2008-12-16 21:26                               ` Paul E. McKenney
2008-12-11 22:39                             ` [PATCH v3 4/7] fs: Introduce SINGLE dentries for pipes, socket, anon fd Eric Dumazet
2008-12-16 21:40                               ` Paul E. McKenney
2008-12-11 22:40                             ` [PATCH v3 5/7] fs: new_inode_single() and iput_single() Eric Dumazet
2008-12-16 21:41                               ` Paul E. McKenney
2008-12-11 22:40                             ` [PATCH v3 6/7] fs: struct file move from call_rcu() to SLAB_DESTROY_BY_RCU Eric Dumazet
2007-07-24  1:13                               ` Nick Piggin
2008-12-12  2:50                                 ` Nick Piggin
2008-12-12  4:45                                 ` Eric Dumazet
2008-12-12 16:48                                   ` Eric Dumazet
2008-12-13  2:07                                     ` Christoph Lameter
2008-12-17 20:25                                       ` Eric Dumazet
2008-12-13  1:41                                   ` Christoph Lameter
2008-12-11 22:41                             ` [PATCH v3 7/7] fs: MS_NOREFCOUNT Eric Dumazet
2008-11-29  8:43                           ` [PATCH v2 1/5] fs: Use a percpu_counter to track nr_dentry Eric Dumazet
2008-11-29  8:43                           ` [PATCH v2 2/5] fs: Use a percpu_counter to track nr_inodes Eric Dumazet
2008-11-29  8:44                           ` [PATCH v2 3/5] fs: Introduce a per_cpu last_ino allocator Eric Dumazet
2008-11-29  8:44                           ` [PATCH v2 4/5] fs: Introduce SINGLE dentries for pipes, socket, anon fd Eric Dumazet
2008-11-29 10:38                             ` Jörn Engel
2008-11-29 11:14                               ` Eric Dumazet
2008-11-29  8:45                           ` [PATCH v2 5/5] fs: new_inode_single() and iput_single() Eric Dumazet
2008-11-29 11:14                             ` Jörn Engel
2008-11-26 23:30                         ` [PATCH 1/6] fs: Introduce a per_cpu nr_dentry Eric Dumazet
2008-11-27  9:41                           ` Christoph Hellwig
2008-11-26 23:32                         ` [PATCH 3/6] fs: Introduce a per_cpu last_ino allocator Eric Dumazet
2008-11-27  9:46                           ` Christoph Hellwig
2008-11-26 23:32                         ` [PATCH 4/6] fs: Introduce a per_cpu nr_inodes Eric Dumazet
2008-11-27  9:32                           ` Peter Zijlstra
2008-11-27  9:39                             ` Peter Zijlstra
2008-11-27  9:48                               ` Christoph Hellwig
2008-11-27 10:01                             ` Eric Dumazet
2008-11-27 10:07                             ` Andi Kleen
2008-11-27 14:46                             ` Christoph Lameter
2008-11-26 23:32                         ` [PATCH 5/6] fs: Introduce special inodes Eric Dumazet
2008-11-27  8:20                           ` David Miller
2008-11-26 23:32                         ` [PATCH 6/6] fs: Introduce kern_mount_special() to mount special vfs Eric Dumazet
2008-11-27  8:21                           ` David Miller
2008-11-27  9:53                           ` Christoph Hellwig
2008-11-27 10:04                             ` Eric Dumazet
2008-11-27 10:10                               ` Christoph Hellwig
2008-11-28  9:26                           ` Al Viro
2008-11-28  9:34                             ` Al Viro
2008-11-28 18:02                             ` Ingo Molnar
2008-11-28 18:58                               ` Ingo Molnar
2008-11-28 22:20                               ` Eric Dumazet
2008-11-28 22:37                             ` Eric Dumazet
2008-11-28 22:43                               ` Eric Dumazet
2008-11-21 15:36                   ` [PATCH] fs: pipe/sockets/anon dentries should not have a parent Christoph Hellwig
2008-11-21 17:58                     ` [PATCH] fs: pipe/sockets/anon dentries should have themselves as parent Eric Dumazet
2008-11-21 18:43                       ` Matthew Wilcox
2008-11-23  3:53                         ` Eric Dumazet
2008-11-21  9:18             ` [Bug #11308] tbench regression on each kernel release from 2.6.22 -&gt; 2.6.28 Ingo Molnar
2008-11-21  9:03           ` David Miller
2008-11-21 16:11           ` Christoph Lameter
2008-11-21 18:06             ` Christoph Lameter
2008-11-21 18:16               ` Eric Dumazet
2008-11-21 18:19                 ` Eric Dumazet
2008-11-16 17:40 ` [Bug #11215] INFO: possible recursive locking detected ps2_command Rafael J. Wysocki
2008-11-16 17:40 ` [Bug #11664] acpi errors and random freeze on sony vaio sr Rafael J. Wysocki
2008-11-16 17:40 ` [Bug #11698] 2.6.27-rc7, freezes with &gt; 1 s2ram cycle Rafael J. Wysocki
2008-11-16 17:40 ` [Bug #11543] kernel panic: softlockup in tick_periodic() ??? Rafael J. Wysocki
2008-11-16 17:40 ` [Bug #11569] Panic stop CPUs regression Rafael J. Wysocki
2008-11-16 17:40 ` [Bug #11404] BUG: in 2.6.23-rc3-git7 in do_cciss_intr Rafael J. Wysocki
2008-11-17 16:19   ` Randy Dunlap
2008-11-16 17:40 ` [Bug #11795] ks959-sir dongle no longer works under 2.6.27 (REGRESSION) Rafael J. Wysocki
2008-11-16 17:40 ` [Bug #11805] mounting XFS produces a segfault Rafael J. Wysocki
2008-11-17 14:44   ` Christoph Hellwig
2008-11-16 17:40 ` [Bug #11836] Scheduler on C2D CPU and latest 2.6.27 kernel Rafael J. Wysocki
2008-11-16 17:40 ` [Bug #11886] without serial console system doesn't poweroff Rafael J. Wysocki
2008-11-16 17:40 ` [Bug #11865] WOL for E100 Doesn't Work Anymore Rafael J. Wysocki
2008-11-16 17:40 ` [Bug #11843] usb hdd problems with 2.6.27.2 Rafael J. Wysocki
2008-11-16 21:37   ` Luciano Rocha
2008-11-16 17:40 ` [Bug #11876] RCU hang on cpu re-hotplug with 2.6.27rc8 Rafael J. Wysocki
2008-11-16 17:41 ` [Bug #12039] Regression: USB/DVB 2.6.26.8 --&gt; 2.6.27.6 Rafael J. Wysocki
2008-11-16 17:41 ` [Bug #11983] iwlagn: wrong command queue 31, command id 0x0 Rafael J. Wysocki
2008-11-16 17:41 ` [Bug #12048] Regression in bonding between 2.6.26.8 and 2.6.27.6 Rafael J. Wysocki

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20081117202018.GB12020@elte.hu \
    --to=mingo@elte.hu \
    --cc=a.p.zijlstra@chello.nl \
    --cc=cl@linux-foundation.org \
    --cc=dada1@cosmosbay.com \
    --cc=davem@davemloft.net \
    --cc=efault@gmx.de \
    --cc=kernel-testers@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rjw@sisk.pl \
    --cc=shemminger@vyatta.com \
    --cc=torvalds@linux-foundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®