mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-28 10:41:38 -04:00
[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 <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
4452435948
commit
3cc03b164c
11 changed files with 44 additions and 47 deletions
|
|
@ -955,7 +955,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
|
|||
struct svc_sock *svsk = rqstp->rq_sock;
|
||||
struct svc_serv *serv = svsk->sk_server;
|
||||
int len;
|
||||
struct kvec vec[RPCSVC_MAXPAGES];
|
||||
struct kvec *vec;
|
||||
int pnum, vlen;
|
||||
|
||||
dprintk("svc: tcp_recv %p data %d conn %d close %d\n",
|
||||
|
|
@ -1053,6 +1053,7 @@ svc_tcp_recvfrom(struct svc_rqst *rqstp)
|
|||
len = svsk->sk_reclen;
|
||||
set_bit(SK_DATA, &svsk->sk_flags);
|
||||
|
||||
vec = rqstp->rq_vec;
|
||||
vec[0] = rqstp->rq_arg.head[0];
|
||||
vlen = PAGE_SIZE;
|
||||
pnum = 1;
|
||||
|
|
|
|||
Loading…
Reference in a new issue