Bug 858790

Summary: Thread limit hit less than that defined by ulimit -u
Product: Red Hat Enterprise Linux 6 Reporter: Everett Bennett <everett.bennett>
Component: kernelAssignee: Jerome Marchand <jmarchan>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Red Hat Kernel QE team <kernel-qe>
Severity: low Docs Contact:
Priority: unspecified    
Version: 6.3CC: anton, everett.bennett, luke2261-2017
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-02-02 14:28:33 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
thread_limit.c none

Description Everett Bennett 2012-09-19 17:13:47 UTC
Created attachment 614484 [details]
thread_limit.c

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}'
4382719

- 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
2.
3.
  
Actual results:

 - 31490

Expected results:

 - 41000

Additional info:  See attached test program.

Comment 2 RHEL Program Management 2012-12-14 08:28:39 UTC
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 16:50:20 UTC
(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 14:29:26 UTC
Please close this ticket.  I provided all the info I had at the time.

Comment 6 Everett Bennett, Jr. 2014-10-03 11:30:00 UTC
I have nothing to add to this ticket.