diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-31 22:25:39 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2012-07-31 22:25:39 -0400 |
commit | ac694dbdbc403c00e2c14d10bc7b8412cc378259 (patch) | |
tree | e37328cfbeaf43716dd5914cad9179e57e84df76 /net/sunrpc | |
parent | a40a1d3d0a2fd613fdec6d89d3c053268ced76ed (diff) | |
parent | 437ea90cc3afdca5229b41c6b1d38c4842756cb9 (diff) |
Merge branch 'akpm' (Andrew's patch-bomb)
Merge Andrew's second set of patches:
- MM
- a few random fixes
- a couple of RTC leftovers
* emailed patches from Andrew Morton <akpm@linux-foundation.org>: (120 commits)
rtc/rtc-88pm80x: remove unneed devm_kfree
rtc/rtc-88pm80x: assign ret only when rtc_register_driver fails
mm: hugetlbfs: close race during teardown of hugetlbfs shared page tables
tmpfs: distribute interleave better across nodes
mm: remove redundant initialization
mm: warn if pg_data_t isn't initialized with zero
mips: zero out pg_data_t when it's allocated
memcg: gix memory accounting scalability in shrink_page_list
mm/sparse: remove index_init_lock
mm/sparse: more checks on mem_section number
mm/sparse: optimize sparse_index_alloc
memcg: add mem_cgroup_from_css() helper
memcg: further prevent OOM with too many dirty pages
memcg: prevent OOM with too many dirty pages
mm: mmu_notifier: fix freed page still mapped in secondary MMU
mm: memcg: only check anon swapin page charges for swap cache
mm: memcg: only check swap cache pages for repeated charging
mm: memcg: split swapin charge function into private and public part
mm: memcg: remove needless !mm fixup to init_mm when charging
mm: memcg: remove unneeded shmem charge type
...
Diffstat (limited to 'net/sunrpc')
-rw-r--r-- | net/sunrpc/Kconfig | 5 | ||||
-rw-r--r-- | net/sunrpc/clnt.c | 9 | ||||
-rw-r--r-- | net/sunrpc/sched.c | 7 | ||||
-rw-r--r-- | net/sunrpc/xprtsock.c | 43 |
4 files changed, 62 insertions, 2 deletions
diff --git a/net/sunrpc/Kconfig b/net/sunrpc/Kconfig index 9fe8857d8d59..03d03e37a7d5 100644 --- a/net/sunrpc/Kconfig +++ b/net/sunrpc/Kconfig | |||
@@ -21,6 +21,11 @@ config SUNRPC_XPRT_RDMA | |||
21 | 21 | ||
22 | If unsure, say N. | 22 | If unsure, say N. |
23 | 23 | ||
24 | config SUNRPC_SWAP | ||
25 | bool | ||
26 | depends on SUNRPC | ||
27 | select NETVM | ||
28 | |||
24 | config RPCSEC_GSS_KRB5 | 29 | config RPCSEC_GSS_KRB5 |
25 | tristate "Secure RPC: Kerberos V mechanism" | 30 | tristate "Secure RPC: Kerberos V mechanism" |
26 | depends on SUNRPC && CRYPTO | 31 | depends on SUNRPC && CRYPTO |
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c index b05df36692ff..fa48c60aef23 100644 --- a/net/sunrpc/clnt.c +++ b/net/sunrpc/clnt.c | |||
@@ -717,6 +717,15 @@ void rpc_task_set_client(struct rpc_task *task, struct rpc_clnt *clnt) | |||
717 | atomic_inc(&clnt->cl_count); | 717 | atomic_inc(&clnt->cl_count); |
718 | if (clnt->cl_softrtry) | 718 | if (clnt->cl_softrtry) |
719 | task->tk_flags |= RPC_TASK_SOFT; | 719 | task->tk_flags |= RPC_TASK_SOFT; |
720 | if (sk_memalloc_socks()) { | ||
721 | struct rpc_xprt *xprt; | ||
722 | |||
723 | rcu_read_lock(); | ||
724 | xprt = rcu_dereference(clnt->cl_xprt); | ||
725 | if (xprt->swapper) | ||
726 | task->tk_flags |= RPC_TASK_SWAPPER; | ||
727 | rcu_read_unlock(); | ||
728 | } | ||
720 | /* Add to the client's list of all tasks */ | 729 | /* Add to the client's list of all tasks */ |
721 | spin_lock(&clnt->cl_lock); | 730 | spin_lock(&clnt->cl_lock); |
722 | list_add_tail(&task->tk_task, &clnt->cl_tasks); | 731 | list_add_tail(&task->tk_task, &clnt->cl_tasks); |
diff --git a/net/sunrpc/sched.c b/net/sunrpc/sched.c index 1f19aa15f89b..128494ec9a64 100644 --- a/net/sunrpc/sched.c +++ b/net/sunrpc/sched.c | |||
@@ -815,7 +815,10 @@ static void rpc_async_schedule(struct work_struct *work) | |||
815 | void *rpc_malloc(struct rpc_task *task, size_t size) | 815 | void *rpc_malloc(struct rpc_task *task, size_t size) |
816 | { | 816 | { |
817 | struct rpc_buffer *buf; | 817 | struct rpc_buffer *buf; |
818 | gfp_t gfp = RPC_IS_SWAPPER(task) ? GFP_ATOMIC : GFP_NOWAIT; | 818 | gfp_t gfp = GFP_NOWAIT; |
819 | |||
820 | if (RPC_IS_SWAPPER(task)) | ||
821 | gfp |= __GFP_MEMALLOC; | ||
819 | 822 | ||
820 | size += sizeof(struct rpc_buffer); | 823 | size += sizeof(struct rpc_buffer); |
821 | if (size <= RPC_BUFFER_MAXSIZE) | 824 | if (size <= RPC_BUFFER_MAXSIZE) |
@@ -889,7 +892,7 @@ static void rpc_init_task(struct rpc_task *task, const struct rpc_task_setup *ta | |||
889 | static struct rpc_task * | 892 | static struct rpc_task * |
890 | rpc_alloc_task(void) | 893 | rpc_alloc_task(void) |
891 | { | 894 | { |
892 | return (struct rpc_task *)mempool_alloc(rpc_task_mempool, GFP_NOFS); | 895 | return (struct rpc_task *)mempool_alloc(rpc_task_mempool, GFP_NOIO); |
893 | } | 896 | } |
894 | 897 | ||
895 | /* | 898 | /* |
diff --git a/net/sunrpc/xprtsock.c b/net/sunrpc/xprtsock.c index 926679459e71..400567243f84 100644 --- a/net/sunrpc/xprtsock.c +++ b/net/sunrpc/xprtsock.c | |||
@@ -1930,6 +1930,45 @@ out: | |||
1930 | current->flags &= ~PF_FSTRANS; | 1930 | current->flags &= ~PF_FSTRANS; |
1931 | } | 1931 | } |
1932 | 1932 | ||
1933 | #ifdef CONFIG_SUNRPC_SWAP | ||
1934 | static void xs_set_memalloc(struct rpc_xprt *xprt) | ||
1935 | { | ||
1936 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, | ||
1937 | xprt); | ||
1938 | |||
1939 | if (xprt->swapper) | ||
1940 | sk_set_memalloc(transport->inet); | ||
1941 | } | ||
1942 | |||
1943 | /** | ||
1944 | * xs_swapper - Tag this transport as being used for swap. | ||
1945 | * @xprt: transport to tag | ||
1946 | * @enable: enable/disable | ||
1947 | * | ||
1948 | */ | ||
1949 | int xs_swapper(struct rpc_xprt *xprt, int enable) | ||
1950 | { | ||
1951 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, | ||
1952 | xprt); | ||
1953 | int err = 0; | ||
1954 | |||
1955 | if (enable) { | ||
1956 | xprt->swapper++; | ||
1957 | xs_set_memalloc(xprt); | ||
1958 | } else if (xprt->swapper) { | ||
1959 | xprt->swapper--; | ||
1960 | sk_clear_memalloc(transport->inet); | ||
1961 | } | ||
1962 | |||
1963 | return err; | ||
1964 | } | ||
1965 | EXPORT_SYMBOL_GPL(xs_swapper); | ||
1966 | #else | ||
1967 | static void xs_set_memalloc(struct rpc_xprt *xprt) | ||
1968 | { | ||
1969 | } | ||
1970 | #endif | ||
1971 | |||
1933 | static void xs_udp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) | 1972 | static void xs_udp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) |
1934 | { | 1973 | { |
1935 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); | 1974 | struct sock_xprt *transport = container_of(xprt, struct sock_xprt, xprt); |
@@ -1954,6 +1993,8 @@ static void xs_udp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) | |||
1954 | transport->sock = sock; | 1993 | transport->sock = sock; |
1955 | transport->inet = sk; | 1994 | transport->inet = sk; |
1956 | 1995 | ||
1996 | xs_set_memalloc(xprt); | ||
1997 | |||
1957 | write_unlock_bh(&sk->sk_callback_lock); | 1998 | write_unlock_bh(&sk->sk_callback_lock); |
1958 | } | 1999 | } |
1959 | xs_udp_do_set_buffer_size(xprt); | 2000 | xs_udp_do_set_buffer_size(xprt); |
@@ -2081,6 +2122,8 @@ static int xs_tcp_finish_connecting(struct rpc_xprt *xprt, struct socket *sock) | |||
2081 | if (!xprt_bound(xprt)) | 2122 | if (!xprt_bound(xprt)) |
2082 | goto out; | 2123 | goto out; |
2083 | 2124 | ||
2125 | xs_set_memalloc(xprt); | ||
2126 | |||
2084 | /* Tell the socket layer to start connecting... */ | 2127 | /* Tell the socket layer to start connecting... */ |
2085 | xprt->stat.connect_count++; | 2128 | xprt->stat.connect_count++; |
2086 | xprt->stat.connect_start = jiffies; | 2129 | xprt->stat.connect_start = jiffies; |