Re: 20% performance drop on PostgreSQL 9.2 from kernel 3.5.3 to3.6-rc5 on AMD chipsets - bisected

From: Mike Galbraith
Date: Sat Sep 15 2012 - 12:36:58 EST


On Sat, 2012-09-15 at 09:16 -0700, Andi Kleen wrote:
> Mike Galbraith <efault@xxxxxx> writes:
> >
> > The only reason I can think of why pgbench might suffer is postgres's
> > userspace spinlocks. If you always look for an idle core, you improve
> > the odds that the wakeup won't preempt a lock holder, sending others
> > into a long spin.
>
> User space spinlocks like this unfortunately have a tendency to break
> with all kinds of scheduler changes. We've seen this frequently too
> with other users. The best bet currently is to use the real time
> scheduler, but with various tweaks to get its overhead down.

Yeah, that's one way, but decidedly sub-optimal.

> Ultimatively the problem is that user space spinlocks with CPU
> oversubcription is a very unstable setup and small changes can
> easily disturb it.
>
> Just using futex is unfortunately not the answer either.

Yes, postgress performs loads better with it's spinlocks, but due to
that, it necessarily _hates_ preemption. How the is the scheduler
supposed to know that any specific userland task _really_ shouldn't be
preempted at any specific time, else bad things follow?

-Mike

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/