public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libgomp/109062] New: [13 regression] Default value of GOMP_SPINCOUNT changes since r13-2545
@ 2023-03-08  3:23 wwwhhhyyy333 at gmail dot com
  2023-03-08  7:51 ` [Bug libgomp/109062] " rguenth at gcc dot gnu.org
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: wwwhhhyyy333 at gmail dot com @ 2023-03-08  3:23 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109062

            Bug ID: 109062
           Summary: [13 regression] Default value of GOMP_SPINCOUNT
                    changes since r13-2545
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libgomp
          Assignee: unassigned at gcc dot gnu.org
          Reporter: wwwhhhyyy333 at gmail dot com
                CC: jakub at gcc dot gnu.org
  Target Milestone: ---

Recently we found several big regressions on Phoronix OpenMP benchmark on
GCC13. The regressions is caused by r13-2545-g9f2fca56593a2b

The issue is, the default value of GOMP_SPINCOUNT is now 0, instead of 300000
before this patch, which caused all Openmp program behaves like
OMP_WAIT_POLICY=passive.

As the comments in libgomp/env.c says:

 /* Using a rough estimation of 100000 spins per msec,
    use 5 min blocking for OMP_WAIT_POLICY=active,
    3 msec blocking when OMP_WAIT_POLICY is not specificed
    and 0 when OMP_WAIT_POLICY=passive.
    Depending on the CPU speed, this can be e.g. 5 times longer
    or 5 times shorter.  */

The current code for wait_policy is

if (none != NULL && gomp_get_icv_flag (none->flags, GOMP_ICV_WAIT_POLICY))
  wait_policy = none->icvs.wait_policy;
else if (all != NULL && gomp_get_icv_flag (all->flags, GOMP_ICV_WAIT_POLICY))
  wait_policy = all->icvs.wait_policy;

If OMP_WAIT_POLICY not specified, non of the branch will be entered since
gomp_get_icv_flag will return 0 by default, then wait_policy remains its value
as uninitialized. While prior to this patch wait_policy will be set to -1 (not
specified) by parse_wait_policy ().

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libgomp/109062] [13 regression] Default value of GOMP_SPINCOUNT changes since r13-2545
  2023-03-08  3:23 [Bug libgomp/109062] New: [13 regression] Default value of GOMP_SPINCOUNT changes since r13-2545 wwwhhhyyy333 at gmail dot com
@ 2023-03-08  7:51 ` rguenth at gcc dot gnu.org
  2023-03-09  1:01 ` cvs-commit at gcc dot gnu.org
  2023-03-09  1:07 ` wwwhhhyyy333 at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: rguenth at gcc dot gnu.org @ 2023-03-08  7:51 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109062

Richard Biener <rguenth at gcc dot gnu.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
   Target Milestone|---                         |13.0
           Keywords|                            |openmp

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libgomp/109062] [13 regression] Default value of GOMP_SPINCOUNT changes since r13-2545
  2023-03-08  3:23 [Bug libgomp/109062] New: [13 regression] Default value of GOMP_SPINCOUNT changes since r13-2545 wwwhhhyyy333 at gmail dot com
  2023-03-08  7:51 ` [Bug libgomp/109062] " rguenth at gcc dot gnu.org
@ 2023-03-09  1:01 ` cvs-commit at gcc dot gnu.org
  2023-03-09  1:07 ` wwwhhhyyy333 at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: cvs-commit at gcc dot gnu.org @ 2023-03-09  1:01 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109062

--- Comment #1 from CVS Commits <cvs-commit at gcc dot gnu.org> ---
The master branch has been updated by Hongyu Wang <hongyuw@gcc.gnu.org>:

https://gcc.gnu.org/g:288bc7b5d17511d1791899e4b2e3bf3489eb06dd

commit r13-6548-g288bc7b5d17511d1791899e4b2e3bf3489eb06dd
Author: Hongyu Wang <hongyu.wang@intel.com>
Date:   Wed Mar 8 11:29:46 2023 +0800

    libgomp: Fix default value of GOMP_SPINCOUNT [PR 109062]

    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.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [Bug libgomp/109062] [13 regression] Default value of GOMP_SPINCOUNT changes since r13-2545
  2023-03-08  3:23 [Bug libgomp/109062] New: [13 regression] Default value of GOMP_SPINCOUNT changes since r13-2545 wwwhhhyyy333 at gmail dot com
  2023-03-08  7:51 ` [Bug libgomp/109062] " rguenth at gcc dot gnu.org
  2023-03-09  1:01 ` cvs-commit at gcc dot gnu.org
@ 2023-03-09  1:07 ` wwwhhhyyy333 at gmail dot com
  2 siblings, 0 replies; 4+ messages in thread
From: wwwhhhyyy333 at gmail dot com @ 2023-03-09  1:07 UTC (permalink / raw)
  To: gcc-bugs

https://gcc.gnu.org/bugzilla/show_bug.cgi?id=109062

Hongyu Wang <wwwhhhyyy333 at gmail dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |FIXED

--- Comment #2 from Hongyu Wang <wwwhhhyyy333 at gmail dot com> ---
Fixed on trunk so far.

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2023-03-09  1:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-03-08  3:23 [Bug libgomp/109062] New: [13 regression] Default value of GOMP_SPINCOUNT changes since r13-2545 wwwhhhyyy333 at gmail dot com
2023-03-08  7:51 ` [Bug libgomp/109062] " rguenth at gcc dot gnu.org
2023-03-09  1:01 ` cvs-commit at gcc dot gnu.org
2023-03-09  1:07 ` wwwhhhyyy333 at gmail dot com

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).