Bug 216087

Summary: NFSv4.1 client recovery from NFSERR_BADSESSION might starve recovery thread
Product: Base System Reporter: Rick Macklem <rmacklem>
Component: kernAssignee: Rick Macklem <rmacklem>
Status: Closed FIXED    
Severity: Affects Some People Keywords: patch
Priority: --- Flags: rmacklem: mfc-stable11+
rmacklem: mfc-stable10+
Version: CURRENT   
Hardware: Any   
OS: Any   
Attachments:
Description Flags
Patch to give exclusive locker of nfsc_lock priority over shared lockers none

Description Rick Macklem freebsd_committer freebsd_triage 2017-01-14 22:57:45 UTC
Created attachment 178895 [details]
Patch to give exclusive locker of nfsc_lock priority over shared lockers

When the NFSv4.1 client is doing recovery from a server crash/reboot, the
recovery thread "nfscl" must acquire an exclusive lock on the clientid (nfsc_lock). This patch gives exclusive lockers priority over shared lockers,
so that the "nfscl" recovery won't be starved out (livelocked) by shared
lockers.
Comment 1 commit-hook freebsd_committer freebsd_triage 2017-04-10 01:28:38 UTC
A commit references this bug:

Author: rmacklem
Date: Mon Apr 10 01:28:01 UTC 2017
New revision: 316669
URL: https://svnweb.freebsd.org/changeset/base/316669

Log:
  Avoid starvation of the server crash recovery thread for the NFSv4 client.

  This patch gives a requestor of the exclusive lock on the client state
  in the NFSv4 client priority over shared lock requestors. This avoids
  the server crash recovery thread being starved out by other threads doing
  RPCs.

  Tested by:	cperciva
  PR:		216087
  MFC after:	2 weeks

Changes:
  head/sys/fs/nfsclient/nfs_clstate.c
Comment 2 Rick Macklem freebsd_committer freebsd_triage 2017-04-25 20:55:26 UTC
Patch has been committed and MFC'd.