Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 13674
b: refs/heads/master
c: b01a55a
h: refs/heads/master
v: v3
  • Loading branch information
Linus Torvalds committed Nov 10, 2005
1 parent ffcc712 commit 925aedb
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 6 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: 482a8524f85a7d8c40c6fb5d072e85bc2fef327f
refs/heads/master: b01a55a865eeac0371f1a73d36b134d23d938e1a
1 change: 1 addition & 0 deletions trunk/arch/powerpc/kernel/smp.c
Original file line number Diff line number Diff line change
Expand Up @@ -510,6 +510,7 @@ int __devinit start_secondary(void *unused)

smp_store_cpu_info(cpu);
set_dec(tb_ticks_per_jiffy);
preempt_disable();
cpu_callin_map[cpu] = 1;

smp_ops->setup_cpu(cpu);
Expand Down
2 changes: 1 addition & 1 deletion trunk/arch/ppc/kernel/idle.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ void cpu_idle(void)
int cpu = smp_processor_id();

for (;;) {
while (need_resched()) {
while (!need_resched()) {
if (ppc_md.idle != NULL)
ppc_md.idle();
else
Expand Down
3 changes: 2 additions & 1 deletion trunk/kernel/sched.c
Original file line number Diff line number Diff line change
Expand Up @@ -815,7 +815,8 @@ static void activate_task(task_t *p, runqueue_t *rq, int local)
}
#endif

p->prio = recalc_task_prio(p, now);
if (!rt_task(p))
p->prio = recalc_task_prio(p, now);

/*
* This checks to make sure it's not an uninterruptible task
Expand Down
32 changes: 29 additions & 3 deletions trunk/net/sunrpc/clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ static void call_bind(struct rpc_task *task);
static void call_bind_status(struct rpc_task *task);
static void call_transmit(struct rpc_task *task);
static void call_status(struct rpc_task *task);
static void call_transmit_status(struct rpc_task *task);
static void call_refresh(struct rpc_task *task);
static void call_refreshresult(struct rpc_task *task);
static void call_timeout(struct rpc_task *task);
Expand Down Expand Up @@ -672,6 +673,18 @@ call_allocate(struct rpc_task *task)
rpc_exit(task, -ERESTARTSYS);
}

static inline int
rpc_task_need_encode(struct rpc_task *task)
{
return task->tk_rqstp->rq_snd_buf.len == 0;
}

static inline void
rpc_task_force_reencode(struct rpc_task *task)
{
task->tk_rqstp->rq_snd_buf.len = 0;
}

/*
* 3. Encode arguments of an RPC call
*/
Expand Down Expand Up @@ -867,12 +880,14 @@ call_transmit(struct rpc_task *task)
if (task->tk_status != 0)
return;
/* Encode here so that rpcsec_gss can use correct sequence number. */
if (task->tk_rqstp->rq_bytes_sent == 0) {
if (rpc_task_need_encode(task)) {
task->tk_rqstp->rq_bytes_sent = 0;
call_encode(task);
/* Did the encode result in an error condition? */
if (task->tk_status != 0)
goto out_nosend;
}
task->tk_action = call_transmit_status;
xprt_transmit(task);
if (task->tk_status < 0)
return;
Expand All @@ -884,6 +899,7 @@ call_transmit(struct rpc_task *task)
out_nosend:
/* release socket write lock before attempting to handle error */
xprt_abort_transmit(task);
rpc_task_force_reencode(task);
}

/*
Expand Down Expand Up @@ -915,7 +931,6 @@ call_status(struct rpc_task *task)
break;
case -ECONNREFUSED:
case -ENOTCONN:
req->rq_bytes_sent = 0;
if (clnt->cl_autobind)
clnt->cl_port = 0;
task->tk_action = call_bind;
Expand All @@ -937,7 +952,18 @@ call_status(struct rpc_task *task)
}

/*
* 6a. Handle RPC timeout
* 6a. Handle transmission errors.
*/
static void
call_transmit_status(struct rpc_task *task)
{
if (task->tk_status != -EAGAIN)
rpc_task_force_reencode(task);
call_status(task);
}

/*
* 6b. Handle RPC timeout
* We do not release the request slot, so we keep using the
* same XID for all retransmits.
*/
Expand Down

0 comments on commit 925aedb

Please sign in to comment.