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 1uTnVI-00A3ZY-1Z for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Jun 2025 20:10:56 +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 1uTnVF-006HRF-8q for pgsql-hackers@arkaria.postgresql.org; Mon, 23 Jun 2025 20:10:53 +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 1uTnVE-006HQ0-TK for pgsql-hackers@lists.postgresql.org; Mon, 23 Jun 2025 20:10:53 +0000 Received: from relay8-d.mail.gandi.net ([2001:4b98:dc4:8::228]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1uTnVD-003hOx-1U for pgsql-hackers@lists.postgresql.org; Mon, 23 Jun 2025 20:10:53 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id DBCC344470; Mon, 23 Jun 2025 20:10:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vondra.me; s=gm1; t=1750709448; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UA0eDuMF4GOT9C9NV9+Q4eoanR7yEAhPfZ7ahWPDxiI=; b=jdeuKY6pSfSM3K/xtwimrEC4CG7rd+47kpe03R2TEXLNVM0WoALkRs9P90XywogFfhGvv+ 4NLdbrxKpMzuSvSiDIE6z3RHMyzxDkCpW8TEXnN7EWPj/x0Np5wd6tHxoqL+rIFAN95fqC W5VnQq7GfPbWXKbCfq4R3w+MHbx6taszgtOoo3BBLzlQCvluQv9knINmDvMgm8bVa3cKda H3FtZ5ozc7RDgqeG6LpGyboMWgGdcUyIuSXlyFJAPfbxlVdXlwazedCv2jTwJ+AkCXc3Gz HktFqPFv/qg0v4uQfR0HSE6X/Gz09zcQmZ0QhHkHlzVKZ88uAIorlJGKh2h/5Q== Message-ID: <6c9f9f7e-947b-4fc3-bdb6-b0696d7492e5@vondra.me> Date: Mon, 23 Jun 2025 22:10:46 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pgsql: Introduce pg_shmem_allocations_numa view To: Christoph Berg , Andres Freund Cc: Tomas Vondra , pgsql-hackers@lists.postgresql.org References: Content-Language: en-US From: Tomas Vondra In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgddujeelgecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpefvohhmrghsucggohhnughrrgcuoehtohhmrghssehvohhnughrrgdrmhgvqeenucggtffrrghtthgvrhhnpeeuvddvieefffefkedugefgtdeigeelgfegudehffevieehgffghefgvdduteffveenucfkphepkeeirdegledrvdeftddrvddtieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeekiedrgeelrddvfedtrddvtdeipdhhvghloheplgdutddrudefjedrtddrvdgnpdhmrghilhhfrhhomhepthhomhgrshesvhhonhgurhgrrdhmvgdpnhgspghrtghpthhtohepgedprhgtphhtthhopehmhihonhesuggvsghirghnrdhorhhgpdhrtghpthhtoheprghnughrvghssegrnhgrrhgriigvlhdruggvpdhrtghpthhtohepthhomhgrshdrvhhonhgurhgrsehpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-GND-Sasl: tomas@vondra.me List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/23/25 21:57, Christoph Berg wrote: > Re: Andres Freund >> How confident are we that this isn't actually because we passed a bogus >> address to the kernel or such? With this patch, are *any* pages recognized as >> valid on the machines that triggered the error? > > See upthread - the first 35 pages were ok, then a lot of -14. > >> I wonder if we ought to report the failures as a separate "numa node" >> (e.g. NULL as node id) instead ... > > Did that now, using N+1 (== 1 here) for errors in this Debian i386 > environment (chroot on an amd64 host): > > select * from pg_shmem_allocations_numa \crosstabview > > name │ 0 │ 1 > ────────────────────────────────────────────────┼──────────┼────────── > multixact_offset │ 69632 │ 65536 > subtransaction │ 139264 │ 131072 > notify │ 139264 │ 0 > Shared Memory Stats │ 188416 │ 131072 > serializable │ 188416 │ 86016 > PROCLOCK hash │ 4096 │ 0 > FinishedSerializableTransactions │ 4096 │ 0 > XLOG Ctl │ 2117632 │ 2097152 > Shared MultiXact State │ 4096 │ 0 > Proc Header │ 4096 │ 0 > Archiver Data │ 4096 │ 0 > .... more 0s in the last column ... > AioHandleData │ 1429504 │ 0 > Buffer Blocks │ 67117056 │ 67108864 > Buffer IO Condition Variables │ 266240 │ 0 > Proc Array │ 4096 │ 0 > .... more 0s > (73 rows) > > > There is something fishy with pg_buffercache. If I restart PG, I'm > getting "Bad address" (errno 14), this time as return value of > move_pages(). > > postgres =# select * from pg_buffercache_numa; > DEBUG: 00000: NUMA: NBuffers=16384 os_page_count=32768 os_page_size=4096 > LOCATION: pg_buffercache_numa_pages, pg_buffercache_pages.c:383 > 2025-06-23 19:41:41.315 UTC [1331894] ERROR: failed NUMA pages inquiry: Bad address > 2025-06-23 19:41:41.315 UTC [1331894] STATEMENT: select * from pg_buffercache_numa; > ERROR: XX000: failed NUMA pages inquiry: Bad address > LOCATION: pg_buffercache_numa_pages, pg_buffercache_pages.c:394 > > Repeated calls are fine. > Huh. So it's only the first call that does this? Can you maybe print the addresses passed to pg_numa_query_pages? I wonder if there's some bug in how we fill that array. Not sure why would it happen only on 32-bit systems, though. I'll create a 32-bit VM so that I can try reproducing this. regards -- Tomas Vondra