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 1tYJgg-008rIL-My for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Jan 2025 06:49:07 +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 1tYJgf-006xMB-9M for pgsql-hackers@arkaria.postgresql.org; Thu, 16 Jan 2025 06:49:05 +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 1tYJgf-006xM3-0E for pgsql-hackers@lists.postgresql.org; Thu, 16 Jan 2025 06:49:05 +0000 Received: from mail-wr1-x433.google.com ([2a00:1450:4864:20::433]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tYJgd-000hLA-08 for pgsql-hackers@lists.postgresql.org; Thu, 16 Jan 2025 06:49:05 +0000 Received: by mail-wr1-x433.google.com with SMTP id ffacd0b85a97d-3863c36a731so479274f8f.1 for ; Wed, 15 Jan 2025 22:49:02 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1737010141; x=1737614941; 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=gQCYQ8JYNDy1KtVcrq7PxPDY/41PJZUSjuS3buzdiLI=; b=ExjnwETQJs0JN2tPfjS+GFYV6CysFTpDZeDXuSmb+UAGlKbUX/JnBqBLd6MDgcPlu1 TQPyP2OoXkh0NKFQ+du7nVmQAe9ZiQmduYxtfrnCiUKfCH9JpsLUKMOKotI2BeeVfp6c V/yiRaxRtAPqXv8QkUXHhLDlPxY/S0MbGRjMmJB0FeGA/YNWXU9psAdkaCKICMptFNZ5 oli/ywzMZxvki9/S6d+pUUwklUCYPGSSns5XKNnoA6fyHBdjtv4JTGE5ksfsEt7er+9L FxeEs7CdnIfWTOc5axA7xPKX4m8OMfRnAt/dIt5MF6nlTfpxxJ8qsHrQuq6DuqHjKJTm 2WPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737010141; x=1737614941; 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=gQCYQ8JYNDy1KtVcrq7PxPDY/41PJZUSjuS3buzdiLI=; b=nOIxiKY3cB/zrcQx9PWHxNkBHcHdpbvHpgX2PL/qwpgLAE9dNPDuQQqJm5xDh98Hl9 p5bF1oqAm5aOLBYmgRQHdRYy+FFW+cdpc2xuUENGAHOaC3O3wu7dO2UmT868Zs0YKoVb UJ62QGQ251sw4xbaSNgnbb+pgO/zsC7oP/7kc3YAnZR322GNJ69Pa4QGfYoGua2ZAuDc h9faoeFTrI8bglXyLNmEXcyWD5r+R5JHgjhHEfbgcoJDi8G4y9yWuOH14gwx+rtzvR6S HzPs6skNVpc3o/I4xQ/clvsJgAkBDQqFtk9fkmmNgXD8Kfp1yC6mdSXNjzK4f9q2uxts GreQ== X-Forwarded-Encrypted: i=1; AJvYcCXH0dQ50zrclA+YAGCq5KMfK/VsA0Bk/58voOco+mnvpnPM5k768tHj3VxZjjvzbDNhGD9VdbLuqUGqLo+l@lists.postgresql.org X-Gm-Message-State: AOJu0YwSOQVgV3BK1YBasRL7kXYqZfW6U66B05laDzWbx7NMfEapEqNw /UGGgsgrqAxJOscN7Q8QJeDaPHS1qoxJkx9J3N8uIA86SxYRZT7s X-Gm-Gg: ASbGncuFeWzfowunfUcYX1UcHHJKYIUQxy3IxrZfUiC8GhNJ9muZkg6NEAzR8KUZiHb VRxmQM7nkGC19QL+WC7rF2YRKjDHBqaBB/TbOaFJiEkxh0pqYT7PjplwOwpHeq9hAZMwolWMiKo 0Hz3pqSV9rQl3aTR8BCEdAV1fkC0tkBzMJ58vcVcM3xQGVBjxq7tVM6tAbq6gSLwzFrLTVFSqQy z3Imo1z9XOcgPShDni9Lg/XZiUnZcaoMCrzvVImbsVa5t3ZZIps/Pgp2S88nXQ0rqgL8S6P4SIu h3ytrXNOFZ/L9mADc4+sSNh4uRTqJbXRpuNSBm0v/fjdVOYdFssNUHtaBpEigaooSWe4zPc2Hgu Ccil786k= X-Google-Smtp-Source: AGHT+IEAVDDQqbVefB6dTmpAFf330wPs7qA8IKoHY99hrSCydldvdDYhiRYwE575XipWe2lfrLp9Tg== X-Received: by 2002:a5d:64cb:0:b0:386:399a:7f17 with SMTP id ffacd0b85a97d-38a8730cb2bmr24543771f8f.24.1737010140537; Wed, 15 Jan 2025 22:49:00 -0800 (PST) Received: from ip-10-97-1-34.eu-west-3.compute.internal (ec2-15-236-134-5.eu-west-3.compute.amazonaws.com. [15.236.134.5]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38be2b0bf2esm6238520f8f.57.2025.01.15.22.48.59 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jan 2025 22:48:59 -0800 (PST) Date: Thu, 16 Jan 2025 06:48:58 +0000 From: Bertrand Drouvot To: Michael Paquier Cc: Nazir Bilal Yavuz , Alvaro Herrera , Kyotaro Horiguchi , pgsql-hackers@lists.postgresql.org, Andres Freund Subject: Re: per backend I/O statistics Message-ID: References: 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 Thu, Jan 16, 2025 at 09:55:10AM +0900, Michael Paquier wrote: > On Wed, Jan 15, 2025 at 05:20:57PM +0300, Nazir Bilal Yavuz wrote: > > I think allowing only pgStatPendingContext to have > > MemoryContextAllowInCriticalSection() is not enough. We need to allow > > at least pgStatSharedRefContext as well to have > > MemoryContextAllowInCriticalSection() as it can be allocated too. > > > > ''' > > pgstat_prep_pending_entry() -> > > pgstat_get_entry_ref() -> > > pgstat_get_entry_ref_cached() -> > > MemoryContextAlloc(pgStatSharedRefContext, sizeof(PgStat_EntryRef)) > > ''' > > Yep, I was pretty sure that we have a bit more going on. Last time I > began digging into the issue I was loading injection_points in > shared_preload_libraries with stats enabled to see how much I could > break, and this was one pattern once I've forced the pending part. I > didn't get through the whole exercise. I'll look at it and come back with a proposal as part of [1]. [1]: https://www.postgresql.org/message-id/Z4dRlNuhSQ3hPPv2@paquier.xyz Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com