mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2025-04-09 10:47:34 +00:00
MEDIUM: mux-fcgi: use task_kill() during fcgi_takeover() instead of task_wakeup()
task_wakeup() passes the task through the global run queue under the global RQ lock, which is expensive when dealing with large amounts of fcgi_takeover() calls. Let's use the new task_kill() instead to kill the task.
This commit is contained in:
parent
617e80ff76
commit
88d18f81ae
@ -4082,6 +4082,7 @@ static void fcgi_show_fd(struct buffer *msg, struct connection *conn)
|
|||||||
static int fcgi_takeover(struct connection *conn)
|
static int fcgi_takeover(struct connection *conn)
|
||||||
{
|
{
|
||||||
struct fcgi_conn *fcgi = conn->ctx;
|
struct fcgi_conn *fcgi = conn->ctx;
|
||||||
|
struct task *task;
|
||||||
|
|
||||||
if (fd_takeover(conn->handle.fd, conn) != 0)
|
if (fd_takeover(conn->handle.fd, conn) != 0)
|
||||||
return -1;
|
return -1;
|
||||||
@ -4093,10 +4094,13 @@ static int fcgi_takeover(struct connection *conn)
|
|||||||
*/
|
*/
|
||||||
fcgi->wait_event.tasklet->context = NULL;
|
fcgi->wait_event.tasklet->context = NULL;
|
||||||
tasklet_wakeup(fcgi->wait_event.tasklet);
|
tasklet_wakeup(fcgi->wait_event.tasklet);
|
||||||
if (fcgi->task) {
|
|
||||||
fcgi->task->context = NULL;
|
task = fcgi->task;
|
||||||
/* Wake the task, to let it free itself */
|
if (task) {
|
||||||
task_wakeup(fcgi->task, TASK_WOKEN_OTHER);
|
task->context = NULL;
|
||||||
|
fcgi->task = NULL;
|
||||||
|
__ha_barrier_store();
|
||||||
|
task_kill(task);
|
||||||
|
|
||||||
fcgi->task = task_new(tid_bit);
|
fcgi->task = task_new(tid_bit);
|
||||||
if (!fcgi->task) {
|
if (!fcgi->task) {
|
||||||
|
Loading…
Reference in New Issue
Block a user