Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 08 Jan 2015 20:31:57 -0500
From:      Shawn Webb <lattera@gmail.com>
To:        svn-src-all@freebsd.org
Subject:   Re: svn commit: r275619 - head/sys/kern
Message-ID:  <2831247.sj7Llqh6Xj@shawnwebb-laptop>
In-Reply-To: <201412081642.sB8GgZbm006861@svn.freebsd.org>
References:  <201412081642.sB8GgZbm006861@svn.freebsd.org>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, December 08, 2014 04:42:35 PM Konstantin Belousov wrote:
> Author: kib
> Date: Mon Dec  8 16:42:34 2014
> New Revision: 275619
> URL: https://svnweb.freebsd.org/changeset/base/275619
> 
> Log:
>   When getnewbuf_reuse_bp() is called to reclaim some (clean) buffer,
>   the vnode owning the buffer is not locked.  More, it cannot be locked
>   safely, since getnewbuf_reuse_bp() is called from newbuf(), and some
>   other vnode is already locked, for which reused buffer will be
>   reassigned.
> 
>   As the consequence, reclamation of the owning vnode could go in
>   parallel, in particular, the call to vnode_destroy_vobject(), which
>   deallocates the vm object and zeroes the v_bufobj->bo_object.  Note
>   that the pages wired by the buffer are left wired and can be safely
>   freed by the vfs_vmio_release() without the need for the vm object
>   lock.  Also, seeing stale pointer to the v_object is safe due to vm
>   object type stability.
> 
>   Check for bo_bufobj != NULL and cache the value in local variable to
>   avoid trying to lock NULL vm object.

Hey Kostik,

I'm got a rather interesting LOR from this commit:

an  8 20:24:15 laptop-dev-01 kernel: [429] lock order reversal:
Jan  8 20:24:15 laptop-dev-01 kernel: [429]  1st 0xfffffe01f007bed8 bufwait 
(bufwait) @ /usr/src/sys/kern/vfs_bio.c:3097
Jan  8 20:24:15 laptop-dev-01 kernel: [429]  2nd 0xfffff80009859800 dirhash 
(dirhash) @ /usr/src/sys/ufs/ufs/ufs_dirhash.c:285
Jan  8 20:24:15 laptop-dev-01 kernel: [429] KDB: stack backtrace:
Jan  8 20:24:15 laptop-dev-01 kernel: [429] db_trace_self_wrapper() at 
db_trace_self_wrapper+0x2b/frame 0xfffffe0239b402e0
Jan  8 20:24:15 laptop-dev-01 kernel: [429] witness_checkorder() at 
witness_checkorder+0xe50/frame 0xfffffe0239b40370
Jan  8 20:24:15 laptop-dev-01 kernel: [429] _sx_xlock() at 
_sx_xlock+0x75/frame 0xfffffe0239b403b0
Jan  8 20:24:15 laptop-dev-01 kernel: [429] ufsdirhash_add() at 
ufsdirhash_add+0x3a/frame 0xfffffe0239b403f0
Jan  8 20:24:15 laptop-dev-01 kernel: [429] ufs_direnter() at 
ufs_direnter+0x642/frame 0xfffffe0239b404b0
Jan  8 20:24:15 laptop-dev-01 kernel: [429] ufs_makeinode() at 
ufs_makeinode+0x5bf/frame 0xfffffe0239b40670
Jan  8 20:24:15 laptop-dev-01 kernel: [429] ufs_create() at 
ufs_create+0x2d/frame 0xfffffe0239b40690
Jan  8 20:24:15 laptop-dev-01 kernel: [429] VOP_CREATE_APV() at 
Jan  8 20:24:15 laptop-dev-01 kernel: V
Jan  8 20:24:15 laptop-dev-01 kernel: O
Jan  8 20:24:15 laptop-dev-01 kernel: P
Jan  8 20:24:15 laptop-dev-01 kernel: _C
Jan  8 20:24:15 laptop-dev-01 kernel: R
Jan  8 20:24:15 laptop-dev-01 kernel: E
Jan  8 20:24:15 laptop-dev-01 kernel: AT
Jan  8 20:24:15 laptop-dev-01 kernel: E
Jan  8 20:24:15 laptop-dev-01 kernel: _A
Jan  8 20:24:15 laptop-dev-01 kernel: P
Jan  8 20:24:15 laptop-dev-01 kernel: V
Jan  8 20:24:15 laptop-dev-01 kernel: +0x
Jan  8 20:24:15 laptop-dev-01 kernel: f
Jan  8 20:24:15 laptop-dev-01 kernel: 1/
Jan  8 20:24:15 laptop-dev-01 kernel: f
Jan  8 20:24:15 laptop-dev-01 kernel: r
Jan  8 20:24:15 laptop-dev-01 kernel: a
Jan  8 20:24:15 laptop-dev-01 kernel: m
Jan  8 20:24:15 laptop-dev-01 kernel: e
Jan  8 20:24:15 laptop-dev-01 kernel: 0xfffffe0239b406c0
Jan  8 20:24:15 laptop-dev-01 kernel: [429] vn_open_cred() at 
vn_open_cred+0x2c6/frame 0xfffffe0239b40820
Jan  8 20:24:15 laptop-dev-01 kernel: [429] kern_openat() at 
kern_openat+0x257/frame 0xfffffe0239b409a0
Jan  8 20:24:15 laptop-dev-01 kernel: [429] amd64_syscall() at 
amd64_syscall+0x25a/frame 0xfffffe0239b40ab0
Jan  8 20:24:15 laptop-dev-01 kernel: [429] Xfast_syscall() at 
Xfast_syscall+0xfb/frame 0xfffffe0239b40ab0
Jan  8 20:24:15 laptop-dev-01 kernel: [429] --- syscall (5, FreeBSD ELF64, 
sys_open), rip = 0x8e63c8dea, rsp = 0x7ffffffc72b8, rbp = 0x7ffffffc7390 ---

Thanks,

Shawn



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?2831247.sj7Llqh6Xj>