[linux-cifs-client] Re: Cifs memory allocation problem

Steven French sfrench at us.ibm.com
Wed Jul 26 17:21:36 GMT 2006


>Hello Mr. French,
>I?ve read your post on the cifs memory allocation problem, and I have 
encountered the exact problem myself.
>You wrote in the post that you plan to rewrite the code, and I was 
wondering if you?ve finished and how it came along.
>I am very interested in your results

Which kernel version (and/or what cifs version).   "cat /proc/version 
shows the kernel version and "cat /proc/fs/cifs/DebugData" now shows the 
version of cifs.ko (or you can get the cifs version from modinfo on 
cifs.ko)

I have had few if any reports of memory allocation issues recently except 
on older versions of cifs (cifs version 1.35 had the most important low 
memory fix, cifs version 1.40 had another less important one).   Linux 
slab (memory pool) fragmentation is much less of a problem now as well in 
more recent kernels, and cifs uses perhaps 60% fewer large memory 
allocations than before (none on the critical write path).  In addition 
cifs uses mempools (which are configurable, and can be increased, by 
passing parms to "modprobe cifs") so memory allocations should occur 
rarely if at all when there are fewer than five active processes 
reading/writing network files.

CIFS memory allocation issues since we switched to a "gather send" (iovec) 
approach on writepage - has been a huge help as cifs allocates very little 
memory in the write path (when we conceivably could be freeing cached data 
on the client and thus low on memory)

There are still paths (notably reopen of file after transient server or 
network crash) where cifs uses a large buffer (ie 16.5K buffer), but these 
are much fewer.

Steve French
Senior Software Engineer
Linux Technology Center - IBM Austin
phone: 512-838-2294
email: sfrench at-sign us dot ibm dot com


More information about the linux-cifs-client mailing list