Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1bKuYt-00041N-6X for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Jul 2016 21:40:51 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1bKuYs-000467-Pm for pgsql-bugs@arkaria.postgresql.org; Wed, 06 Jul 2016 21:40:50 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1bKuYE-0002dD-Ns for pgsql-bugs@postgresql.org; Wed, 06 Jul 2016 21:40:10 +0000 Received: from mail-vk0-x231.google.com ([2607:f8b0:400c:c05::231]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1bKuY8-0007Nc-41 for pgsql-bugs@postgresql.org; Wed, 06 Jul 2016 21:40:09 +0000 Received: by mail-vk0-x231.google.com with SMTP id m127so261971459vkb.3 for ; Wed, 06 Jul 2016 14:40:03 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=heroku.com; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=8lGzQrWeN5Qn/Pwx3f4G/dFkTRtyODLepXGYn3PkxVk=; b=dtgBKIEKvzt6N85A+I23tIEqKAw6e9sa9QYqAAXeNl/VbPflnkG4F2EBxEbVQTxKU6 dNf66w+WsTWsaqsYJCgmi+FRd1OLHrzkrsH7D8+nBSMz0abR/39yvhYaFiVvYeWuQxrR ebNpYZIkqGIW9J/vUm3PYVCwsLG4kEH/o+BVqEVrAA6RtcLmb8Pod3C3wjfGWbS8nGSp gyvMKty1dlwTcLV0kHE6d7p3FOgzoeTItsEwZMcPs8lGMTKCsB1DQoZkZJCCnmcCHb9k eUkjLAEKKhYsPHaun74GcDoR+h6gjGPda00NW3CGUQIA2lQYMpULaT5bS0DicrdcEIIm oImg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=8lGzQrWeN5Qn/Pwx3f4G/dFkTRtyODLepXGYn3PkxVk=; b=fhldpylsl8KOC/7ixuBlTcN/jLGSRmyQw1MK4mPtSsEIZfnoPHyguWA6cneQlJLlTr ahRJOou6j3hi16AflEfWMCyjlfpkb4ebQIdO0AZIi7Aafpqb40aASrw5LB+9atrY1nDA YxyjRTOedW7GcsUw3/30iESnF88s2wvwkmrwA13givSaNFef121NoRcwMNZ/LxBwrS4s XYQX2i99J02fK1BKOhegpyl2NaicMHrh0CMuNeAOdxn0uFg+tJzuW3pop1eU0cRidkYP SRQAq9B0muE6NDA9mCNU0YFUKpZTZf6HaWwzyB2ttzF7MxMy6J4jRJo9mwrBPIfzKhzM XlDw== X-Gm-Message-State: ALyK8tIA1Npl8/XZ+hGmCAVOdUEACznGt4qKx4ge7Mcsnyc+Ldmv8aFGQalE5yZWS/u8X+QWWS+FyIbwTwuKsk7I X-Received: by 10.31.60.204 with SMTP id j195mr10784158vka.132.1467841202654; Wed, 06 Jul 2016 14:40:02 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.151.80 with HTTP; Wed, 6 Jul 2016 14:40:02 -0700 (PDT) In-Reply-To: <20160706212600.GA649263@alvherre.pgsql> References: <878txea5b4.fsf@news-spur.riddles.org.uk> <20160706212600.GA649263@alvherre.pgsql> From: Peter Geoghegan Date: Wed, 6 Jul 2016 14:40:02 -0700 Message-ID: Subject: Re: BUG #14231: logical replication wal sender process spins when using error traps in function To: Alvaro Herrera Cc: Andrew Gierth , blake@rcmail.com, pgsql-bugs , Andres Freund Content-Type: text/plain; charset=UTF-8 X-Pg-Spam-Score: -2.7 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org On Wed, Jul 6, 2016 at 2:26 PM, Alvaro Herrera wrote: >> So I think this is primarily an artifact of doing so much retail >> palloc/pfree in a single memory context. > > As I recall, this is the main reason Andres stuck the slab cache in > reorderbuffer. Maybe it'd be worthwhile to implement a different > MemoryContext tailored to this use case, and remove the slab cache > stuff. I withdraw my remarks on that commit -- I don't think that's what it is now. I had luck adding a new child memory context for tuplesort.c in commit 0011c0091e886b874e485a46ff2c94222ffbf550. This allowed tuplesort.c to blow away the free list via a new call to MemoryContextReset(). This didn't even remove *any* pfree() operations in the affected codepath, but was still quite effective. I'm not sure that that's comparable, but it may be an interesting case that others are not aware of. -- Peter Geoghegan -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs