diff options
author | NeilBrown <neilb@suse.de> | 2006-10-04 05:15:47 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@g5.osdl.org> | 2006-10-04 10:55:15 -0400 |
commit | 3cc03b164cf01c6f36e64720b58610d292fb26f7 (patch) | |
tree | b558e11a087945ad5b9a1a25483aa2acc8d93fbb /net/sunrpc/svcsock.c | |
parent | 4452435948424e5322c2a2fefbdc2cf3732cc45d (diff) |
[PATCH] knfsd: Avoid excess stack usage in svc_tcp_recvfrom
.. by allocating the array of 'kvec' in 'struct svc_rqst'.
As we plan to increase RPCSVC_MAXPAGES from 8 upto 256, we can no longer
allocate an array of this size on the stack. So we allocate it in 'struct
svc_rqst'.
However svc_rqst contains (indirectly) an array of the same type and size
(actually several, but they are in a union). So rather than waste space, we
move those arrays out of the separately allocated union and into svc_rqst to
share with the kvec moved out of svc_tcp_recvfrom (various arrays are used at
different times, so there is no conflict).
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'net/sunrpc/svcsock.c')
-rw-r--r-- | net/sunrpc/svcsock.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/net/sunrpc/svcsock.c b/net/sunrpc/svcsock.c index 25096d53667a..1d512337ccd9 100644 --- a/net/sunrpc/svcsock.c +++ b/net/sunrpc/svcsock.c | |||
@@ -955,7 +955,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp) | |||
955 | struct svc_sock *svsk = rqstp->rq_sock; | 955 | struct svc_sock *svsk = rqstp->rq_sock; |
956 | struct svc_serv *serv = svsk->sk_server; | 956 | struct svc_serv *serv = svsk->sk_server; |
957 | int len; | 957 | int len; |
958 | struct kvec vec[RPCSVC_MAXPAGES]; | 958 | struct kvec *vec; |
959 | int pnum, vlen; | 959 | int pnum, vlen; |
960 | 960 | ||
961 | dprintk("svc: tcp_recv %p data %d conn %d close %d\n", | 961 | dprintk("svc: tcp_recv %p data %d conn %d close %d\n", |
@@ -1053,6 +1053,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp) | |||
1053 | len = svsk->sk_reclen; | 1053 | len = svsk->sk_reclen; |
1054 | set_bit(SK_DATA, &svsk->sk_flags); | 1054 | set_bit(SK_DATA, &svsk->sk_flags); |
1055 | 1055 | ||
1056 | vec = rqstp->rq_vec; | ||
1056 | vec[0] = rqstp->rq_arg.head[0]; | 1057 | vec[0] = rqstp->rq_arg.head[0]; |
1057 | vlen = PAGE_SIZE; | 1058 | vlen = PAGE_SIZE; |
1058 | pnum = 1; | 1059 | pnum = 1; |