Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rFcoQ-00B0jK-1z for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Dec 2023 16:19:18 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rFcoO-002vBP-L6 for pgsql-hackers@arkaria.postgresql.org; Tue, 19 Dec 2023 16:19:16 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rFcoO-002vBH-AW for pgsql-hackers@lists.postgresql.org; Tue, 19 Dec 2023 16:19:16 +0000 Received: from mail-il1-x134.google.com ([2607:f8b0:4864:20::134]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1rFcoL-00BC2F-Sf for pgsql-hackers@postgresql.org; Tue, 19 Dec 2023 16:19:15 +0000 Received: by mail-il1-x134.google.com with SMTP id e9e14a558f8ab-35f7589ea1fso17089905ab.1 for ; Tue, 19 Dec 2023 08:19:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1703002753; x=1703607553; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=TXhocRwFEV13uv4bIs4A35JD9UAYcrpHU94qeuK5S0k=; b=Jzmpvs4rKRxyu9qtMA2ogxmnzKD4Rk2muhp8l952pyLtH5KLvSkb3pj+n835OJWKKb QMb82dT7VbC+qagsyLmPS+5zjftnJFeF4XXyjcbm6QnJpBzfhC8V1/wL1iaZTWUS/Mim z2upGG0k6GtldxtqiCG5CM+aiymev9meNDLf3B01wvR8AbU2eFDqILxPescdKV5Mkxup hOLsjkKHroiqV034qGB0W7SWtyStpxEqztjqJD2+3A0kOkGg8ZeuIru57GTa9jvcmTyM 1ETWGxZyAGlXaUOB3DIb8cR4AdmRbxPVCAdfK/xkyapQgecAAntWgQzstWIOcPOioFPm D4gA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1703002753; x=1703607553; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=TXhocRwFEV13uv4bIs4A35JD9UAYcrpHU94qeuK5S0k=; b=nYwhnRBlYgWD5pBli19ObDTSP2CXvvPoTXJnTSPRUKB8T+rmEWs7rc3SN4JfJWzX/9 A+imO9EXnvtvlW/NASmyGKKUavIGKhtpNVZ/dspK/M8ECHrwG2yI07xSWI6csmiMcL5O 827D1mzh2I++nHkQQifCIP09l5ROaU7Ocn+Za9gTlyaocxpW6tX6iomsd8v/nIOtcFX+ 6XfPW9cEc4RxsJHrA9qn0V1htjMcY3+IT8UTZJ7HAAXiFP5cwg23XNhEIoL31l1bu4GQ LJ4gbFDLSgkK4PwRgazGWsxFULs3/QKPThCw4q4mUn9jQm+rPYZTcUVGSFw231FlrhWn NQjQ== X-Gm-Message-State: AOJu0YwOxomFEyXK8YlRYZgxTU7zX0JYZeF+ilX+xn2IZY9las/BgBlR BdXOqWwONTnGDj70J35f8Qe7NfzyYww= X-Google-Smtp-Source: AGHT+IH1ZkyoHaVcuKzjrjitpSy7jpcL7UBebMqX5n8Lq6cWOdhmubpcOqLUyr8OmV+/3sOT9a8y6w== X-Received: by 2002:a92:c26a:0:b0:35d:962b:aea4 with SMTP id h10-20020a92c26a000000b0035d962baea4mr21959672ild.7.1703002753131; Tue, 19 Dec 2023 08:19:13 -0800 (PST) Received: from nathanxps13 (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id a19-20020a056e020e1300b0035fb36c9bbasm1131554ilk.46.2023.12.19.08.19.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 19 Dec 2023 08:19:12 -0800 (PST) Date: Tue, 19 Dec 2023 10:19:11 -0600 From: Nathan Bossart To: Michael Paquier Cc: pgsql-hackers@postgresql.org Subject: Re: introduce dynamic shared memory registry Message-ID: <20231219161911.GE831499@nathanxps13> References: <20231205034647.GA2705267@nathanxps13> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Dec 08, 2023 at 04:36:52PM +0900, Michael Paquier wrote: > Yes, tracking that in a more central way can have many usages, so your > patch sounds like a good idea. Note that we have one case in core > that be improved and make use of what you have here: autoprewarm.c. I'll add a patch for autoprewarm.c. Even if we don't proceed with that change, it'll be a good demonstration. > +dsm_registry_init_or_attach(const char *key, void **ptr, size_t size, > + void (*init_callback) (void *ptr)) > > This is shaped around dshash_find_or_insert(), but it looks like you'd > want an equivalent for dshash_find(), as well. What is the use-case for only verifying the existence of a segment? -- Nathan Bossart Amazon Web Services: https://aws.amazon.com