Bug 858790 - Thread limit hit less than that defined by ulimit -u
Thread limit hit less than that defined by ulimit -u
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: kernel (Show other bugs)
x86_64 Linux
unspecified Severity low
: rc
: ---
Assigned To: Jerome Marchand
Red Hat Kernel QE team
Depends On:
  Show dependency treegraph
Reported: 2012-09-19 13:13 EDT by Everett Bennett
Modified: 2014-10-03 07:30 EDT (History)
3 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Last Closed: 2014-02-02 09:28:33 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---

Attachments (Terms of Use)
thread_limit.c (730 bytes, application/octet-stream)
2012-09-19 13:13 EDT, Everett Bennett
no flags Details

  None (edit)
Description Everett Bennett 2012-09-19 13:13:47 EDT
Created attachment 614484 [details]

Description of problem:

I see this errno when testing limits of thread creation:

Thread creation failed after 31490 threads, errno=11 

I have the following settings:

- ulimit -u = 65536
- spanned pages =  4382719

cat /proc/zoneinfo|grep spanned|awk '{a=a+$2 } END {print a}'

- MemTotal:       16211752 kB

- kernel.threads-max = 1048576

- Defined in /etc/pam.d/login:  session    required   pam_limits.so

Version-Release number of selected component (if applicable):

How reproducible:

Steps to Reproduce:
1.  Use /tmp/thread_limit.c
Actual results:

 - 31490

Expected results:

 - 41000

Additional info:  See attached test program.
Comment 2 RHEL Product and Program Management 2012-12-14 03:28:39 EST
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.
Comment 3 Jerome Marchand 2014-01-16 11:50:20 EST
(In reply to Everett Bennett from comment #0)
> - ulimit -u = 65536
> - kernel.threads-max = 1048576
> Actual results:
>  - 31490
> Expected results:
>  - 41000

Why do you expect 41000? I don't see where that number comes from.

pthread_create() could also fail for the lack of a limited ressource or because an other limit is exceeded. 
For instance the max number of mapping (/proc/sys/vm/max_map_count) could be exceeded.

Could you also run strace on your program to see what syscall (clone, mmap...) fails and how (EAGAIN, ENOMEM)?
Comment 5 Everett Bennett 2014-09-15 10:29:26 EDT
Please close this ticket.  I provided all the info I had at the time.
Comment 6 Everett Bennett, Jr. 2014-10-03 07:30:00 EDT
I have nothing to add to this ticket.

Note You need to log in before you can comment on or make changes to this bug.