[lkml]   [2005]   [Aug]   [8]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
SubjectRe: Fw: two 2.6.13-rc3-mm3 oddities
I am ccing this to linux-kernel for a wider audience.

On Wed, Aug 03, 2005 at 09:56:44AM +1000, Andrew Morton wrote:
> Subject: two 2.6.13-rc3-mm3 oddities
> Just wanted to record a couple of oddities I noticed with 2.6.13-rc3-mm3
> (maybe there before: I hardly tested -mm1 and didn't even download -mm2),
> which have gone away in 2.6.13-rc4-mm1 - so of no great importance, but
> perhaps worth noting in case they resurface later.
> One time my tmpfs-and-looped-tmpfs-kernel-builds collapsed with lots of
> VFS: file-max limit 49778 reached
> messages, which I imagine was a side-effect of the struct file RCU
> patches you've dropped from -rc4-mm1, perhaps a grace period problem.

Hugh, could you please try this with the experimental patch below ?
Manfred, is it safe to decrement nr_files in file_free()
instead of the destructor ? I can't see any problem.

> And repeatably (after a couple of hours or so), on both i386 and x86_64,
> those tests hung waiting on page locks, as if there was a missing
> unlock_page (or a spurious SetPageLocked) somewhere. I didn't have
> time to do any bisection, but studying source diffs showed no likely
> candidates whatsoever (I did wonder about Nick's __ClearPageDirty,
> but reproduced the problem with that backed out). As I say, gone
> away (same tests on -rc4-mm1 have run two days), but curious.

Hugh, can you mail me the exact test you run ? I would like to run
it myself and see if I can reproduce it.


nr_files need to decremented before the file structure is handed
over to RCU.

Signed-off-by: Dipankar Sarma <>

fs/file_table.c | 8 ++++----
1 files changed, 4 insertions(+), 4 deletions(-)

diff -puN fs/file_table.c~files-fix-nr-files fs/file_table.c
--- linux-2.6.13-rc3-mm3-fixes/fs/file_table.c~files-fix-nr-files 2005-08-08 18:28:12.000000000 +0530
+++ linux-2.6.13-rc3-mm3-fixes-dipankar/fs/file_table.c 2005-08-08 18:32:31.000000000 +0530
@@ -48,10 +48,6 @@ void filp_ctor(void * objp, struct kmem_

void filp_dtor(void * objp, struct kmem_cache_s *cachep, unsigned long dflags)
- unsigned long flags;
- spin_lock_irqsave(&filp_count_lock, flags);
- files_stat.nr_files--;
- spin_unlock_irqrestore(&filp_count_lock, flags);

static inline void file_free_rcu(struct rcu_head *head)
@@ -62,6 +58,10 @@ static inline void file_free_rcu(struct

static inline void file_free(struct file *f)
+ unsigned long flags;
+ spin_lock_irqsave(&filp_count_lock, flags);
+ files_stat.nr_files--;
+ spin_unlock_irqrestore(&filp_count_lock, flags);
call_rcu(&f->f_rcuhead, file_free_rcu);

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to
More majordomo info at
Please read the FAQ at

 \ /
  Last update: 2005-08-08 16:12    [W:0.058 / U:0.200 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site