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, 30 Apr 2009 19:23:41 +0200
From:	Ingo Molnar <mingo@...e.hu>
To:	Linus Torvalds <torvalds@...ux-foundation.org>
Cc:	Christoph Lameter <cl@...ux.com>,
	Mathieu Desnoyers <mathieu.desnoyers@...ymtl.ca>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Nick Piggin <nickpiggin@...oo.com.au>,
	KOSAKI Motohiro <kosaki.motohiro@...fujitsu.com>,
	Peter Zijlstra <a.p.zijlstra@...llo.nl>, thomas.pi@...or.dea,
	Yuriy Lalym <ylalym@...il.com>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	ltt-dev@...ts.casi.polymtl.ca, Tejun Heo <tj@...nel.org>
Subject: Re: [PATCH] Fix dirty page accounting in
	redirty_page_for_writepage()


* Linus Torvalds <torvalds@...ux-foundation.org> wrote:

> On Thu, 30 Apr 2009, Ingo Molnar wrote:
> > 
> > c0436275:   64 83 05 20 5f 6a c0    addl   $0x1,%fs:0xc06a5f20
> > 
> > There's no atomic instructions at all - the counters here are 
> > only accessed locally. They are local-irq-atomic, but not 
> > cacheline-atomic.
> 
> On other architectures, you need the whole "disable preemption, 
> load-locked, store-conditional, test-and-loop, enable preemption" 
> thing.
> 
> Or "disable interrupts, load, store, restore interrupts".
> 
> There really aren't very many architectures that can do almost 
> unrestricted ALU ops in a single instruction (and thus 
> automatically safe from preemption and interrupts).

Maybe then what we should do is the very first version of commit 
6dbde35308: declaredly make percpu_arith_op() non-irq-atomic (and 
non-preempt-atomic) everywhere. The commit's internal changelog 
still says:

        * made generic percpu ops atomic against preemption

So we introduced preemption-safety in the v2 version of that commit.

This non-atomicity will 1) either not matter 2) will be irq-atomic 
by virtue of being within a critical section 3) can be made atomic 
in the few remaining cases.

And maybe, at most, introduce an opt-in API: percpu_add_irqsafe().

Right?

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