From: Kamil Rytarowski <n54@gmx.com>
To: Simon Marchi <simark@simark.ca>, gdb-patches@sourceware.org
Cc: tom@tromey.com
Subject: Re: [PATCH v5] Implement "info proc mappings" for NetBSD
Date: Sun, 12 Apr 2020 12:17:07 +0200 [thread overview]
Message-ID: <9bd8ba41-7e83-30a9-91f5-cfd2958b2909@gmx.com> (raw)
In-Reply-To: <f4da7824-633b-24ae-4bf9-8950d29fd743@simark.ca>
On 12.04.2020 02:56, Simon Marchi wrote:
> On 2020-04-11 8:09 p.m., Kamil Rytarowski wrote:
>> + /* Prereserve more space. The length argument is volatile and can change
>> + between the sysctl(3) calls as this function can be called against a
>> + running process. */
>> + length = length * 5 / 3;
>
> I was also wondering why such a "precise" factor, and why not simply times two, for example.
>
It's just guessing and there are races... actually a kernel can return a
similar result too for various sysctl(3) calls, adding some more room
for users that forgot to enlarge the buffer.
In almost 100% cases this code will be good enough, and when it won't be
good enough we might have bigger problems in the system.
For a traced process there are no races as the process is stopped.
> In any case, the patch v5 is ok to push.
>
OK!
> Simon
>
prev parent reply other threads:[~2020-04-12 10:18 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-03-16 17:34 [PATCH] " Kamil Rytarowski
2020-03-19 13:07 ` Kamil Rytarowski
2020-03-20 15:36 ` Tom Tromey
2020-03-20 16:58 ` Kamil Rytarowski
2020-03-20 18:50 ` Tom Tromey
2020-03-20 19:13 ` Kamil Rytarowski
2020-03-25 16:36 ` John Baldwin
2020-03-26 23:24 ` Kamil Rytarowski
2020-03-20 16:58 ` [PATCH v2] " Kamil Rytarowski
2020-04-02 20:09 ` Kamil Rytarowski
2020-04-03 1:12 ` Kamil Rytarowski
2020-04-06 9:37 ` [PATCH v3] " Kamil Rytarowski
2020-04-10 10:20 ` Kamil Rytarowski
2020-04-11 21:05 ` Simon Marchi
2020-04-11 21:28 ` Kamil Rytarowski
2020-04-11 21:53 ` Simon Marchi
2020-04-11 23:45 ` [PATCH v4] " Kamil Rytarowski
2020-04-11 23:49 ` Simon Marchi
2020-04-12 0:09 ` Kamil Rytarowski
2020-04-12 0:09 ` [PATCH v5] " Kamil Rytarowski
2020-04-12 0:56 ` Simon Marchi
2020-04-12 10:17 ` Kamil Rytarowski [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9bd8ba41-7e83-30a9-91f5-cfd2958b2909@gmx.com \
--to=n54@gmx.com \
--cc=gdb-patches@sourceware.org \
--cc=simark@simark.ca \
--cc=tom@tromey.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox