On Mon 03-05-10 13:12:40, Cameron Seader wrote:
First, we're given an inode 'ainode',
which should be the correct inode
for the file we're looking at. (If it were incorrect, we would have
gotten an error much earlier.)
If we have iget, we call iget. The 220.127.116.11-* kernels lack iget, I
believe, so instead we do:
So we are talking about SLE10 based kernels, right? In
fact these kernels
do have iget() but I guess you do not want to do all the writing by hand
and want to use standard write path and thus you need open file descriptor
for which you need a dentry...
fid.i32.ino = ainode;
fid.i32.gen = 0;
dp = afs_cacheSBp->s_export_op->fh_to_dentry(afs_cacheSBp,
&fid, sizeof(fid), FILEID_INO32_GEN);
filp = dentry_open(dp, mntget(afs_cacheMnt), O_RDWR);
Hmm, so about which kernel
are we speaking? fh_to_dentry has been
introduced only in 2.6.24...
It's not intended to be written to constantly,
but in this case it
probably is written to several times successively (due to certain
parameters set a bit low, and the high load for these clients).
I believe this function was called about 644203 times in the core I'm
looking at, which means that file was written to at least around 644000
times... I'm assuming at least most of those were right after another.
so these 644000 writes succeed and then you start getting ENOMEM?
Does the machine have enough free memory? If not, output from /proc/meminfo
and /proc/slabinfo could help to tell you where the memory has gone.
However, there would almost always be several reads of
the same file
between successive writes. (Again, in an 'open(); read(); close();'
fashion) But they are probably all happening very quickly; I assume the
cache for the stuff in this file is thrashing.
Well, the cache could be thrashing
but still you'll get ENOMEM only if
the kernel cannot find enough memory to pull in a page you are writing to.
And that should not happen unless the machine has real problems. My
personal tip would be that your code leaks some memory (or reference or so)
and thus kernel really gets out of memory after enough reading / writing...
Jan Kara <jack(a)suse.cz>
SUSE Labs, CR
To unsubscribe, e-mail: opensuse-kernel+unsubscribe(a)opensuse.org
For additional commands, e-mail: opensuse-kernel+help(a)opensuse.org