pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Greg Stark <stark@mit.edu>
Cc: Robert Haas <robertmhaas@gmail.com>
Cc: PostgreSQL-development <pgsql-hackers@postgresql.org>
Subject: Re: can we optimize STACK_DEPTH_SLOP
Date: Fri, 08 Jul 2016 15:50:53 -0400
Message-ID: <24812.1468007453@sss.pgh.pa.us> (raw)
In-Reply-To: <CAM-w4HMfizBUz-Mm700-14OffBLtfEpLyAfgc2CP5cw6WvWicA@mail.gmail.com>
References: <CAM-w4HMwwcwaVvYcAH0_FGtG5GeXdYVRfvG81pXnSJWHnCfosQ@mail.gmail.com>
	<32729.1467734050@sss.pgh.pa.us>
	<CA+TgmoYubk9mjX9Vjb7dki9JZWwoW-X5pLhwPaN=jv_MD9b_Sw@mail.gmail.com>
	<28549.1467748100@sss.pgh.pa.us>
	<CAM-w4HN_U4CDuneDkXua4+Txhci5HNxkCRsCG78EkETzDQp-ZQ@mail.gmail.com>
	<19108.1467812089@sss.pgh.pa.us>
	<CAM-w4HPJr_bAWAmJ95Bwko6c31v6XY5hx8xyn5hL_JGO0OWP3Q@mail.gmail.com>
	<CAM-w4HMiJKdjX=7SZj5OTtK7-VkznVbwsC1km=4X=Y0=0rej2w@mail.gmail.com>
	<20280.1467855936@sss.pgh.pa.us>
	<20233.1467910511@sss.pgh.pa.us>
	<17417.1467949587@sss.pgh.pa.us>
	<CAM-w4HN8-ZRj4MvVT+ex5VUMzHAFumGUk914QkEyu4x9eSXTtw@mail.gmail.com>
	<10213.1467988340@sss.pgh.pa.us>
	<CAM-w4HMfizBUz-Mm700-14OffBLtfEpLyAfgc2CP5cw6WvWicA@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-hackers>

Greg Stark <stark@mit.edu> writes:
> Fwiw here's the pmap info from burbot (Linux Sparc64):
> 136      48      48 rw---    [ stack ]
> 136      48      48 rw---    [ stack ]
> 136      48      48 rw---    [ stack ]
> 136      48      48 rw---    [ stack ]
> 136      56      56 rw---    [ stack ]
> 136      80      80 rw---    [ stack ]
> 136      96      96 rw---    [ stack ]
> 136     112     112 rw---    [ stack ]
> 136     112     112 rw---    [ stack ]
> 576     576     576 rw---    [ stack ]
> 2056    2056    2056 rw---    [ stack ]

> I'm actually a bit confused how to interpret these numbers. This
> appears to be an 8kB pagesize architecture so is that 576*8kB or over
> 5MB of stack for the regexp test?

No, pmap specifies that its outputs are measured in kilobytes.  So this
is by and large the same as what I'm seeing on x86_64, again with the
caveat that the recursive regex routines seem to vary all over the place
in terms of stack consumption.

> But we don't know if there are any
> check_stack_depth calls in that call tree?

The regex recursion definitely does have check_stack_depth calls in it
(since commit b63fc2877).  But what we're trying to measure here is the
worst-case stack depth regardless of any check_stack_depth calls.  That's
a ceiling on what we might need to set STACK_DEPTH_SLOP to --- probably a
very loose ceiling, but I don't want to err on the side of underestimating
it.  I wouldn't consider either the regex or errors tests as needing to
bound STACK_DEPTH_SLOP, since we know that most of their consumption is
from recursive code that contains check_stack_depth calls.  But it's
useful to look at those depths just as a sanity check that we're getting
valid numbers.

			regards, tom lane


-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers



view thread (16+ messages)  latest in thread

Message-ID: <24812.1468007453@sss.pgh.pa.us>
Permalink:  ../24812.1468007453@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24812.1468007453@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-hackers@postgresql.org
  Cc: tgl@sss.pgh.pa.us, stark@mit.edu, robertmhaas@gmail.com
  Subject: Re: can we optimize STACK_DEPTH_SLOP
  In-Reply-To: <24812.1468007453@sss.pgh.pa.us>
  References: <CAM-w4HMwwcwaVvYcAH0_FGtG5GeXdYVRfvG81pXnSJWHnCfosQ@mail.gmail.com> <32729.1467734050@sss.pgh.pa.us> <CA+TgmoYubk9mjX9Vjb7dki9JZWwoW-X5pLhwPaN=jv_MD9b_Sw@mail.gmail.com> <28549.1467748100@sss.pgh.pa.us> <CAM-w4HN_U4CDuneDkXua4+Txhci5HNxkCRsCG78EkETzDQp-ZQ@mail.gmail.com> <19108.1467812089@sss.pgh.pa.us> <CAM-w4HPJr_bAWAmJ95Bwko6c31v6XY5hx8xyn5hL_JGO0OWP3Q@mail.gmail.com> <CAM-w4HMiJKdjX=7SZj5OTtK7-VkznVbwsC1km=4X=Y0=0rej2w@mail.gmail.com> <20280.1467855936@sss.pgh.pa.us> <20233.1467910511@sss.pgh.pa.us> <17417.1467949587@sss.pgh.pa.us> <CAM-w4HN8-ZRj4MvVT+ex5VUMzHAFumGUk914QkEyu4x9eSXTtw@mail.gmail.com> <10213.1467988340@sss.pgh.pa.us> <CAM-w4HMfizBUz-Mm700-14OffBLtfEpLyAfgc2CP5cw6WvWicA@mail.gmail.com> <24812.1468007453@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox