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]
Message-Id: <20101021161801.8149e2fe.akpm@linux-foundation.org>
Date:	Thu, 21 Oct 2010 16:18:01 -0700
From:	Andrew Morton <akpm@...ux-foundation.org>
To:	Eric Dumazet <eric.dumazet@...il.com>
Cc:	Nick Piggin <npiggin@...nel.dk>,
	Dave Chinner <david@...morbit.com>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
	Christoph Lameter <cl@...ux-foundation.org>
Subject: Re: [PATCH] percpu_counter : add percpu_counter_add_fast()

On Fri, 22 Oct 2010 00:58:14 +0200
Eric Dumazet <eric.dumazet@...il.com> wrote:

> Then 39 instructions in hot path (no lock taken)

Wow, your compiler sucks.

.globl __percpu_counter_add
	.type	__percpu_counter_add, @function
__percpu_counter_add:
	pushq	%rbp	#
	movq	%rsp, %rbp	#,
	pushq	%r13	#
	movq	%rdi, %r13	# fbc, fbc
	pushq	%r12	#
	pushq	%rbx	#
	pushq	%r10	#
	movq	96(%rdi), %rbx	# <variable>.counters, pcount
#APP
	movl %gs:cpu_number,%eax	# cpu_number, pfo_ret__
#NO_APP
	cltq
	addq	__per_cpu_offset(,%rax,8), %rbx	# __per_cpu_offset, pcount
	movslq	(%rbx),%rax	#* pcount, tmp70
	leaq	(%rax,%rsi), %r12	#, count
	movslq	%edx,%rax	# batch, batch
	cmpq	%rax, %r12	# batch, count
	jge	.L43	#,
	negl	%edx	# batch
	movslq	%edx,%rax	# batch, tmp74
	cmpq	%rax, %r12	# tmp74, count
	jg	.L45	#,
.L43:
	movq	%r13, %rdi	# fbc, D.14396
	call	_raw_spin_lock	#
	addq	%r12, 72(%r13)	# count, <variable>.count
	movq	%r13, %rdi	# fbc, D.14396
	movl	$0, (%rbx)	#,* pcount
	call	_raw_spin_unlock	#
	jmp	.L47	#
.L45:
	movl	%r12d, (%rbx)	# count,* pcount
.L47:
	popq	%r9	#
	popq	%rbx	#
	popq	%r12	#
	popq	%r13	#
	leave
	ret

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