public inbox for glibc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libc/28310] New: Do not use affinity mask for sysconf (_SC_NPROCESSORS_CONF)
@ 2021-09-06 10:46 fweimer at redhat dot com
  2021-09-06 13:28 ` [Bug libc/28310] " nsaenzju at redhat dot com
                   ` (4 more replies)
  0 siblings, 5 replies; 6+ messages in thread
From: fweimer at redhat dot com @ 2021-09-06 10:46 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28310

            Bug ID: 28310
           Summary: Do not use affinity mask for sysconf
                    (_SC_NPROCESSORS_CONF)
           Product: glibc
           Version: unspecified
            Status: NEW
          Severity: normal
          Priority: P2
         Component: libc
          Assignee: unassigned at sourceware dot org
          Reporter: fweimer at redhat dot com
                CC: drepper.fsp at gmail dot com
  Target Milestone: ---

The change in bug 27645 breaks the top command in common hypervisor
configurations (and also other monitoring tools). That's far more drastic than
some container use case that does not even work reliably with most container
hosts (only those that lie about affinity masks or are very unusual in that
they do not oversubscribe CPUs).

Related commit:

commit 903bc7dcc2acafc40be11639767e10a2de712649
Author: Adhemerval Zanella <adhemerval.zanella@linaro.org>
Date:   Thu Mar 25 09:30:07 2021 -0300

    linux: Use sched_getaffinity for __get_nprocs (BZ #27645)

    Both the sysfs and procfs parsing (through GET_NPROCS_PARSER) are
    removed in favor the syscall.  The initial scratch buffer should
    fit to most of the common usage (1024 bytes with maps to 8192 CPUs).

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/28310] Do not use affinity mask for sysconf (_SC_NPROCESSORS_CONF)
  2021-09-06 10:46 [Bug libc/28310] New: Do not use affinity mask for sysconf (_SC_NPROCESSORS_CONF) fweimer at redhat dot com
@ 2021-09-06 13:28 ` nsaenzju at redhat dot com
  2021-09-06 18:04 ` adhemerval.zanella at linaro dot org
                   ` (3 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: nsaenzju at redhat dot com @ 2021-09-06 13:28 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28310

Nicolas Saenz Julienne <nsaenzju at redhat dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |nsaenzju at redhat dot com

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/28310] Do not use affinity mask for sysconf (_SC_NPROCESSORS_CONF)
  2021-09-06 10:46 [Bug libc/28310] New: Do not use affinity mask for sysconf (_SC_NPROCESSORS_CONF) fweimer at redhat dot com
  2021-09-06 13:28 ` [Bug libc/28310] " nsaenzju at redhat dot com
@ 2021-09-06 18:04 ` adhemerval.zanella at linaro dot org
  2021-09-27 12:33 ` adhemerval.zanella at linaro dot org
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 6+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2021-09-06 18:04 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28310

Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |adhemerval.zanella at linaro dot o
                   |                            |rg
           Assignee|unassigned at sourceware dot org   |adhemerval.zanella at linaro dot o
                   |                            |rg

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/28310] Do not use affinity mask for sysconf (_SC_NPROCESSORS_CONF)
  2021-09-06 10:46 [Bug libc/28310] New: Do not use affinity mask for sysconf (_SC_NPROCESSORS_CONF) fweimer at redhat dot com
  2021-09-06 13:28 ` [Bug libc/28310] " nsaenzju at redhat dot com
  2021-09-06 18:04 ` adhemerval.zanella at linaro dot org
@ 2021-09-27 12:33 ` adhemerval.zanella at linaro dot org
  2023-11-03 12:37 ` rajis at linux dot ibm.com
  2023-11-06 13:35 ` adhemerval.zanella at linaro dot org
  4 siblings, 0 replies; 6+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2021-09-27 12:33 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28310

Adhemerval Zanella <adhemerval.zanella at linaro dot org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Resolution|---                         |FIXED
             Status|NEW                         |RESOLVED
   Target Milestone|---                         |2.35

--- Comment #1 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
Fixed on 2.35.

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/28310] Do not use affinity mask for sysconf (_SC_NPROCESSORS_CONF)
  2021-09-06 10:46 [Bug libc/28310] New: Do not use affinity mask for sysconf (_SC_NPROCESSORS_CONF) fweimer at redhat dot com
                   ` (2 preceding siblings ...)
  2021-09-27 12:33 ` adhemerval.zanella at linaro dot org
@ 2023-11-03 12:37 ` rajis at linux dot ibm.com
  2023-11-06 13:35 ` adhemerval.zanella at linaro dot org
  4 siblings, 0 replies; 6+ messages in thread
From: rajis at linux dot ibm.com @ 2023-11-03 12:37 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28310

Rajalakshmi <rajis at linux dot ibm.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |rajis at linux dot ibm.com

--- Comment #2 from Rajalakshmi <rajis at linux dot ibm.com> ---
Hi Adhemerval

Commit 342298278eabc75baabcaced110a11a02c3d3580 reverted the use of
sched_getaffinity on get_nprocs()
However, in commit 11a02b035b464ab6813676adfd19c4a59c36d907 we still use
__get_nprocs_sched () instead of __get_nprocs() in malloc/arena.c 

There is a performance degradation issue reported on POWER10 RHEL9(glibc 2.34)
compared to RHEL 8 *(glibc 2.28)  when using IBM ESSL application with 80 omp
threads.   While debugging , figured out that  using __get_nprocs()
instead of __get_nprocs_sched () in malloc/arena.c fixes the issue.  I don’t
have reduced test  to replicate the issue. 

Do you have any comments/suggestions?

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

* [Bug libc/28310] Do not use affinity mask for sysconf (_SC_NPROCESSORS_CONF)
  2021-09-06 10:46 [Bug libc/28310] New: Do not use affinity mask for sysconf (_SC_NPROCESSORS_CONF) fweimer at redhat dot com
                   ` (3 preceding siblings ...)
  2023-11-03 12:37 ` rajis at linux dot ibm.com
@ 2023-11-06 13:35 ` adhemerval.zanella at linaro dot org
  4 siblings, 0 replies; 6+ messages in thread
From: adhemerval.zanella at linaro dot org @ 2023-11-06 13:35 UTC (permalink / raw)
  To: glibc-bugs

https://sourceware.org/bugzilla/show_bug.cgi?id=28310

--- Comment #3 from Adhemerval Zanella <adhemerval.zanella at linaro dot org> ---
I proposed a fix [1], that now DJ has withdraw his dissent.  For old re

[1]
https://patchwork.sourceware.org/project/glibc/patch/20231011164356.2218554-1-adhemerval.zanella@linaro.org/(In
reply to Rajalakshmi from comment #2)
> Hi Adhemerval
> 
> Commit 342298278eabc75baabcaced110a11a02c3d3580 reverted the use of
> sched_getaffinity on get_nprocs()
> However, in commit 11a02b035b464ab6813676adfd19c4a59c36d907 we still use
> __get_nprocs_sched () instead of __get_nprocs() in malloc/arena.c 
> 
> There is a performance degradation issue reported on POWER10 RHEL9(glibc
> 2.34) compared to RHEL 8 *(glibc 2.28)  when using IBM ESSL application with
> 80 omp threads.   While debugging , figured out that  using __get_nprocs()
> instead of __get_nprocs_sched () in malloc/arena.c fixes the issue.  I don’t
> have reduced test  to replicate the issue. 
> 
> Do you have any comments/suggestions?

I proposed a fix [1], that now DJ has withdraw his dissent. I will prob install
this this week, and as mitigation you can tune the maximum number of arenas
(GLIBC_TUNABLES=glibc.malloc.arena_max=number).

[1]
https://patchwork.sourceware.org/project/glibc/patch/20231011164356.2218554-1-adhemerval.zanella@linaro.org/

-- 
You are receiving this mail because:
You are on the CC list for the bug.

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

end of thread, other threads:[~2023-11-06 13:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-09-06 10:46 [Bug libc/28310] New: Do not use affinity mask for sysconf (_SC_NPROCESSORS_CONF) fweimer at redhat dot com
2021-09-06 13:28 ` [Bug libc/28310] " nsaenzju at redhat dot com
2021-09-06 18:04 ` adhemerval.zanella at linaro dot org
2021-09-27 12:33 ` adhemerval.zanella at linaro dot org
2023-11-03 12:37 ` rajis at linux dot ibm.com
2023-11-06 13:35 ` adhemerval.zanella at linaro dot org

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