Re: [PATCH] reduce stack usage of NFS (was Re: How to safely reduce...)

From: Randy.Dunlap
Date: Fri Oct 29 2004 - 22:08:07 EST


Denis Vlasenko wrote:
I can convert these into kmalloc'ed variants but hesitate to do so
because of possible 'need to kmalloc in order to free memory for kmalloc'
deadlocks.

how about a memory pool?

It's not THE solution but I suspect the depth of callchains of these isn't too deep so it would work

I can't see that any of the callchains Denis listed can deadlock. None
of them appear to lie in the memory reclaim paths.


This patch reduces stack usage to below 100 bytes for
the following functions:

stack usage in 2.6.9
nfs3_proc_create: 544
_nfs4_do_open: 516
nfs_readdir: 412
nfs_symlink: 368
_nfs4_open_delegation_recall: 368
nfs3_proc_rename: 364
_nfs4_open_reclaim: 364
nfs_mknod: 352
nfs_mkdir: 352
nfs_proc_create: 344
nfs3_proc_link: 328
nfs_lookup_revalidate: 312
nfs_lookup: 292

(btw: in function nfs_readdir: local variable 'desc' seem to be
easily replaceable with &my_desc, or am I missing something?)

Compile tested only. I can't run test it until next Wednesday :(

Please review, especially for leaks on error paths.

Hi Denis,
I checked all of it. Looks right & it builds.

--
~Randy
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/