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 1l1VcP-0005Wf-E6 for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Jan 2021 14:34:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l1VcO-00035X-CU for pgsql-hackers@arkaria.postgresql.org; Mon, 18 Jan 2021 14:34:56 +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 1l1VcN-00035Q-FC for pgsql-hackers@lists.postgresql.org; Mon, 18 Jan 2021 14:34:56 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l1VcG-0002jC-Fh for pgsql-hackers@postgresql.org; Mon, 18 Jan 2021 14:34:55 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id 528505C0105; Mon, 18 Jan 2021 09:34:46 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute2.internal (MEProxy); Mon, 18 Jan 2021 09:34:46 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=xW+XOnX09/Kd0m998H2tvmXQwr5vaMEFXgiZ1/mMzOA=; b=OX9vXy9j vpA/GRO+FKQTwlpzFutCI5fsU97d4BDjkS5tu6Df1kRtzoEXYPKT5vc/g1VG3wsY OHsnggvkD/skFQSvzjPEPUnVZbdSspVMReuJCWKVzBKo1Pt1hwEuSzpd6Q+ZbATv SMBmaPl5w2N383PJ1C6ADmluKGVw9j89126Yv6EXTnoTrsINHeRbguQzrbnrXw3C bHppTxvO9msv6Fy6s3q/QglYWHouNXNm/QJV+yT0kWT/2VIgdtS24MZGP0f6aP5P Sv/XVVAUwCkmXrJ85S0ujCyDMYpdTyrZd5uGe7maua0XlvEEbnON6rhaJIsHc+07 HInsMYsKOvn0oA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrtdekgdeijecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjggfsehtkeertddtredunecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpeeufffhjeeiueeuffegvddukeegledtveeivdeiueefieei vefgteehueefteehvdenucfkphepudeltddrleehrdduledrudejjeenucevlhhushhtvg hrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghl vhhhrdhnohdqihhprdhorhhg X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.177]) by mail.messagingengine.com (Postfix) with ESMTPA id 91068108005F; Mon, 18 Jan 2021 09:34:45 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 3D1322A0928; Mon, 18 Jan 2021 11:34:43 -0300 (-03) Date: Mon, 18 Jan 2021 11:34:43 -0300 From: Alvaro Herrera To: Heikki Linnakangas Cc: "kuroda.hayato@fujitsu.com" , "pgsql-hackers@postgresql.org" Subject: Re: ResourceOwner refactoring Message-ID: <20210118143443.GA7276@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <7ba71639-dbb7-5eef-e3a2-5f7f0dd22078@iki.fi> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2021-Jan-18, Heikki Linnakangas wrote: > +static ResourceOwnerFuncs jit_funcs = > +{ > + /* relcache references */ > + .name = "LLVM JIT context", > + .phase = RESOURCE_RELEASE_BEFORE_LOCKS, > + .ReleaseResource = ResOwnerReleaseJitContext, > + .PrintLeakWarning = ResOwnerPrintJitContextLeakWarning > +}; I think you mean jit_resowner_funcs here; "jit_funcs" is a bit excessively vague. Also, why did you choose not to define ResourceOwnerRememberJIT? You do that in other modules and it seems better. > +static ResourceOwnerFuncs catcache_funcs = > +{ > + /* catcache references */ > + .name = "catcache reference", > + .phase = RESOURCE_RELEASE_AFTER_LOCKS, > + .ReleaseResource = ResOwnerReleaseCatCache, > + .PrintLeakWarning = ResOwnerPrintCatCacheLeakWarning > +}; > + > +static ResourceOwnerFuncs catlistref_funcs = > +{ > + /* catcache-list pins */ > + .name = "catcache list reference", > + .phase = RESOURCE_RELEASE_AFTER_LOCKS, > + .ReleaseResource = ResOwnerReleaseCatCacheList, > + .PrintLeakWarning = ResOwnerPrintCatCacheListLeakWarning > +}; Similar naming issue here, I say. > diff --git a/src/common/cryptohash_openssl.c b/src/common/cryptohash_openssl.c > index 551ec392b60..642e72d8c0f 100644 > --- a/src/common/cryptohash_openssl.c > +++ b/src/common/cryptohash_openssl.c > @@ -60,6 +59,21 @@ struct pg_cryptohash_ctx > #endif > }; > > +/* ResourceOwner callbacks to hold JitContexts */ > +#ifndef FRONTEND > +static void ResOwnerReleaseCryptoHash(Datum res); > +static void ResOwnerPrintCryptoHashLeakWarning(Datum res); The comment is wrong -- "Crypohashes", not "JitContexts". So according to your performance benchmark, we're willing to accept a 30% performance loss on an allegedly common operation -- numkeep=0 numsnaps=10 becomes 49.8ns from 37.6ns. That seems a bit shocking. Maybe you can claim that these operations aren't exactly hot spots, and so the fact that we remain in the same power-of-ten is sufficient. Is that the argument? -- Álvaro Herrera 39°49'30"S 73°17'W "The Postgresql hackers have what I call a "NASA space shot" mentality. Quite refreshing in a world of "weekend drag racer" developers." (Scott Marlowe)