Project

General

Profile

Bug #4855

Extensive mutex locking in lookup_nfs4_server()

Added by Marcel Telka about 6 years ago. Updated about 6 years ago.

Status:
New
Priority:
Low
Assignee:
-
Category:
nfs - NFS server and client
Start date:
2014-05-08
Due date:
% Done:

0%

Estimated time:
Difficulty:
Medium
Tags:
needs-triage
Gerrit CR:

Description

The lookup_nfs4_server() is walking through the nfs4_server_lst list and acquires s_lock mutex for every entry there. This is not very optimal and it is definitively not needed. We could improve the implementation in two ways:

  1. Acquire the s_lock only in a case the current entry (np) match the passed entry (sp),
  2. once we found the sp in the list (so np == sp) we should stop the walk. There is no way how we could find sp in the list again.

As a minor improvement we should add ASSERT(sp != &nfs4_server_lst) at the beginning of the function.

Also available in: Atom PDF