RE: PostgreSQL performance on FreeBSD

"Rang, Anton" <[email protected]> Mon, 30 Jun 2014 23:18:55 +0000
Newsgroups gmane.os.freebsd.performance
Message-ID <F21EDC44C64DB34B90AF485AC3CEDD4B353982C1__26676.519381772$1404174665$gmane$org@MX104CL01.corp.emc.com>
Thanks for this.

The cpu_search problem you reference came up here at Isilon as well.  Here's a patch which should get clang to do the "right thing" (inlining 3 specialized copies of cpu_search); I haven't checked to make sure it doesn't hurt gcc, though.

Anton

Index: sched_ule.c
===================================================================
--- sched_ule.c	(revision 268043)
+++ sched_ule.c	(working copy)
@@ -622,11 +622,11 @@
 	for ((cpu) = 0; (cpu) <= mp_maxid; (cpu)++)		\
 		if (CPU_ISSET(cpu, &mask))
 
-static __inline int cpu_search(const struct cpu_group *cg, struct cpu_search *low,
+static __always_inline int cpu_search(const struct cpu_group *cg, struct cpu_search *low,
     struct cpu_search *high, const int match);
-int cpu_search_lowest(const struct cpu_group *cg, struct cpu_search *low);
-int cpu_search_highest(const struct cpu_group *cg, struct cpu_search *high);
-int cpu_search_both(const struct cpu_group *cg, struct cpu_search *low,
+int __noinline cpu_search_lowest(const struct cpu_group *cg, struct cpu_search *low);
+int __noinline cpu_search_highest(const struct cpu_group *cg, struct cpu_search *high);
+int __noinline cpu_search_both(const struct cpu_group *cg, struct cpu_search *low,
     struct cpu_search *high);
 
 /*
@@ -640,7 +640,7 @@
  * match argument.  It is reduced to the minimum set for each case.  It is
  * also recursive to the depth of the tree.
  */
-static __inline int
+static __always_inline int
 cpu_search(const struct cpu_group *cg, struct cpu_search *low,
     struct cpu_search *high, const int match)
 {

-----Original Message-----
From: [email protected] [mailto:[email protected]] On Behalf Of Konstantin Belousov
Sent: Friday, June 27, 2014 7:56 AM
To: [email protected]
Cc: [email protected]
Subject: PostgreSQL performance on FreeBSD

Hi,
I did some measurements and hacks to see about the performance and scalability of PostgreSQL 9.3 on FreeBSD, sponsored by The FreeBSD Foundation.

The results are described in https://kib.kiev.ua/kib/pgsql_perf.pdf.
The uncommitted patches, referenced in the article, are available as https://kib.kiev.ua/kib/pig1.patch.txt
https://kib.kiev.ua/kib/patch-2
_______________________________________________
[email protected] mailing list
http://lists.freebsd.org/mailman/listinfo/freebsd-performance
To unsubscribe, send any mail to "[email protected]"