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: <alpine.DEB.2.00.1010181015290.755@router.home>
Date:	Mon, 18 Oct 2010 10:24:10 -0500 (CDT)
From:	Christoph Lameter <cl@...ux.com>
To:	Eric Dumazet <eric.dumazet@...il.com>
cc:	Andrew Morton <akpm@...ux-foundation.org>,
	Nick Piggin <npiggin@...nel.dk>,
	Dave Chinner <david@...morbit.com>,
	linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] percpu_counter : add percpu_counter_add_fast()

On Sat, 16 Oct 2010, Eric Dumazet wrote:

> I based following patch against linux-2.6, I dont know if previous
> Christoph patch is in a git tree. I'll respin it eventually.

The prior patch was accepted by Andrew.

> + * - It is preempt safe, but not IRQ safe (on UP)

The IRQ safeness depends on the arch. this_cpu_add() in general only
guarantees safety against preemption. It so happens that the x86
implementation is irq safe as well.

The IRQ safety for UP is therefore not an issue if you use this_cpu_add().

If you want to guarantee irqsafeness then use irqsafe_cpu_add() instead.
It generates the same code on x86 for SMP but takes care of the UP issues.

> +static inline void percpu_counter_add_fast(struct percpu_counter *fbc, long amount)
> +{
> +	this_cpu_add(*fbc->counters, amount);
> +}

What happens in case of counter overflow?

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