Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1ciM1m-0007a7-Su for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Feb 2017 14:11:50 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1ciM1m-0002dq-Ar for pgsql-hackers@arkaria.postgresql.org; Mon, 27 Feb 2017 14:11: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 1ciM1k-0002Yf-UI for pgsql-hackers@postgresql.org; Mon, 27 Feb 2017 14:11:49 +0000 Received: from mail-wm0-x22a.google.com ([2a00:1450:400c:c09::22a]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84_2) (envelope-from ) id 1ciM1i-0003PG-1M for pgsql-hackers@postgresql.org; Mon, 27 Feb 2017 14:11:47 +0000 Received: by mail-wm0-x22a.google.com with SMTP id v77so63516089wmv.0 for ; Mon, 27 Feb 2017 06:11:45 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-transfer-encoding; bh=NkUWr/IrwJqH55Fydu61XAt9LVUiNUoaF3wOuvjMLLo=; b=IDPsb9nemNC+vb6vdnNsRFbN0wEliWc9HnPgKl/RG2Ikh7nAAXtdgeTWKQ0n0j4RXd qwQHzA0zpDIYt9rPZNuQkef+69cpKOkpTrmIkMXXi/W/qC2J9S5sfMNtyYPPqAKiLbIb gfbPNftDFzda+wQ9PqnuVTWswU3PkuXB+9XEsgi8dBHS9Dln69yoD6hTP16aFA7ffwPf CoXSMDgdScKmEZkq9GvLThYsPxs3aqbnA9+EavvvVZMo54YZVbtvQG58VEV760v5WIng cXTFVpA832sHkvGR5yaLyQVVQhzggUP5mvABtK8SoPUMWjqKW7tMDqhKn0Zn/hX4fgQc 9DRw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=NkUWr/IrwJqH55Fydu61XAt9LVUiNUoaF3wOuvjMLLo=; b=E+4cWud0zN1Htm4D1VY+coUvOPzC4+8GOqTU62pBvZVOCzTIJU9N0MMVxJk4CTrizu gV0B0sUoB64IIqJQXXpSgbzNPsE5RpDnjPkX4pdGiLuWpXNaaSHcdcT8mTq0zwRxo8Ke J5ObBc1lfBcJDqcZDHrF5mPSq+NtalJZUw1GkwMa1G0DZa/yP1/ghpPUQg00RdHhGnWb nbO4OO/VAOdFfSp42bhYXPf3f4A7Nmu+XQe1Kg8aYwQDE8GvGzRIS6MbptBDIltYjQ2S qaJbhm6ZmilGBFKWxt5s4KI9AVu1T/xc4Mu6qBUOpLhTExN37im9PcnkxhXi4cfZ4Kq3 ykmQ== X-Gm-Message-State: AMke39lIMla1jmdvRKSdmweMYocYerzpzeDZ/tw4ZzyesEflveyXxAU2iLZni1feOfq7XWgeYsf6Vof082iR2vOkBZGqQwJGd10phOKSVieoiWpERw1Qyah6Fy9zAp7ohc8sKJHmxuGKUkWLjSmLw0DxMDQSkIFoLCUqN8kqMXwPloDGiQX0vxAABKuc+GBkRO3jtdu2u9jE X-Received: by 10.28.179.7 with SMTP id c7mr13309837wmf.128.1488204704496; Mon, 27 Feb 2017 06:11:44 -0800 (PST) Received: from [10.137.2.17] (ip-89-177-46-65.net.upcbroadband.cz. [89.177.46.65]) by smtp.gmail.com with ESMTPSA id k70sm14437845wmc.3.2017.02.27.06.11.43 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 27 Feb 2017 06:11:43 -0800 (PST) Subject: Re: PATCH: two slab-like memory allocators To: Andres Freund References: <0fdc7920-f1b4-ea5c-0168-ed4f56448e53@2ndquadrant.com> <20ca0c69-e8c3-cb50-4456-f03908c672ec@2ndquadrant.com> <20170209213732.pykbsixeezcthotr@alap3.anarazel.de> <20170211013337.iw32bvfqwta634wy@alap3.anarazel.de> <53def906-2197-bc06-b987-d237f9574800@2ndquadrant.com> <20170214022221.obhdeyfn34h6hkwj@alap3.anarazel.de> <19464ac8-e66b-3598-858f-29c749bec35a@2ndquadrant.com> <20170224221038.43xf2cyonczzr6hb@alap3.anarazel.de> <20170227111732.vrx5v72ighehwpkf@alap3.anarazel.de> Cc: Petr Jelinek , Petr Jelinek , Robert Haas , John Gorman , pgsql-hackers From: Tomas Vondra Message-ID: Date: Mon, 27 Feb 2017 15:11:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.4.0 MIME-Version: 1.0 In-Reply-To: <20170227111732.vrx5v72ighehwpkf@alap3.anarazel.de> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -2.6 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 02/27/2017 12:17 PM, Andres Freund wrote: > Hi, > > On 2017-02-24 14:10:38 -0800, Andres Freund wrote: >> I've not yet looked a lot at the next type of context - I want to get >> this much committed first... >> >> I plan to give this another pass sometime this weekend and then push >> soon. > > Before committing I wanted to make sure that > http://archives.postgresql.org/message-id/32354.1487977458%40sss.pgh.pa.us > isn't a sufficient fix. > > With the test of N=1000000 from this thread I measured both runtime and > memory usage (note that's peak virtual memory which includes 2GB of > shared_buffers and such), in assert enabled builds. > > master: doesn't finish reasonably > master+doubly linked list fix: 9390.805 ms VmPeak: 10,969,424 kb > master+this thread: 6500.293 ms VmPeak: 2,969,528 kB > > So the doubly-linked-list fix is great (and much more backpatchable), > but the patches in this thread are both better runtime *and* peak memory > usage wise. So that seems like a clear call. > Nice, thanks for doing the test. > I've not yet reviewed the generational allocator yet, but during these > measurements I get: > postgres[3970][1]=# select count(*) FROM pg_logical_slot_get_changes('ttt', NULL, NULL); > WARNING: 01000: problem in Generation Tuples: number of free chunks 0 in block 0x55d011ef10f0 exceeds 7234 allocated > LOCATION: GenerationCheck, generation.c:693 > WARNING: 01000: problem in Generation Tuples: number of free chunks 0 in block 0x55d01023eba0 exceeds 65532 allocated > LOCATION: GenerationCheck, generation.c:693 > WARNING: 01000: problem in Generation Tuples: number of free chunks 0 in block 0x55d00d7fb870 exceeds 65532 allocated > LOCATION: GenerationCheck, generation.c:693 > WARNING: 01000: problem in Generation Tuples: number of free chunks 0 in block 0x55d00cde17b0 exceeds 65531 allocated > LOCATION: GenerationCheck, generation.c:693 > > that seems to occur when there's currently in-progress transactions when > finishing decoding: > ... > > could it be that the test's condition is inverted? > Yeah, that seems like the culprit - the condition seems wrong. I wonder why I haven't seen it during my tests, though ... > I'll work on getting slab committed first, and then review / edit / > commit generation.c later. One first note there is that I'm wondering > if generation.c is a too generic filename. > Naming things is hard. regards -- Tomas Vondra http://www.2ndQuadrant.com PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers