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

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