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 1uUKLs-001TmR-1L for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Jun 2025 07:15:24 +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 1uUKLp-000mCK-VR for pgsql-hackers@arkaria.postgresql.org; Wed, 25 Jun 2025 07:15:22 +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 1uUKLp-000mCC-Kp for pgsql-hackers@lists.postgresql.org; Wed, 25 Jun 2025 07:15:22 +0000 Received: from mail-lf1-x12d.google.com ([2a00:1450:4864:20::12d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uUKLn-003yaa-0b for pgsql-hackers@lists.postgresql.org; Wed, 25 Jun 2025 07:15:21 +0000 Received: by mail-lf1-x12d.google.com with SMTP id 2adb3069b0e04-553dceb342fso1099248e87.0 for ; Wed, 25 Jun 2025 00:15:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=enterprisedb.com; s=google; t=1750835717; x=1751440517; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=fS4zSXT4keeFQkgpVRELbzD86hnI7usF1etY+Sgph9w=; b=Cr37no+v+7r+RQAZ1yPNULBmmeB2QMkt3JdTy3vwc6KOV24FBoILt7Caf2h190LEdi 9pzEewmDYjJEOQDs+tL9SABaFFkuSWZR3Z4vCzzldsi9jdisyOa7DcF7Y+FDz/v1ngPn QzH9whEidUNvKTJuMl6cJOqjp/Agy/cVjw3ONVnBDzPrPgBgioncamfTDI//k0Nfd3+D 9FWElx1s3BW+rDd7Qe7pL+peHz4yU5lqWK7jF1ceANuLDnDHu2fa83VIpDIgunD1rHBg WqzLGuYw5wFUTK82R+7k5EuRBezE4rNIAieulLIdnleMhQTBSPcYVDqGqniJMsX/Kr6x KiGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750835717; x=1751440517; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=fS4zSXT4keeFQkgpVRELbzD86hnI7usF1etY+Sgph9w=; b=Jb9UzTBpl3KdPBog1hlfex6+Wc9UXnVmjHvOjFIHkziKHQThcLGLucERdxmWK5IdT0 LDhs7e/bGffob3elL1GxTGr9UO8153SJO1TDm/RAdSlmBnM4dzUO2H/5bYD1hNXScYvT gKQjrKbtOP6XNODufZ4W1W0K89Mkx2SgE0UW8KiSr4nia1ShzCSM/yXegeRD7LqwKyCZ 2VSzJgnJofMm5yY4CR6c46as0C8ChAInnVMKIGyI/U7rpzQ8GzPLBnqBTypaEKlxV/Fm jXhb46A+nFBTDkXLro5eDx02qBKWAUzGgK/qvskdwx+16ddhLoERsP/6LHKHhBy9/9Dp st7g== X-Forwarded-Encrypted: i=1; AJvYcCXkzBoo5ImIjA/TKy/oQgYtu6ZqCJ5YOuvL6s+wjpp5BqsaZ6krvSnXA6XLKi5eLYjRpL7sKhE05WWk5pTm@lists.postgresql.org X-Gm-Message-State: AOJu0YxKC72dQ33Rl2RPVgPYwneoekVrA5oGnZhZFpR0XMA2weSs6zxM fVvRoBY7efJWcNvwJdFV2jfoAp078IV7VrUAx28+HtCYlZy07IvLGRjE9WAcaem2niyBr2++eKs JzWDUUYESrXNzdkGwkkGr4LOgJ58oRRcjsxPfLSx0 X-Gm-Gg: ASbGnctc6xPaCT6kyQ4pnhIkNA16k62MqGCmzX7duoluhzzbBHWBkeGzu31D46rGUnh SDnUOknsMc9G1D5cDe9hK/yrd9rXByGqXuflG/u4kJl97Tu9r9H3govgpIdwuPTdjNGwxc+171C yuPmJs8t8ucf1+Wn3fpjKqAQu7tFdYN+JM8Gq4RgYUD1Fl X-Google-Smtp-Source: AGHT+IE7h6EoYzqqdW/HquqGQPuPtznG0RvCG9UnDrI1wst9AZXckavgJDFh3lJajlp7fg8bvBuwE1MiGQZBgEWkJKI= X-Received: by 2002:a05:6512:12c9:b0:554:f7ec:3b23 with SMTP id 2adb3069b0e04-554fdcf4e0dmr509868e87.15.1750835717268; Wed, 25 Jun 2025 00:15:17 -0700 (PDT) MIME-Version: 1.0 References: <6342f601-77de-4ee0-8c2a-3deb50ceac5b@vondra.me> <8649a4e3-c60d-4f37-aa6f-e7e7c14c581e@vondra.me> <8961c087-e49b-4b16-9437-31331625215c@vondra.me> In-Reply-To: From: Jakub Wartak Date: Wed, 25 Jun 2025 09:15:02 +0200 X-Gm-Features: AX0GCFuDnD9w6X93f7zCYi-iKhXUaCMszMawOrQvOPVpD9_2m5DM7VgpcLgyXkU Message-ID: Subject: Re: pgsql: Introduce pg_shmem_allocations_numa view To: Christoph Berg Cc: Tomas Vondra , Bertrand Drouvot , Andres Freund , Tomas Vondra , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jun 24, 2025 at 5:30=E2=80=AFPM Christoph Berg wr= ote: > > 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. > > > Anyway, maybe we should start by reporting this to the kernel people. D= o > > you want me to do that, or shall one of you take care of that? I suppos= e > > that'd be better, as you already wrote a fix / know the code better. > > Submitted: https://marc.info/?l=3Dlinux-mm&m=3D175077821909222&w=3D2 > Hi all, I'm quite late to the party (just noticed the thread), but here's some addition context: it technically didn't make any sense to me to have NUMA on 32-bit due too small amount of addressable memory (after all, NUMA is about big iron, probably not even VMs), so in the first versions of the patchset I've excluded 32-bit (and back then for some reason I couldn't even find libnuma i386, but Andres pointed to me that it exists, so we re-added it probably just to stay consistent). The thread has kind of snowballed since then, but I still believe that NUMA on 32-bit does not make a lot of sense. Even assuming future shm interleaving one day in future version, allocation of small s_b sizes will usually fit a single NUMA node. -J.