Skip to content
GitLab
Projects Groups Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in
  • L lustre-release
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Repository
  • Wiki
    • Wiki
  • External wiki
    • External wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • debian-packagesdebian-packages
  • lustre-release
  • Repository
Switch branch/tag
  • lustre-release
  • lustre
  • ldlm
  • ldlm_lock.c
Find file BlameHistoryPermalink
  • NeilBrown's avatar
    LU-4801 ldlm: discard l_lock from struct ldlm_lock. · 0584eb73
    NeilBrown authored Aug 27, 2019
    
    
    This spinlock (l_lock) is only used to stablise the l_resource
    pointer while taking a spinlock on the resource.
    
    This is not necessary - it is sufficient to take the resource
    spinlock, and then check if l_resource has changed or not.  If it
    hasn't then it cannot change until the resource spinlock is dropped.
    
    We must ensure this is safe even if the resource is freed before
    lock_res_and_lock() managed to get the lock.  To do this we mark the
    slab as SLAB_TYPESAFE_BY_RCU and initialise the lock in an
    init_once() function, but not on every allocate (and specifically
    don't zero the whole struct on each allocation).
    This means that if we find a resource after taking the RCU read lock,
    then it is always safe to take and then drop the spinlock.
    After taking the spinlock, we can check if it is more generally safe
    to use.
    
    Discarding l_lock shrinks 'struct ldlm_lock' which helps save memory.
    
    Change-Id: I2646f198ca60bdbd2e94922bf7679fab31f45c41
    Signed-off-by: default avatarNeilBrown <neilb@suse.com>
    Reviewed-on: https://review.whamcloud.com/35483
    
    
    Tested-by: default avatarjenkins <devops@whamcloud.com>
    Tested-by: default avatarMaloo <maloo@whamcloud.com>
    Reviewed-by: default avatarJames Simmons <jsimmons@infradead.org>
    Reviewed-by: default avatarShaun Tancheff <shaun.tancheff@hpe.com>
    Reviewed-by: default avatarNeil Brown <neilb@suse.de>
    Reviewed-by: default avatarPetros Koutoupis <petros.koutoupis@hpe.com>
    Reviewed-by: default avatarOleg Drokin <green@whamcloud.com>
    0584eb73

https://git.gsi.de is provided by CIT→Linux&Web | GSI Helmholtzzentrum fuer Schwerionenforschung GmbH | Imprint (in German) | Privacy policy