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 7C04132ACB1 for ; Fri, 15 Oct 2004 21:39:58 +0100 (BST) 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 61786-04 for ; Fri, 15 Oct 2004 20:39:55 +0000 (GMT) Received: from mail.osdl.org (fw.osdl.org [65.172.181.6]) by svr1.postgresql.org (Postfix) with ESMTP id 49A9032A47F for ; Fri, 15 Oct 2004 21:39:54 +0100 (BST) Received: (from markw@localhost) by mail.osdl.org (8.11.6/8.11.6) id i9FKdm611366; Fri, 15 Oct 2004 13:39:48 -0700 Date: Fri, 15 Oct 2004 13:39:47 -0700 From: Mark Wong To: Sean Chittenden Cc: Kevin Brown , pgsql-performance@postgresql.org Subject: Re: mmap (was First set of OSDL Shared Mem scalability results, some wierdness ... Message-ID: <20041015133947.A9225@osdl.org> References: <157f64840410141725162e43b5@mail.gmail.com> <20041015010841.GE665@filer> <0E3BB9CB-1EE6-11D9-A0BB-000A95C705DC@chittenden.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2.5i In-Reply-To: <0E3BB9CB-1EE6-11D9-A0BB-000A95C705DC@chittenden.org>; from sean@chittenden.org on Fri, Oct 15, 2004 at 01:09:01PM -0700 X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200410/239 X-Sequence-Number: 8715 On Fri, Oct 15, 2004 at 01:09:01PM -0700, Sean Chittenden wrote: [snip] > > > > This ultimately depends on two things: how much time is spent copying > > buffers around in kernel memory, and how much advantage can be gained > > by freeing up the memory used by the backends to store the > > backend-local copies of the disk pages they use (and thus making that > > memory available to the kernel to use for additional disk buffering). > > Someone on IRC pointed me to some OSDL benchmarks, which broke down > where time is being spent. Want to know what the most expensive part > of PostgreSQL is? *drum roll* > > http://khack.osdl.org/stp/297960/profile/DBT_2_Profile-tick.sort > > 3967393 total 1.7735 > 2331284 default_idle 36426.3125 > 825716 do_sigaction 1290.1813 > 133126 __copy_from_user_ll 1040.0469 > 97780 __copy_to_user_ll 763.9062 > 43135 finish_task_switch 269.5938 > 30973 do_anonymous_page 62.4456 > 24175 scsi_request_fn 22.2197 > 23355 __do_softirq 121.6406 > 17039 __wake_up 133.1172 > 16527 __make_request 10.8730 > 9823 try_to_wake_up 13.6431 > 9525 generic_unplug_device 66.1458 > 8799 find_get_page 78.5625 > 7878 scsi_end_request 30.7734 > > Copying data to/from userspace and signal handling!!!! Let's hear it > for the need for mmap(2)!!! *crowd goes wild* > [snip] I know where the do_sigaction is coming from in this particular case. Manfred Spraul tracked it to a pair of pgsignal calls in libpq. Commenting out those two calls out virtually eliminates do_sigaction from the kernel profile for this workload. I've lost track of the discussion over the past year, but I heard a rumor that it was finally addressed to some degree. I did understand it touched on a lot of other things, but can anyone summarize where that discussion has gone? Mark