The Samba-Bugzilla – Attachment 10225 Details for
Bug 10782
mangle_hash() can fail to initialize charset (smbd crash).
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
git-am fix for 4.1.next and 4.0.next.
0001-pthreadpool-Slightly-serialize-jobs.patch (text/plain), 2.07 KB, created by
Jeremy Allison
on 2014-08-25 19:29:00 UTC
(
hide
)
Description:
git-am fix for 4.1.next and 4.0.next.
Filename:
MIME Type:
Creator:
Jeremy Allison
Created:
2014-08-25 19:29:00 UTC
Size:
2.07 KB
patch
obsolete
>From c02171065cef9de181dccc41be035887d410d9d8 Mon Sep 17 00:00:00 2001 >From: Jeremy Allison <jra@samba.org> >Date: Mon, 25 Aug 2014 12:27:54 -0700 >Subject: [PATCH] pthreadpool: Slightly serialize jobs > >Using the new msg_source program with 1.500 instances against a single >msg_sink I found the msg_source process to spawn two worker threads for >synchronously sending the data towards the receiving socket. This should >not happen: Per destination node we only create one queue. We strictly >only add pthreadpool jobs one after the other, so a single helper thread >should be perfectly sufficient. > >It turned out that under heavy overload the main sending thread was >scheduled before the thread that just had finished its send() job. So >the helper thread was not able to increment the pool->num_idle variable >indicating that we don't have to create a new thread when the new job >is added. > >This patch moves the signalling write under the mutex. This means that >indicating readiness via the pipe and the pool->num_idle variable happen both >under the same mutex lock and thus are atomic. No superfluous threads anymore. > >Back port of commit 1c4284c7395f23cefa61a407db74cf5067aee2aa >that went into master. > >https://bugzilla.samba.org/show_bug.cgi?id=10779 > >Signed-off-by: Volker Lendecke <vl@samba.org> >Reviewed-by: Jeremy Allison <jra@samba.org> >--- > source3/lib/pthreadpool/pthreadpool.c | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > >diff --git a/source3/lib/pthreadpool/pthreadpool.c b/source3/lib/pthreadpool/pthreadpool.c >index c5c9367..9c781cf 100644 >--- a/source3/lib/pthreadpool/pthreadpool.c >+++ b/source3/lib/pthreadpool/pthreadpool.c >@@ -488,14 +488,14 @@ static void *pthreadpool_server(void *arg) > > job->fn(job->private_data); > >+ res = pthread_mutex_lock(&pool->mutex); >+ assert(res == 0); >+ > written = write(pool->sig_pipe[1], &job->id, > sizeof(int)); > > free(job); > >- res = pthread_mutex_lock(&pool->mutex); >- assert(res == 0); >- > if (written != sizeof(int)) { > pthreadpool_server_exit(pool); > pthread_mutex_unlock(&pool->mutex); >-- >2.1.0.rc2.206.gedb03e5 >
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 10782
:
10223
|
10224
|
10225
|
10232