Skip to content

Commit

Permalink
nfsd regression since delayed fput()
Browse files Browse the repository at this point in the history
Background: nfsd v[23] had throughput regression since delayed fput
went in; every read or write ends up doing fput() and we get a pair
of extra context switches out of that (plus quite a bit of work
in queue_work itselfi, apparently).  Use of schedule_delayed_work()
gives it a chance to accumulate a bit before we do __fput() on all
of them.  I'm not too happy about that solution, but... on at least
one real-world setup it reverts about 10% throughput loss we got from
switch to delayed fput.

Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
  • Loading branch information
Al Viro committed Oct 20, 2013
1 parent 43ae9e3 commit c7314d7
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fs/file_table.c
Original file line number Diff line number Diff line change
Expand Up @@ -297,7 +297,7 @@ void flush_delayed_fput(void)
delayed_fput(NULL);
}

static DECLARE_WORK(delayed_fput_work, delayed_fput);
static DECLARE_DELAYED_WORK(delayed_fput_work, delayed_fput);

void fput(struct file *file)
{
Expand All @@ -317,7 +317,7 @@ void fput(struct file *file)
}

if (llist_add(&file->f_u.fu_llist, &delayed_fput_list))
schedule_work(&delayed_fput_work);
schedule_delayed_work(&delayed_fput_work, 1);
}
}

Expand Down

0 comments on commit c7314d7

Please sign in to comment.