Login
[x]
Log in using an account from:
Fedora Account System
Red Hat Associate
Red Hat Customer
Or login using a Red Hat Bugzilla account
Forgot Password
Login:
Hide Forgot
Create an Account
Red Hat Bugzilla – Attachment 1480405 Details for
Bug 1624663
numad is the cpu utilization for the process and the wrong calculation for the cpu request for cpu usage
[?]
New
Simple Search
Advanced Search
My Links
Browse
Requests
Reports
Current State
Search
Tabular reports
Graphical reports
Duplicates
Other Reports
User Changes
Plotly Reports
Bug Status
Bug Severity
Non-Defaults
|
Product Dashboard
Help
Page Help!
Bug Writing Guidelines
What's new
Browser Support Policy
5.0.4.rh83 Release notes
FAQ
Guides index
User guide
Web Services
Contact
Legal
This site requires JavaScript to be enabled to function correctly, please enable it.
reproduce code
sfdc02154588.c (text/x-csrc), 1.52 KB, created by
Leo Song
on 2018-09-03 01:44:23 UTC
(
hide
)
Description:
reproduce code
Filename:
MIME Type:
Creator:
Leo Song
Created:
2018-09-03 01:44:23 UTC
Size:
1.52 KB
patch
obsolete
>#include <pthread.h> >#include <stdlib.h> >#include <sysexits.h> >#include <unistd.h> > >/* gcc -std=c99 -O3 -Wall -Wextra -pedantic -lpthread sfdc02154588.c -o sfdc02154588 */ >/* ===vvv=== ADJUST BELOW ===vvv=== */ >#define THREADS 8 >#define MEM_TO_USE_MB 7168 >#define DELAY_TIME 100 >/* ===^^^=== ADJUST ABOVE ===^^^=== */ > >#define __BYTES_PER_MEBIBYTE 1048576UL >#define __MEM_TO_USE (MEM_TO_USE_MB * __BYTES_PER_MEBIBYTE) >#define MEM_PER_THREAD (__MEM_TO_USE / THREADS) > >static void* thread(void* _data) >{ > (void)_data; > volatile char* ptr = NULL; > > /* allocate some memory */ > ptr = calloc(1, MEM_PER_THREAD); > > /* and do some "useful" job */ > for (;;) > for (volatile size_t i = 0; i < MEM_PER_THREAD; i++) > ptr[i]++; > > /* unreachable */ > return NULL; >} > >int main(int _argc, char** _argv) >{ > (void)_argc; > (void)_argv; > > pthread_t ids[THREADS]; > > /* spawn threads */ > for (size_t i = 0; i < THREADS; i++) > { > pthread_create (&ids[i], NULL, thread, NULL); > if(i==0) > { > /* To make the scenario, other threads are created after the delay time(default:100 sec) */ > sleep(DELAY_TIME); > } > } > /* wait for threads to finish (it won't happen) */ > for (size_t i = 0; i < THREADS; i++) > pthread_join(ids[i], NULL); > > /* unreachable */ > exit(EX_OK); >}
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Raw
Actions:
View
Attachments on
bug 1624663
: 1480405