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 1uUMLG-0020ok-LM for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Jun 2025 09:22:54 +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 1uUMLE-001msG-J6 for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Jun 2025 09:22:53 +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 1uUMLE-001ms8-9c for pgsql-hackers@lists.postgresql.org; Wed, 25 Jun 2025 09:22:52 +0000 Received: from relay16.mail.gandi.net ([2001:4b98:dc4:8::236]) by makus.postgresql.org with smtp (Exim 4.96) (envelope-from ) id 1uUMLB-003t69-2b for pgsql-hackers@lists.postgresql.org; Wed, 25 Jun 2025 09:22:50 +0000 Received: by mail.gandi.net (Postfix) with ESMTPSA id E5C6743885; Wed, 25 Jun 2025 09:22:43 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=vondra.me; s=gm1; t=1750843366; 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=RU+tzzc7/n6RTEP8C0YNqlK9CdFyVNa3IbofiqWmD5w=; b=ApnfpEnZ4tE17b6H8l4+w+ODTlK1wV9lRdq18gQ/vp1XoYAmekO+0KP2opYFI3BeSnoAnB fkc4vvVyOs33/870PnNmKNZS9O6Cjwf8+hXqoyj4G9uPOId2KBZtCmIPVKgdZVSBYHIRnz wnMe9cHnhZ3T9xBO2zjH8DIWR9N73gfxdHcSZk2eMuUG1u6peVCPqSh5PuHoDpsBaCZvmh UbtmEUNeNCklzTyQOCWXKPQcMiCAMOF0Gk3vC6rQF8Bl8ETLc60pPEyuvyVqKnR42Dg27k i7vQm2K0GFIatI8V9MUy+pgFSw/ASUDl9t0Mcpcfm0fK3vFQrniLUnDvr50UcA== Message-ID: Date: Wed, 25 Jun 2025 11:22:41 +0200 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: pgsql: Introduce pg_shmem_allocations_numa view To: Christoph Berg , Bertrand Drouvot Cc: Andres Freund , 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: 7bit X-GND-State: clean X-GND-Score: -100 X-GND-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtddvgddvvdeflecutefuodetggdotefrodftvfcurfhrohhfihhlvgemucfitefpfffkpdcuggftfghnshhusghstghrihgsvgenuceurghilhhouhhtmecufedtudenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurhepkfffgggfuffvvehfhfgjtgfgsehtjeertddtvdejnecuhfhrohhmpefvohhmrghsucggohhnughrrgcuoehtohhmrghssehvohhnughrrgdrmhgvqeenucggtffrrghtthgvrhhnpeeludegieekgfelhffgffeuvdelteetveeghfdvieekfeduudduvdfhvedufefhveenucfkphepkeeirdegledrvdeftddrvddtieenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepihhnvghtpeekiedrgeelrddvfedtrddvtdeipdhhvghloheplgdutddrudefjedrtddrvdgnpdhmrghilhhfrhhomhepthhomhgrshesvhhonhgurhgrrdhmvgdpnhgspghrtghpthhtohephedprhgtphhtthhopehmhihonhesuggvsghirghnrdhorhhgpdhrtghpthhtohepsggvrhhtrhgrnhguughrohhuvhhothdrphhgsehgmhgrihhlrdgtohhmpdhrtghpthhtoheprghnughrvghssegrnhgrrhgriigvlhdruggvpdhrtghpthhtohepthhomhgrshdrvhhonhgurhgrsehpohhsthhgrhgvshhqlhdrohhrghdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlihhsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 6/25/25 11:00, Christoph Berg wrote: > Re: Bertrand Drouvot >> +/* >> + * Work around Linux kernel bug in 32-bit compat mode: do_pages_stat() has >> + * incorrect pointer arithmetic for more than DO_PAGES_STAT_CHUNK_NR pages. >> + */ >> +#if SIZEOF_SIZE_T == 4 > > I was also missing it in my suggested patch draft, but this should > probably include #ifdef __linux__. > > > Re: Tomas Vondra >> +#ifdef USE_VALGRIND >> + >> +static inline void >> +pg_numa_touch_mem_if_required(uint64 tmp, char *ptr) > > Stupid question, if this function gets properly inlined, why not > always use it as there should be no performance difference vs using a > macro? > TBH I'm not 100% sure it works correctly, I need to check it actually touches the memory etc. It's possible it was discussed in one of the earlier NUMA threads, and there are reasons to do a macro. I also dislike the ifdefs because it adds subtle differences between the "normal" code and the code tested with valgrind. So just having the inlined function would be "nicer". regards -- Tomas Vondra