Project

General

Profile

Actions

Bug #8376

closed

cached v_path should be kept fresh

Added by Patrick Mooney over 6 years ago. Updated over 6 years ago.

Status:
Closed
Priority:
Normal
Category:
kernel
Start date:
2017-06-12
Due date:
% Done:

100%

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

Description

The logic for generating and maintaining the cached v_path value on vnodes could stand to be improved. If vnodes were purely ephemeral, then freshly calculating v_path at the time of lookup() would result in correct values (at a performance cost). When they persist, either as referenced by other structures (such as open files, process cwd, dnlc entries, etc), the opportunity for the v_path to become stale arises. This is exacerbated by the current behavior that, when v_path is found to be invalid (during a vnodetopath operation) will strive to recalculate it, but not preserve the result. The overall situation leads to both performance and correctness (due to lack of results) problems relating to v_path.

This has been addressed in SmartOS through a series of changes. Firstly, to do proper invalidation of v_path when it's found to be stale:
- OS-3891 stale v_path slows vfs lookups

OS-3891 revealed that some logic made assumptions about v_path never transitioning from non-NULL to NULL. It was addressed here:
- OS-4317 v_path accesses can race

While the pathological stale v_path behavior had been addressed, there are still cases where the absence of valid v_path information was causing problems. The largest patch in this series addressed it by performing v_path checking and updates during vnode lookups/updates, when it is most convenient:
- OS-5167 cached v_path should be kept fresh

Two smaller updates are included too, to prevent erroneous behavior introduced by the prior changes:
- OS-5846 procfs should follow VFS rules
- OS-6134 vn_reinit balks on zeroed vnodes


Related issues

Related to illumos gate - Bug #6015: vnode: v_path reading should be protected by v_lockIn ProgressMarcel Telka2015-06-19

Actions
Related to illumos gate - Bug #8438: panic in vnode_valid_pnClosedPatrick Mooney2017-06-28

Actions
Related to illumos gate - Bug #14646: vnode_valid_pn() always fails for symlinksClosedMatt Barden

Actions
Actions #1

Updated by Marcel Telka over 6 years ago

  • Related to Bug #6015: vnode: v_path reading should be protected by v_lock added
Actions #2

Updated by Electric Monk over 6 years ago

  • Status changed from In Progress to Closed
  • % Done changed from 0 to 100

git commit e2fc3408efa6cdfc5e33c73c3567efc8c7592707

commit  e2fc3408efa6cdfc5e33c73c3567efc8c7592707
Author: Patrick Mooney <pmooney@pfmooney.com>
Date:   2017-06-21T18:33:14.000Z

    8376 cached v_path should be kept fresh
    Reviewed by: Jerry Jelinek <jerry.jelinek@joyent.com>
    Reviewed by: Robert Mustacchi <rm@joyent.com>
    Approved by: Gordon Ross <gwr@nexenta.com>

Actions #3

Updated by Marcel Telka over 6 years ago

  • Related to Bug #8438: panic in vnode_valid_pn added
Actions #4

Updated by Marcel Telka over 1 year ago

  • Related to Bug #14646: vnode_valid_pn() always fails for symlinks added
Actions

Also available in: Atom PDF