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 1v9Plr-0005g6-Gl for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Oct 2025 15:20:02 +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 1v9Plp-00Dppz-9w for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Oct 2025 15:20:00 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1v9Plp-00Dpnq-08 for pgsql-hackers@lists.postgresql.org; Thu, 16 Oct 2025 15:20:00 +0000 Received: from mout-p-103.mailbox.org ([80.241.56.161]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v9Plk-002XxB-2I for pgsql-hackers@lists.postgresql.org; Thu, 16 Oct 2025 15:19:58 +0000 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-103.mailbox.org (Postfix) with ESMTPS id 4cnWpf0L7rz9tX0; Thu, 16 Oct 2025 17:19:54 +0200 (CEST) Date: Thu, 16 Oct 2025 17:19:52 +0200 From: Christoph Berg To: Tomas Vondra Cc: Jakub Wartak , pgsql-hackers@lists.postgresql.org Subject: Re: failed NUMA pages inquiry status: Operation not permitted Message-ID: References: <7bbc582b-cc70-4a6f-bbf2-b5fd9b13a867@vondra.me> 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 > So maybe all that's needed is a get_mempolicy() call in > pg_numa_available() ? numactl 2.0.19 --show does this: if (numa_available() < 0) { show_physcpubind(); printf("No NUMA support available on this system.\n"); exit(1); } int numa_available(void) { if (get_mempolicy(NULL, NULL, 0, 0, 0) < 0 && (errno == ENOSYS || errno == EPERM)) return -1; return 0; } pg_numa_available is already calling numa_available. But numactl 2.0.16 has this: int numa_available(void) { if (get_mempolicy(NULL, NULL, 0, 0, 0) < 0 && errno == ENOSYS) return -1; return 0; } ... which is not catching the "permission denied" error I am seeing. So maybe PG should implement numa_available itself like that. (Or accept the output difference so the regression tests are passing.) Christoph