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 1uUJM0-001DDP-Hz for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Jun 2025 06:11:28 +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 1uUJLy-000Ap0-Ck for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Jun 2025 06:11:27 +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 1uUJLy-000Aos-38 for pgsql-hackers@lists.postgresql.org; Wed, 25 Jun 2025 06:11:26 +0000 Received: from mail-wr1-x430.google.com ([2a00:1450:4864:20::430]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uUJLw-003xtu-1K for pgsql-hackers@lists.postgresql.org; Wed, 25 Jun 2025 06:11:26 +0000 Received: by mail-wr1-x430.google.com with SMTP id ffacd0b85a97d-3a4fb9c2436so835665f8f.1 for ; Tue, 24 Jun 2025 23:11:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750831883; x=1751436683; darn=lists.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=nIg7uSLYwYLPcBVXqtzlLxZwwhEgM4g99J2WbjpKfps=; b=ZdZ2W3ozEJFhZ9kZnKXGG1KVpUuJ2FXcl6S0odGtMQgAbgmWEoiexj4eMkK+p8sBDz 1ZQ/Z9G09DNjJCuTGsySIfaOCu1HvECPxx27lNar6Hqnep+bL1KDKbRm4YamC7tb2Yze 0ko8f0ZYCjbeq+ht/vZfTSauOV0PUpQU4LwqDNeXfJjG2Wsj7CYRjmTyH87xUSdSmHE/ 9tQzPss91Q6J+/1NR4Bu7Ijhgo7gfI06rhD8OXt3ScJgnv+hjty9TSdaXsgmIDvh2zEg 4PTzPljqCrB0ly79aigsZUy/vJeGeA/4z5A9fxjjTUr549Lf7/woa83o3m3T/a7HX69d N5OA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750831883; x=1751436683; 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=nIg7uSLYwYLPcBVXqtzlLxZwwhEgM4g99J2WbjpKfps=; b=bYTzz4ouvxGODb3OW37Df6qS4TtUCSTPIBHZ5kYKxH0GHAlg403lbNU3D2LHio/hf+ MEYIiqO6GHytq2Jlb3hhCpe/Z1rHhVrYfKEk76cTFjl1QVQX4ivhvVEz9HMwW5KMQN9O ONQ+47EOV1OBpfiqr5sknDlv2GzNf0sldMkMJfiHlaxtczCFtI+8dxsKCv8n2spaIHmg /ObuAYKAw+8v/qnfT9wY5LdTfaiJtszsUk7KmeOd6pW0F80YmtqYuxLbgbG+Oppu83lG aWYPg4tMl0nEn6R0GpmA3GpO7sFfK5IKOkPz4aVWK2BHIhTPPg+dJw1+L1FEcVEmMXLL H/0Q== X-Forwarded-Encrypted: i=1; AJvYcCVa0yzWEFV2YX8wJz5oKhTYxDiju5yCAR6f5msKvTT6Tyb5hQoSAyUtYa2a9GSmK68G2vsVxNQ0rQTvAwHS@lists.postgresql.org X-Gm-Message-State: AOJu0Yzv+WOv1iiV7yVQ2N8OrKCm35Vxri2pS0A0xgXilY+fH9yVmgo5 3F/vZsS2vOTM3QaDmXXfdIPxonqBT1uUyrIxoQtJYTzG/96ljNZzy9bZqiD1PQ== X-Gm-Gg: ASbGnctGvIEa+aj30MM6VdPUTervWpaX2t7beR5nzeVmdUQ1qY/UwpssEgthNdZfDx8 2C4eS2WMLMwgUoszIqTYZdXtfQ1+spbh8Ea3c8NS1O2qkcMUVbxf7TjAo4TSaUHDxemUM9s/x0I SRZIsFSupFwplILspgcyy0/yZ5/42HcYrXBDnaTa+p0oeCFQ7AkdPGC1vOOP6OXanwGZ8pWz+Kr CcKgTo9Hq63HL66AsYT6M3tEJ38LYe29GcMpie/HsFhwxasHWaB7Qx2OVBGxLBb4nfLb2B1DnL/ qh2Gseooy6S3wYWFpwXvowosZngtOa46euAdLeVJ/4vrKLkhPsNZEhQG7ry3JJwL5YovqFtjrzs cyHCuJ36gfNnG5TDHf3KM3UBI0Uk0XhBSsmVm8uJ9vq1FMBpQqyyenpiKR02VPLhlaN8fIaSDC7 VcBqa+ze+r1TwjMRGexebDqr3KCfxf X-Google-Smtp-Source: AGHT+IFvsvAlOl6x5HM2rlvtOy5PHm5NJGA/ApLd2LtMbCFjupIIz6gElPMr9u3IrevTIt6BCAQ5lw== X-Received: by 2002:a05:6000:178b:b0:3a6:d349:1b52 with SMTP id ffacd0b85a97d-3a6ed637ad6mr1074922f8f.21.1750831883009; Tue, 24 Jun 2025 23:11:23 -0700 (PDT) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-237-181-182.eu-west-3.compute.amazonaws.com. [15.237.181.182]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-4538234f11fsm9418175e9.16.2025.06.24.23.11.22 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 24 Jun 2025 23:11:22 -0700 (PDT) Date: Wed, 25 Jun 2025 06:11:21 +0000 From: Bertrand Drouvot To: Christoph Berg Cc: Tomas Vondra , Andres Freund , Tomas Vondra , pgsql-hackers@lists.postgresql.org Subject: Re: pgsql: Introduce pg_shmem_allocations_numa view Message-ID: References: <6342f601-77de-4ee0-8c2a-3deb50ceac5b@vondra.me> <8649a4e3-c60d-4f37-aa6f-e7e7c14c581e@vondra.me> <8961c087-e49b-4b16-9437-31331625215c@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 Hi, On Tue, Jun 24, 2025 at 05:30:02PM +0200, Christoph Berg wrote: > Re: Tomas Vondra > > If it's a reliable fix, then I guess we can do it like this. But won't > > that be a performance penalty on everyone? Or does the system split the > > array into 16-element chunks anyway, so this makes no difference? > > There's still the overhead of the syscall itself. But no idea how > costly it is to have this 16-step loop in user or kernel space. > > We could claim that on 32-bit systems, shared_buffers would be smaller > anyway, so there the overhead isn't that big. And the step size should > be larger (if at all) on 64-bit. Right, and we already mention in the doc that using those views is "very slow" or "can take a noticeable amount of time". > > Anyway, maybe we should start by reporting this to the kernel people. Do > > you want me to do that, or shall one of you take care of that? I suppose > > that'd be better, as you already wrote a fix / know the code better. > > Submitted: https://marc.info/?l=linux-mm&m=175077821909222&w=2 Thanks! I had in mind to look at how to report such a bug and provide a patch but you beat me to it. Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com