public inbox for [email protected]  
help / color / mirror / Atom feed
From: Matthias van de Meent <[email protected]>
To: Hannu Krosing <[email protected]>
Cc: Robert Haas <[email protected]>
Cc: Andres Freund <[email protected]>
Cc: Jonathan S. Katz <[email protected]>
Cc: Heikki Linnakangas <[email protected]>
Cc: Tom Lane <[email protected]>
Cc: pgsql-hackers <[email protected]>
Subject: Re: Let's make PostgreSQL multi-threaded
Date: Thu, 8 Jun 2023 17:55:57 +0200
Message-ID: <CAEze2WiM9XTCbp4K5sGt0udzSPqmEmxPVKOv7EagG8u3Vbya6A@mail.gmail.com> (raw)
In-Reply-To: <CAMT0RQTCFec0J4hQDcpC0CZ4F-7VWFZXpREgaRU-96bVQ1pj2Q@mail.gmail.com>
References: <[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<[email protected]>
	<CAMT0RQTAFrx5xVJ9SXyjP71=SmU+U9+4dDm+XEZWWoy6pbCF5g@mail.gmail.com>
	<CAEze2Whojjh++1Ybw8ohxo46DPeDS4aD5dkPsOse4Q-8r56awQ@mail.gmail.com>
	<CAMT0RQSfoUCNskuweVBhmEiWh76q+eqDhX+5_bWpq8Qq-KuTTg@mail.gmail.com>
	<CA+TgmoZhySzy4QuupAMCi3Fs7ZDwwKkUE9VEgxF2nn71Bo-FXQ@mail.gmail.com>
	<CAMT0RQTCFec0J4hQDcpC0CZ4F-7VWFZXpREgaRU-96bVQ1pj2Q@mail.gmail.com>

On Thu, 8 Jun 2023 at 17:02, Hannu Krosing <[email protected]> wrote:
>
> On Thu, Jun 8, 2023 at 4:56 PM Robert Haas <[email protected]> wrote:
> >
> > On Thu, Jun 8, 2023 at 8:44 AM Hannu Krosing <[email protected]> wrote:
> > > > That sounds like a bad idea, dynamic shared memory is more expensive
> > > > to maintain than our static shared memory systems, not in the least
> > > > because DSM is not guaranteed to share the same addresses in each
> > > > process' address space.
> > >
> > > Then this too needs to be fixed
> >
> > Honestly, I'm struggling to respond to this non-sarcastically. I mean,
> > I was the one who implemented DSM. Do you think it works the way that
> > it works because I considered doing something smart and decided to do
> > something dumb instead?
>
> No, I meant that this needs to be fixed at OS level, by being able to
> use the same mapping.
>
> We should not shy away from asking the OS people for adding the useful
> features still missing.

While I agree that "sharing page tables across processes" is useful,
it looks like it'd be much more effort to correctly implement for e.g.
DSM than implementing threading.
Konstantin's diff is "only" 20.1k lines [0] added and/or modified,
which is a lot, but it's manageable (13k+ of which are from files that
were auto-generated and then committed, likely accidentally).

> It was mentioned in the Unconference Kernel Hacker AMA talk and said
> kernel hacker works for Oracle, andf they also seemed to be needing
> this :)

Though these new kernel features allowing for better performance
(mostly in kernel memory usage, probably) would be nice to have, we
wouldn't get performance benefits for older kernels, benefits which we
would get if we were to implement threading.
I'm not on board with a policy of us twiddling thumbs and waiting for
the OS to fix our architectural performance issues. Sure, the kernel
could optimize for our usage pattern, but I think that's not something
we can (or should) rely on for performance ^1.

Kind regards,

Matthias van de Meent

[0] https://github.com/postgrespro/postgresql.pthreads/compare/801386af...d5933309?w=1
^1 OT: I think the same about us (ab)using the OS page cache, but
that's a tale for a different time and thread.






view thread (3+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Let's make PostgreSQL multi-threaded
  In-Reply-To: <CAEze2WiM9XTCbp4K5sGt0udzSPqmEmxPVKOv7EagG8u3Vbya6A@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox