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 1uvyOA-004NGo-AR for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Sep 2025 13:28:03 +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 1uvyO9-00CDG7-Gd for pgsql-hackers@arkaria.postgresql.org; Tue, 09 Sep 2025 13:28:01 +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 1uvyO9-00CDFz-73 for pgsql-hackers@lists.postgresql.org; Tue, 09 Sep 2025 13:28:01 +0000 Received: from mail-pg1-x535.google.com ([2607:f8b0:4864:20::535]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uvyO8-001TgH-04 for pgsql-hackers@lists.postgresql.org; Tue, 09 Sep 2025 13:28:00 +0000 Received: by mail-pg1-x535.google.com with SMTP id 41be03b00d2f7-b52196e8464so2575280a12.3 for ; Tue, 09 Sep 2025 06:27:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1757424479; x=1758029279; 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=h3K29FhNbk7qMAWKfd29CW00KjYfmEp4Iqdvp74bzSU=; b=VRn3ZJWndvssQnzOEql2f8a3AgNx6uvi5xqJ7uYT/qKXMiIdXDW7n0sWNjEzlFkA82 /gk+VJD3VkvaicB21FvcFpD8Ue2KIKGVJJwwUQnoF3qKE31aY8vgLmOQdDJd5eaqCU0o aI9zl1EUALjHci8VmBoOVGCbET9mPvy7W0k6sSiAo57diizS9DnTVQOUYRqpGXpFlAFG WYcYs20UQHFjcgb0CrKHjA1BDUcWuE+64yhm3Qp/yqKNoIyJ1fQZmO69OjBNKbIpdSwR A0E47nqoSIn6X8gBMynYhFYlBcnn4U12I9GUhziVR3+2tV3E3JORg5NxAQTupAs2q7xd eYaw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1757424479; x=1758029279; 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=h3K29FhNbk7qMAWKfd29CW00KjYfmEp4Iqdvp74bzSU=; b=fU8YyIQyJ+oOzCeFC3N58PWD4sNkjspbGzoaCkvTDHs0lDccRbwLv3zux/KApb2kFj mx1h079WUlorbRx7Z94hWKwvuk8W8ihr2UVwH7dixVcKYMhEFb4aFXi3hucdNcjErICw TCUsF9XKv26RRr5BKrO/5ASz3nIz4uR6qhBeR46cV7R7sagcf11KPlWp95MITKf5qNiq kEpr1kfFDHueoq08iRX5upKPHMj9X+x9zIUXYXr961IyQdCRFwie/Rpf/Qu/edLVALHm 8SrEdhB1Csuolwq4Gdy42N8ebSyoetnjiqk4emw+vkCnoMLs4+zkHw+JHTPHcQyVuQVl +Mcg== X-Gm-Message-State: AOJu0YxDqbJTojCnlUr3xi1jjtbTyZ6G1yJVhqgM8D09BzgTJpXL/4Np B4Gh7HK0Bc3peqfcX3jZX7VlC2vz5QaXDMiQUG1JinIqmK7cam0VA2Ea8d+RkYLeop+tVa6oxv0 UYd7AgMgp2qnVtuAm6ZJPmAQKUdH/DFhD+nDImgA= X-Gm-Gg: ASbGnct+psRtqKCtDrQ88Orgl/tuQa7UMLPjNfFOhBatpVJJR+zv6gaGzQvyEhxUIQK Lihu3DHI2XgRal0120ukR0Ffto5/piyEy0KD4W0q84dZOWP/VW42SC3ms16TXuy4u/KUgBNZ7Ti mSlodmhdzqPTRsIeKDOvcUmSRg+QhOzrR5rxnwgGlPo0MVsde9Exjp2jITYl2on7CCQrNUvu4B8 Ab8dtihbJyY20gDHmqC X-Google-Smtp-Source: AGHT+IEKSH/PUvieSyEoWRflwChF0vnUf7rQsLtoAOd2oPxks4MO8vaYx7bqqchh5Kg1ElEJKziVbZ0lUtVHQ35+XCM= X-Received: by 2002:a17:902:ebca:b0:24c:cf58:c5c3 with SMTP id d9443c01a7336-2516f05046amr159142165ad.23.1757424478868; Tue, 09 Sep 2025 06:27:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Nazir Bilal Yavuz Date: Tue, 9 Sep 2025 16:27:47 +0300 X-Gm-Features: AS18NWAO4Nl0tBNfoGbjninqNHx_oudwOq5vgckLIbxMBLoMfnjne2MZ3nCHORg Message-ID: Subject: Re: Checkpointer write combining To: Melanie Plageman Cc: PostgreSQL Hackers , Andres Freund 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 Hi, Thank you for working on this! On Tue, 9 Sept 2025 at 02:44, Melanie Plageman wrote: > > On Tue, Sep 2, 2025 at 5:10=E2=80=AFPM Melanie Plageman > wrote: > > > > The attached patchset implements checkpointer write combining -- which > > makes immediate checkpoints at least 20% faster in my tests. > > Checkpointer achieves higher write throughput and higher write IOPs > > with the patch. I did the same benchmark you did and I found it is %50 faster (16 seconds to 8 seconds). From 053dd9d15416d76ce4b95044d848f51ba13a2d20 Mon Sep 17 00:00:00 2001 From: Melanie Plageman Date: Tue, 2 Sep 2025 11:00:44 -0400 Subject: [PATCH v2 1/9] Refactor goto into for loop in GetVictimBuffer() @@ -731,6 +741,13 @@ StrategyRejectBuffer(BufferAccessStrategy strategy, BufferDesc *buf, bool from_r strategy->buffers[strategy->current] !=3D BufferDescriptorGetBuffe= r(buf)) return false; + buf_state =3D LockBufHdr(buf); + lsn =3D BufferGetLSN(buf); + UnlockBufHdr(buf, buf_state); + + if (!XLogNeedsFlush(lsn)) + return true; I think this should return false. I am planning to review the other patches later and this is for the first patch only. -- Regards, Nazir Bilal Yavuz Microsoft