public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Hongyu Wang <wwwhhhyyy333@gmail.com>
Cc: Hongyu Wang <hongyu.wang@intel.com>, gcc-patches@gcc.gnu.org
Subject: Re: [PATCH] libgomp: Fix default value of GOMP_SPINCOUNT [PR 109062]
Date: Wed, 8 Mar 2023 10:03:32 +0100	[thread overview]
Message-ID: <ZAhPZPEnHvpt++N1@tucnak> (raw)
In-Reply-To: <CA+OydW=HZHAanKHU3uzBkzL8paJtcPO7coSQuU6Wqmi7-8GqJw@mail.gmail.com>

On Wed, Mar 08, 2023 at 04:54:20PM +0800, Hongyu Wang wrote:
> > Seems for many ICVs the default values are done through
> > gomp_default_icv_values, but that doesn't cover wait_policy.
> > For other vars, the defaults are provided through just initializers of
> > those vars on the var definitions, e.g.:
> > char *gomp_affinity_format_var = "level %L thread %i affinity %A";
> > So, I'd do the initialize_icvs change and change
> > static int wait_policy;
> > to
> > static int wait_policy = -1;
> 
> Agreed, here is the updated patch, ok for trunk?
> 
> When OMP_WAIT_POLICY is not specified, current implementation will cause
> icv flag GOMP_ICV_WAIT_POLICY unset, so global variable wait_policy
> will remain its uninitialized value. Initialize it to -1 to make
> GOMP_SPINCOUNT behavior consistent with its description.
> 
> libgomp/ChangeLog:
> 
> PR libgomp/109062
> * env.c (wait_policy): Initialize to -1.
> (initialize_icvs): Initialize icvs->wait_policy to -1.
> * testsuite/libgomp.c-c++-common/pr109062.c: New test.

Ok, thanks.

	Jakub


      reply	other threads:[~2023-03-08  9:03 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-03-08  6:31 Hongyu Wang
2023-03-08  7:35 ` Jakub Jelinek
2023-03-08  8:07   ` Hongyu Wang
2023-03-08  8:21     ` Hongyu Wang
2023-03-08  8:35       ` Jakub Jelinek
2023-03-08  8:54         ` Hongyu Wang
2023-03-08  9:03           ` Jakub Jelinek [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=ZAhPZPEnHvpt++N1@tucnak \
    --to=jakub@redhat.com \
    --cc=gcc-patches@gcc.gnu.org \
    --cc=hongyu.wang@intel.com \
    --cc=wwwhhhyyy333@gmail.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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).