From owner-svn-src-all@FreeBSD.ORG Fri Jan 9 01:32:00 2015 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 0568ADA0 for ; Fri, 9 Jan 2015 01:32:00 +0000 (UTC) Received: from mail-qg0-x235.google.com (mail-qg0-x235.google.com [IPv6:2607:f8b0:400d:c04::235]) (using TLSv1 with cipher ECDHE-RSA-RC4-SHA (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id AF1029A3 for ; Fri, 9 Jan 2015 01:31:59 +0000 (UTC) Received: by mail-qg0-f53.google.com with SMTP id l89so5994763qgf.12 for ; Thu, 08 Jan 2015 17:31:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:subject:date:message-id:user-agent:in-reply-to:references :mime-version:content-transfer-encoding:content-type; bh=WL9iBXdUv7q9Oh0KB2821HX2qGMsPwVzhly/pWLorjM=; b=dbCZCJPEjePDTeD7a0NWLStpS3Z/LM1DdaBJphi3ZQmtWUGTXI3wOIH1mW/FH5axVP nx8NblRJybRXCQQoRueXVQJ7OkyOi3vuJYtomztwf9McCYpHtXCeluR54PS+TlDzd83j 4EjyN+IJkpETwhEvACekc76WFvT4XvIbfvXPSGX0fwI+7u27HJpDTkJbmyI6uEJghXi1 nBnk1zqYVST0yMXE/QKbfhcEP73kyz64v3I/GPy71qSzhD6rH13h/ure5Wj44/nplqB9 bO4EQL2sDva2cu7tMS4ub7lqNxDDQHweOzAqBmxZmJDi4CqNKTCycW5fbpoh/litUZSL P96Q== X-Received: by 10.229.124.4 with SMTP id s4mr21952102qcr.11.1420767118739; Thu, 08 Jan 2015 17:31:58 -0800 (PST) Received: from shawnwebb-laptop.localnet ([73.173.99.185]) by mx.google.com with ESMTPSA id r12sm5636489qax.38.2015.01.08.17.31.57 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 08 Jan 2015 17:31:58 -0800 (PST) From: Shawn Webb To: svn-src-all@freebsd.org Subject: Re: svn commit: r275619 - head/sys/kern Date: Thu, 08 Jan 2015 20:31:57 -0500 Message-ID: <2831247.sj7Llqh6Xj@shawnwebb-laptop> User-Agent: KMail/4.14.2 (FreeBSD/11.0-CURRENT; KDE/4.14.2; amd64; ; ) In-Reply-To: <201412081642.sB8GgZbm006861@svn.freebsd.org> References: <201412081642.sB8GgZbm006861@svn.freebsd.org> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 09 Jan 2015 01:32:00 -0000 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