Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 349453
b: refs/heads/master
c: edd2e36
h: refs/heads/master
i:
  349451: c3a7713
v: v3
  • Loading branch information
Trond Myklebust authored and Trond Myklebust committed Jan 30, 2013
1 parent aa3ae09 commit e56f624
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: ab225417825963b6dc66be7ea80f94ac1378dfdf
refs/heads/master: edd2e36fe8bd3cec4fa67e746d4c4a9246d0830e
18 changes: 17 additions & 1 deletion trunk/net/sunrpc/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,9 +98,25 @@ __rpc_add_timer(struct rpc_wait_queue *queue, struct rpc_task *task)
list_add(&task->u.tk_wait.timer_list, &queue->timer_list.list);
}

static void rpc_rotate_queue_owner(struct rpc_wait_queue *queue)
{
struct list_head *q = &queue->tasks[queue->priority];
struct rpc_task *task;

if (!list_empty(q)) {
task = list_first_entry(q, struct rpc_task, u.tk_wait.list);
if (task->tk_owner == queue->owner)
list_move_tail(&task->u.tk_wait.list, q);
}
}

static void rpc_set_waitqueue_priority(struct rpc_wait_queue *queue, int priority)
{
queue->priority = priority;
if (queue->priority != priority) {
/* Fairness: rotate the list when changing priority */
rpc_rotate_queue_owner(queue);
queue->priority = priority;
}
}

static void rpc_set_waitqueue_owner(struct rpc_wait_queue *queue, pid_t pid)
Expand Down

0 comments on commit e56f624

Please sign in to comment.