Skip to content
GitLab
Projects Groups Topics Snippets
  • /
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
  • Sign in
  • L linux-iv
  • Project information
    • Project information
    • Activity
    • Labels
    • Members
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributor statistics
    • Graph
    • Compare revisions
    • Locked files
  • Issues 0
    • Issues 0
    • List
    • Boards
    • Service Desk
    • Milestones
    • Iterations
    • Requirements
  • Merge requests 0
    • Merge requests 0
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test cases
  • Deployments
    • Deployments
    • Environments
    • Releases
  • Packages and registries
    • Packages and registries
    • Container Registry
  • Monitor
    • Monitor
    • Incidents
  • Analytics
    • Analytics
    • Value stream
    • CI/CD
    • Code review
    • Insights
    • Issue
    • Repository
  • Wiki
    • Wiki
  • Snippets
    • Snippets
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • linux-arm
  • linux-iv
  • Repository
  • linux-iv
  • mm
  • slab.c
Find file BlameHistoryPermalink
  • Peter Zijlstra's avatar
    slab, lockdep: Annotate slab -> rcu -> debug_object -> slab · 83835b3d
    Peter Zijlstra authored Jul 22, 2011
    
    
    Lockdep thinks there's lock recursion through:
    
    	kmem_cache_free()
    	  cache_flusharray()
    	    spin_lock(&l3->list_lock)  <----------------.
    	    free_block()                                |
    	      slab_destroy()                            |
    		call_rcu()                              |
    		  debug_object_activate()               |
    		    debug_object_init()                 |
    		      __debug_object_init()             |
    			kmem_cache_alloc()              |
    			  cache_alloc_refill()          |
    			    spin_lock(&l3->list_lock) --'
    
    Now debug objects doesn't use SLAB_DESTROY_BY_RCU and hence there is no
    actual possibility of recursing. Luckily debug objects marks it slab
    with SLAB_DEBUG_OBJECTS so we can identify the thing.
    
    Mark all SLAB_DEBUG_OBJECTS (all one!) slab caches with a special
    lockdep key so that lockdep sees its a different cachep.
    
    Also add a WARN on trying to create a SLAB_DESTROY_BY_RCU |
    SLAB_DEBUG_OBJECTS cache, to avoid possible future trouble.
    
    Reported-and-tested-by: default avatarSebastian Siewior <sebastian@breakpoint.cc>
    [ fixes to the initial patch ]
    Reported-by: default avatarThomas Gleixner <tglx@linutronix.de>
    Acked-by: default avatarPekka Enberg <penberg@kernel.org>
    Signed-off-by: default avatarPeter Zijlstra <a.p.zijlstra@chello.nl>
    Link: http://lkml.kernel.org/r/1311341165.27400.58.camel@twins
    
    
    Signed-off-by: default avatarIngo Molnar <mingo@elte.hu>
    83835b3d