News for hackers. Stuff that matters.
Re:Linux page table isolation is not needed on AMD processors by kllrnohj on Tuesday January 02, 2018 @08:30PM (#16057554)
Thread-suspending contended mutexes are already extremely slow. If you have a heavily-contended mutex you already have a major performance bug. If this is the kick in the pants you need to go fix it that's arguably a good thing ;)

Note that mutex contention does not itself mean immediately falling back to futex - commonly you'll spinloop first and hope that resolves your contention (fast), then fall back to futex (slow)

Re:Linux page table isolation is not needed on AMD processors by mehrdadn on Tuesday January 02, 2018 @09:29PM (#16057788)
> If you have a heavily-contended mutex you already have a major performance bug.

I can't really devote time to countering the unfounded assertion that every contended mutex must be a bug. It certainly isn't consistent with my experience, but if every problem you've solved could have been parallelized infinitely without increasing lock contention, more power to you.

Re:Linux page table isolation is not needed on AMD processors by kllrnohj on Tuesday January 02, 2018 @10:36PM (#16058128)
> I can't really devote time to countering the unfounded assertion that every contended mutex must be a bug.

Good, because that's not what I said. If you're heavily hitting futex convention you do have a performance bug, though. You might be confused with general contention that's being resolved with a spinlock rather than futex wait, though.

Re:Linux page table isolation is not needed on AMD processors by mehrdadn on Tuesday January 02, 2018 @10:45PM (#16058173)
>> I can't really devote time to countering the unfounded assertion that every contended mutex must be a bug.

> Good, because that's not what I said.

It is literally what you said:

>>> If you have a heavily-contended mutex you already have a major performance bug. If this is the kick in the pants you need to go fix it that's arguably a good thing ;)

> You might be confused with general contention that's being resolved with a spinlock rather than futex wait, though.

I'm not confusing them at all; I'm literally reading exactly what you wrote. You literally said contended mutexes are necessarily bugs (right here^) and that you considered mutexes to include the initial spinlocks ("note that mutex contention does not itself mean immediately falling back to futex - commonly you'll spinloop first"). But maybe you meant to say something else?

Re:Linux page table isolation is not needed on AMD processors by netheril96 on Wednesday January 03, 2018 @07:55AM (#16060564)
He said "heavily contended", and then you dropped the "heavily" prefix and claimed that was literally what he said. That adverb is material to the discussion and your dropping it completely changes the meaning.

I concur with his opinion. Infrequent contention is not a bug; otherwise no mutex is needed. Frequent contention (or heavy contention in his words) is a performance bug.

Re:Linux page table isolation is not needed on AMD processors by mehrdadn on Wednesday January 03, 2018 @08:16AM (#16060683)
> He said "heavily contended", and then you dropped the "heavily" prefix and claimed that was literally what he said. That adverb is material to the discussion and your dropping it completely changes the meaning.

"Heavily" was not dropped intentionally at all. Add it back to my comments. It changes nothing whatsoever. The incredible opinion that every problem can be necessarily parallelized without eventually resulting in contention (and I license you to freely modify this term with 'light', 'heavy', 'medium-rare', 'salted', 'peppered', or 'grilled at 450F' to your taste) is so fantastically absurd that I cannot believe you are debating it. I definitely don't know how you can justify such an unfounded claim with no evidence and I certainly have no interest in wasting time debating it. As I said earlier: if you never encounter problems that exhibit eventual scalability limits, more power to you.

Re:Linux page table isolation is not needed on AMD processors by kllrnohj on Tuesday January 02, 2018 @11:11PM (#16058309)
I literally said spin loop resolving is fast. Maybe read more than the single phrase you're pulling out of context to go on a rant about?
Re:Linux page table isolation is not needed on AMD processors by asveikau on Tuesday January 02, 2018 @09:48PM (#16057876)
Let's put it this way. If every contended mutex were a bug, why not remove the mutex and let the code run as-is? No, you wouldn't, so no, not a bug.
Re:Linux page table isolation is not needed on AMD processors by mehrdadn on Tuesday January 02, 2018 @09:57PM (#16057922)
> Let's put it this way. If every contended mutex were a bug, why not remove the mutex and let the code run as-is? No, you wouldn't, so no, not a bug.

I mean, the parent's argument is wrong, but isn't that naive. Presumably the argument is a bad (yet still correct) solution would result in lock contention while a better solution would e.g. use a different algorithm that is more parallelizable.