diff options
author | Rafael J. Wysocki <rjw@sisk.pl> | 2011-12-21 15:59:45 -0500 |
---|---|---|
committer | Rafael J. Wysocki <rjw@sisk.pl> | 2011-12-21 15:59:45 -0500 |
commit | b00f4dc5ff022cb9cbaffd376d9454d7fa1e496f (patch) | |
tree | 40f1b232e2f1e8ac365317a14fdcbcb331722b46 /net/sunrpc | |
parent | 1eac8111e0763853266a171ce11214da3a347a0a (diff) | |
parent | b9e26dfdad5a4f9cbdaacafac6998614cc9c41bc (diff) |
Merge branch 'master' into pm-sleep
* master: (848 commits)
SELinux: Fix RCU deref check warning in sel_netport_insert()
binary_sysctl(): fix memory leak
mm/vmalloc.c: remove static declaration of va from __get_vm_area_node
ipmi_watchdog: restore settings when BMC reset
oom: fix integer overflow of points in oom_badness
memcg: keep root group unchanged if creation fails
nilfs2: potential integer overflow in nilfs_ioctl_clean_segments()
nilfs2: unbreak compat ioctl
cpusets: stall when updating mems_allowed for mempolicy or disjoint nodemask
evm: prevent racing during tfm allocation
evm: key must be set once during initialization
mmc: vub300: fix type of firmware_rom_wait_states module parameter
Revert "mmc: enable runtime PM by default"
mmc: sdhci: remove "state" argument from sdhci_suspend_host
x86, dumpstack: Fix code bytes breakage due to missing KERN_CONT
IB/qib: Correct sense on freectxts increment and decrement
RDMA/cma: Verify private data length
cgroups: fix a css_set not found bug in cgroup_attach_proc
oprofile: Fix uninitialized memory access when writing to writing to oprofilefs
Revert "xen/pv-on-hvm kexec: add xs_reset_watches to shutdown watches from old kernel"
...
Conflicts:
kernel/cgroup_freezer.c
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/sched.c | 30 | ||||
-rw-r--r-- | net/sunrpc/xprt.c | 10 | ||||
-rw-r--r-- | net/sunrpc/xprtsock.c | 3 |
3 files changed, 28 insertions, 15 deletions
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index 5317b9341b53..3341d8962786 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c | |||
@@ -591,6 +591,27 @@ void rpc_prepare_task(struct rpc_task *task) | |||
591 | task->tk_ops->rpc_call_prepare(task, task->tk_calldata); | 591 | task->tk_ops->rpc_call_prepare(task, task->tk_calldata); |
592 | } | 592 | } |
593 | 593 | ||
594 | static void | ||
595 | rpc_init_task_statistics(struct rpc_task *task) | ||
596 | { | ||
597 | /* Initialize retry counters */ | ||
598 | task->tk_garb_retry = 2; | ||
599 | task->tk_cred_retry = 2; | ||
600 | task->tk_rebind_retry = 2; | ||
601 | |||
602 | /* starting timestamp */ | ||
603 | task->tk_start = ktime_get(); | ||
604 | } | ||
605 | |||
606 | static void | ||
607 | rpc_reset_task_statistics(struct rpc_task *task) | ||
608 | { | ||
609 | task->tk_timeouts = 0; | ||
610 | task->tk_flags &= ~(RPC_CALL_MAJORSEEN|RPC_TASK_KILLED|RPC_TASK_SENT); | ||
611 | |||
612 | rpc_init_task_statistics(task); | ||
613 | } | ||
614 | |||
594 | /* | 615 | /* |
595 | * Helper that calls task->tk_ops->rpc_call_done if it exists | 616 | * Helper that calls task->tk_ops->rpc_call_done if it exists |
596 | */ | 617 | */ |
@@ -603,6 +624,7 @@ void rpc_exit_task(struct rpc_task *task) | |||
603 | WARN_ON(RPC_ASSASSINATED(task)); | 624 | WARN_ON(RPC_ASSASSINATED(task)); |
604 | /* Always release the RPC slot and buffer memory */ | 625 | /* Always release the RPC slot and buffer memory */ |
605 | xprt_release(task); | 626 | xprt_release(task); |
627 | rpc_reset_task_statistics(task); | ||
606 | } | 628 | } |
607 | } | 629 | } |
608 | } | 630 | } |
@@ -805,11 +827,6 @@ static void rpc_init_task(struct rpc_task *task, const struct rpc_task_setup *ta | |||
805 | task->tk_calldata = task_setup_data->callback_data; | 827 | task->tk_calldata = task_setup_data->callback_data; |
806 | INIT_LIST_HEAD(&task->tk_task); | 828 | INIT_LIST_HEAD(&task->tk_task); |
807 | 829 | ||
808 | /* Initialize retry counters */ | ||
809 | task->tk_garb_retry = 2; | ||
810 | task->tk_cred_retry = 2; | ||
811 | task->tk_rebind_retry = 2; | ||
812 | |||
813 | task->tk_priority = task_setup_data->priority - RPC_PRIORITY_LOW; | 830 | task->tk_priority = task_setup_data->priority - RPC_PRIORITY_LOW; |
814 | task->tk_owner = current->tgid; | 831 | task->tk_owner = current->tgid; |
815 | 832 | ||
@@ -819,8 +836,7 @@ static void rpc_init_task(struct rpc_task *task, const struct rpc_task_setup *ta | |||
819 | if (task->tk_ops->rpc_call_prepare != NULL) | 836 | if (task->tk_ops->rpc_call_prepare != NULL) |
820 | task->tk_action = rpc_prepare_task; | 837 | task->tk_action = rpc_prepare_task; |
821 | 838 | ||
822 | /* starting timestamp */ | 839 | rpc_init_task_statistics(task); |
823 | task->tk_start = ktime_get(); | ||
824 | 840 | ||
825 | dprintk("RPC: new task initialized, procpid %u\n", | 841 | dprintk("RPC: new task initialized, procpid %u\n", |
826 | task_pid_nr(current)); | 842 | task_pid_nr(current)); |
diff --git a/net/sunrpc/xprt.c b/net/sunrpc/xprt.c index f4385e45a5fc..c64c0ef519b5 100644 --- a/net/sunrpc/xprt.c +++ b/net/sunrpc/xprt.c | |||
@@ -995,13 +995,11 @@ out_init_req: | |||
995 | 995 | ||
996 | static void xprt_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *req) | 996 | static void xprt_free_slot(struct rpc_xprt *xprt, struct rpc_rqst *req) |
997 | { | 997 | { |
998 | if (xprt_dynamic_free_slot(xprt, req)) | ||
999 | return; | ||
1000 | |||
1001 | memset(req, 0, sizeof(*req)); /* mark unused */ | ||
1002 | |||
1003 | spin_lock(&xprt->reserve_lock); | 998 | spin_lock(&xprt->reserve_lock); |
1004 | list_add(&req->rq_list, &xprt->free); | 999 | if (!xprt_dynamic_free_slot(xprt, req)) { |
1000 | memset(req, 0, sizeof(*req)); /* mark unused */ | ||
1001 | list_add(&req->rq_list, &xprt->free); | ||
1002 | } | ||
1005 | rpc_wake_up_next(&xprt->backlog); | 1003 | rpc_wake_up_next(&xprt->backlog); |
1006 | spin_unlock(&xprt->reserve_lock); | 1004 | spin_unlock(&xprt->reserve_lock); |
1007 | } | 1005 | } |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 2d78d95955ab..55472c48825e 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -496,7 +496,7 @@ static int xs_nospace(struct rpc_task *task) | |||
496 | struct rpc_rqst *req = task->tk_rqstp; | 496 | struct rpc_rqst *req = task->tk_rqstp; |
497 | struct rpc_xprt *xprt = req->rq_xprt; | 497 | struct rpc_xprt *xprt = req->rq_xprt; |
498 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); | 498 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); |
499 | int ret = 0; | 499 | int ret = -EAGAIN; |
500 | 500 | ||
501 | dprintk("RPC: %5u xmit incomplete (%u left of %u)\n", | 501 | dprintk("RPC: %5u xmit incomplete (%u left of %u)\n", |
502 | task->tk_pid, req->rq_slen - req->rq_bytes_sent, | 502 | task->tk_pid, req->rq_slen - req->rq_bytes_sent, |
@@ -508,7 +508,6 @@ static int xs_nospace(struct rpc_task *task) | |||
508 | /* Don't race with disconnect */ | 508 | /* Don't race with disconnect */ |
509 | if (xprt_connected(xprt)) { | 509 | if (xprt_connected(xprt)) { |
510 | if (test_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags)) { | 510 | if (test_bit(SOCK_ASYNC_NOSPACE, &transport->sock->flags)) { |
511 | ret = -EAGAIN; | ||
512 | /* | 511 | /* |
513 | * Notify TCP that we're limited by the application | 512 | * Notify TCP that we're limited by the application |
514 | * window size | 513 | * window size |