X-Original-To: pgsql-performance-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 19B0752E95 for ; Thu, 11 Aug 2005 12:25:33 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 95179-02 for ; Thu, 11 Aug 2005 15:25:31 +0000 (GMT) Received: from unicorn.rentec.com (unicorn.rentec.com [216.223.240.9]) by svr1.postgresql.org (Postfix) with ESMTP id E412652E8A for ; Thu, 11 Aug 2005 12:25:29 -0300 (ADT) Received: from wren.rentec.com (wren.rentec.com [192.5.35.106]) by unicorn.rentec.com (8.13.1/8.12.1) with ESMTP id j7BFPRfE020212 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Thu, 11 Aug 2005 11:25:28 -0400 (EDT) X-Rentec: external Received: from [172.26.132.145] (hoopoe.rentec.com [172.26.132.145]) by wren.rentec.com (8.13.1/8.12.1) with ESMTP id j7BFPRto023192 for ; Thu, 11 Aug 2005 11:25:27 -0400 (EDT) Message-ID: <42FB6DE7.7060107@rentec.com> Date: Thu, 11 Aug 2005 11:25:27 -0400 From: Alan Stange Reply-To: stange@rentec.com Organization: Renaissance Technologies Corp. User-Agent: Mozilla Thunderbird 1.0+ (X11/20050712) MIME-Version: 1.0 To: pgsql-performance@postgresql.org Subject: BG writer question? Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Logged: Logged by unicorn.rentec.com as j7BFPRfE020212 at Thu Aug 11 11:25:28 2005 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=[none] X-Spam-Level: X-Archive-Number: 200508/124 X-Sequence-Number: 13871 Hello all, I just was running strace in the writer process and I noticed this pattern: select(0, NULL, NULL, NULL, {0, 200000}) = 0 (Timeout) getppid() = 4240 time(NULL) = 1123773324 mmap2(NULL, 528384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0x81000) = 0x69ea3000 semop(1409034, 0xffffc0bc, 1) = 0 <...seeks and writes...> munmap(0x69ea3000, 528384) = 0 select(0, NULL, NULL, NULL, {0, 200000}) = 0 (Timeout) getppid() = 4240 time(NULL) = 1123773324 mmap2(NULL, 528384, PROT_READ|PROT_WRITE, MAP_PRIVATE|MAP_ANONYMOUS, -1, 0x81000) = 0x69ea3000 semop(1605648, 0xffffc0bc, 1) = 0 <...seeks and writes...> munmap(0x69ea3000, 528384) = 0 select(0, NULL, NULL, NULL, {0, 200000}) = 0 (Timeout) why mmap and munmap each time? mmap and munmap are fairly expensive operations (on some systems), especially on multi cpu machines. munmap in particular generally needs to issue cross calls to the other cpus to ensure any page mappings are invalidated. Just curious. Thanks! -- Alan