[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <alpine.LFD.1.10.0805071429170.3024@woody.linux-foundation.org>
Date: Wed, 7 May 2008 14:36:57 -0700 (PDT)
From: Linus Torvalds <torvalds@...ux-foundation.org>
To: Andrea Arcangeli <andrea@...ranet.com>
cc: Andrew Morton <akpm@...ux-foundation.org>,
Christoph Lameter <clameter@....com>,
Jack Steiner <steiner@....com>, Robin Holt <holt@....com>,
Nick Piggin <npiggin@...e.de>,
Peter Zijlstra <a.p.zijlstra@...llo.nl>,
kvm-devel@...ts.sourceforge.net,
Kanoj Sarcar <kanojsarcar@...oo.com>,
Roland Dreier <rdreier@...co.com>,
Steve Wise <swise@...ngridcomputing.com>,
linux-kernel@...r.kernel.org, Avi Kivity <avi@...ranet.com>,
linux-mm@...ck.org, general@...ts.openfabrics.org,
Hugh Dickins <hugh@...itas.com>,
Rusty Russell <rusty@...tcorp.com.au>,
Anthony Liguori <aliguori@...ibm.com>,
Chris Wright <chrisw@...hat.com>,
Marcelo Tosatti <marcelo@...ck.org>,
Eric Dumazet <dada1@...mosbay.com>,
"Paul E. McKenney" <paulmck@...ibm.com>
Subject: Re: [PATCH 08 of 11] anon-vma-rwsem
On Wed, 7 May 2008, Andrea Arcangeli wrote:
>
> I think the spinlock->rwsem conversion is ok under config option, as
> you can see I complained myself to various of those patches and I'll
> take care they're in a mergeable state the moment I submit them. What
> XPMEM requires are different semantics for the methods, and we never
> had to do any blocking I/O during vmtruncate before, now we have to.
I really suspect we don't really have to, and that it would be better to
just fix the code that does that.
> Please ignore all patches but mmu-notifier-core. I regularly forward
> _only_ mmu-notifier-core to Andrew, that's the only one that is in
> merge-ready status, everything else is just so XPMEM can test and we
> can keep discussing it to bring it in a mergeable state like
> mmu-notifier-core already is.
The thing is, I didn't like that one *either*. I thought it was the
biggest turd in the series (and by "biggest", I literally mean "most lines
of turd-ness" rather than necessarily "ugliest per se").
I literally think that mm_lock() is an unbelievable piece of utter and
horrible CRAP.
There's simply no excuse for code like that.
If you want to avoid the deadlock from taking multiple locks in order, but
there is really just a single operation that needs it, there's a really
really simple solution.
And that solution is *not* to sort the whole damn f*cking list in a
vmalloc'ed data structure prior to locking!
Damn.
No, the simple solution is to just make up a whole new upper-level lock,
and get that lock *first*. You can then take all the multiple locks at a
lower level in any order you damn well please.
And yes, it's one more lock, and yes, it serializes stuff, but:
- that code had better not be critical anyway, because if it was, then
the whole "vmalloc+sort+lock+vunmap" sh*t was wrong _anyway_
- parallelism is overrated: it doesn't matter one effing _whit_ if
something is a hundred times more parallel, if it's also a hundred
times *SLOWER*.
So dang it, flush the whole damn series down the toilet and either forget
the thing entirely, or re-do it sanely.
And here's an admission that I lied: it wasn't *all* clearly crap. I did
like one part, namely list_del_init_rcu(), but that one should have been
in a separate patch. I'll happily apply that one.
Linus
--
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