Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q7KZP-00029O-ML for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jun 2023 18:41:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1q7KZN-0005A2-0X for pgsql-hackers@arkaria.postgresql.org; Thu, 08 Jun 2023 18:41:13 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1q7KZL-00057W-Bx for pgsql-hackers@lists.postgresql.org; Thu, 08 Jun 2023 18:41:12 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1q7KZE-0014QQ-VV; Thu, 08 Jun 2023 18:41:10 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 8E0EC5C012D; Thu, 8 Jun 2023 14:41:02 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 08 Jun 2023 14:41:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=anarazel.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to; s=fm1; t= 1686249662; x=1686336062; bh=pgQaA7bEoxd+0LqqfHMHvM0b+kRJTKpw58E 4hxTYS8w=; b=XEnVcKU7yAotyMHMARGQpIe5BiAsLtcNzo2jGVTEODSKKnqYzdR B2bf/DVngL5t3iqFJOTD7u3AsQUtSyjZfyV8Suk3jmtchNjBniFo/fKrlBmIYVMP Y1i5gkCgZyo0Fywoz4rS94bhCr/w+sy6A+bEnzoH4gqLuzbsjXjGZ2eN10aTTmAr LJaHiap68Juzt4o3h/SHdexqTYxdIXX6nsZbo89+50FpQa5tM5baPBTZeeUs92wP XFbCcaXvTy/rWQISPBrIktcVfn7gyO4wjrfg4NBQ4DV97v4CTy/G7MD7j3gr3e9x D4qtwWqxKZ2SiOYfGviRudpe9bhkM5GRftQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:sender:subject:subject:to:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t= 1686249662; x=1686336062; bh=pgQaA7bEoxd+0LqqfHMHvM0b+kRJTKpw58E 4hxTYS8w=; b=RPOcS3C3Y4PAi3nnnLcu44Zj+xjzOjd8KBTkMODyxTNSvgsQbZv JI5vuFQlVEP4/GCJXYvjlQkyRN9imW7HAEzjx0I2gOFJzNeliR8lxk8RkdugTWR5 QlyLqGnvfmiYHGLXeTtz+/Y/m+VnxVLtJWcyR43n2veGSb/myAbfQh7ChTCTbMg/ 3+NzEMVOF4PF298pFS4FNWWTT593DAYg10so2zouUi6C3Q0kJB9Awtc7sgMKltJM gIt3cbPeE2DDWh61ySVA1XE7reFWMvDZiIVNpGPztICmcu2dkHzcAZjLnZ7T4YYZ +Q8hSUgYdZVcdKwEizwGv2pixvn0WahvtPA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrgedtiedguddvlecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfhfgggtugfgjgesthekredttddtjeenucfhrhhomheptehn ughrvghsucfhrhgvuhhnugcuoegrnhgurhgvshesrghnrghrrgiivghlrdguvgeqnecugg ftrfgrthhtvghrnhephfeitefgleevtedtffejvedujeekjedugfdtveffjeelvddtfeek gefgjefhgfegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrh homheprghnughrvghssegrnhgrrhgriigvlhdruggv X-ME-Proxy: Feedback-ID: id4a34324:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 8 Jun 2023 14:41:01 -0400 (EDT) Date: Thu, 8 Jun 2023 11:41:00 -0700 From: Andres Freund To: Hannu Krosing Cc: Robert Haas , Matthias van de Meent , "Jonathan S. Katz" , Heikki Linnakangas , Tom Lane , pgsql-hackers Subject: Re: Let's make PostgreSQL multi-threaded Message-ID: <20230608184100.xbvis2dtwjrfu754@awork3.anarazel.de> References: <31cc6df9-53fe-3cd9-af5b-ac0d801163f4@iki.fi> <4178104.1685978307@sss.pgh.pa.us> <4ce6c0f8-e8a4-1672-93fd-49d3fa975ee5@iki.fi> <20230607213721.al3etgcgtija3ytz@awork3.anarazel.de> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On 2023-06-08 17:02:08 +0200, Hannu Krosing wrote: > On Thu, Jun 8, 2023 at 4:56 PM Robert Haas wrote: > > > > On Thu, Jun 8, 2023 at 8:44 AM Hannu Krosing 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. There's a large part of this that is about hardware, not software. And honestly, for most of the problems the answer is to just use threads. Adding complexity to operating systems to make odd architectures like postgres' better is a pretty dubious proposition. I don't think we have even remotely enough influence on CPU design to make e.g. *partial* TLB sharing across processes a thing. > 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 :) The proposals around that don't really help us all that much. Sharing the page table will be a bit more efficient, but it won't really change anything dramatically. From what I understand they are primarily interested in changing properties of a memory mapping across multiple processes, e.g. making some memory executable and have that reflected in all processes. I don't think this will help us much. Greetings, Andres Freund