RE: PostgreSQL performance on FreeBSD

From: Rang, Anton <anton.rang_at_isilon.com>
Date: Mon, 30 Jun 2014 23:18:55 +0000
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)
_at__at_ -622,11 +622,11 _at__at_
 	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);
 
 /*
_at__at_ -640,7 +640,7 _at__at_
  * 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: owner-freebsd-current_at_freebsd.org [mailto:owner-freebsd-current_at_freebsd.org] On Behalf Of Konstantin Belousov
Sent: Friday, June 27, 2014 7:56 AM
To: performance_at_freebsd.org
Cc: current_at_freebsd.org
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
Received on Mon Jun 30 2014 - 21:39:51 UTC

This archive was generated by hypermail 2.4.0 : Wed May 19 2021 - 11:40:50 UTC