All of lore.kernel.org
 help / color / mirror / Atom feed
* negative dentry_stat.nr_unused causes aggressive dcache pruning
@ 2004-12-08 22:16 Steve Lord
  2004-12-08 23:01 ` Greg Banks
  2004-12-09 10:09 ` Andrew Morton
  0 siblings, 2 replies; 7+ messages in thread
From: Steve Lord @ 2004-12-08 22:16 UTC (permalink / raw)
  To: Linux Kernel


I have seen this stat go negative (just from booting up a multi cpu box),
and looking at the code, it is manipulated without locking in a number
of places. I have only seen this in real life on a 2.4 kernel, but 2.6
also looks vulnerable.

In 2.4 this can cause shrink_dcache_memory to attempt to push the whole
dcache out by calling prune_dcache with a negative parameter, prune_dcache
just keeps going until count hits zero or the dentry_unused list
empties.

In 2.6 kernels I do not see a real use of the variable which would cause harm,
although is someone was to start relying on more than -1 coming back from
shrink_dcache_memory there might be problems.

The problem code is dput which is the only place it is manipulated
without the dcache lock.

nr_dentry is not mp safe either, but no one depends on that.

Steve



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2004-12-09 21:56 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2004-12-08 22:16 negative dentry_stat.nr_unused causes aggressive dcache pruning Steve Lord
2004-12-08 23:01 ` Greg Banks
2004-12-09 10:09 ` Andrew Morton
2004-12-09 16:33   ` Steve Lord
2004-12-09 20:54   ` Steve Lord
2004-12-09 21:19     ` Andrew Morton
2004-12-09 21:51       ` Steve Lord

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.