From owner-svn-src-all@FreeBSD.ORG Tue Nov 25 12:30:45 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id B9314EF3; Tue, 25 Nov 2014 12:30:45 +0000 (UTC) Received: from bsdpad.com (xc1.bsdpad.com [195.154.136.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 7AE43209; Tue, 25 Nov 2014 12:30:44 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bsdpad.com) by bsdpad.com with smtp (Exim 4.83 (FreeBSD)) (envelope-from ) id 1XtFDm-000Evp-MY; Tue, 25 Nov 2014 12:27:54 +0000 Received: by bsdpad.com (nbSMTP-1.00) for uid 1001 br@bsdpad.com; Tue, 25 Nov 2014 12:27:54 +0000 (GMT) Date: Tue, 25 Nov 2014 12:27:54 +0000 From: Ruslan Bukin To: Gleb Smirnoff Subject: Re: svn commit: r274914 - in head/sys: kern sys ufs/ffs vm Message-ID: <20141125122754.GA57252@bsdpad.com> References: <201411231201.sANC1rW1025589@svn.freebsd.org> <20141124110537.GA41282@bsdpad.com> <20141124173733.GI17068@kib.kiev.ua> <20141124180356.GA47782@bsdpad.com> <20141124192902.GQ47144@FreeBSD.org> <20141124211620.GA49975@bsdpad.com> <20141125073145.GT47144@FreeBSD.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="uAKRQypu60I7Lcqm" Content-Disposition: inline In-Reply-To: <20141125073145.GT47144@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Konstantin Belousov , svn-src-head@freebsd.org, svn-src-all@freebsd.org, src-committers@freebsd.org 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: Tue, 25 Nov 2014 12:30:45 -0000 --uAKRQypu60I7Lcqm Content-Type: text/plain; charset=utf-8 Content-Disposition: inline On Tue, Nov 25, 2014 at 10:31:45AM +0300, Gleb Smirnoff wrote: > On Mon, Nov 24, 2014 at 09:16:20PM +0000, Ruslan Bukin wrote: > R> On Mon, Nov 24, 2014 at 10:29:02PM +0300, Gleb Smirnoff wrote: > R> > On Mon, Nov 24, 2014 at 06:03:56PM +0000, Ruslan Bukin wrote: > R> > R> > I this on stock kernel or on kernel with your modifications ? > R> > R> > R> > R> Stock one. I also checked with no virtio but MDROOT - same problems. > R> > > R> > I could expect a panic with a damaged 'struct buf', but not vm_page. > R> > > R> > Can you please do a clean build pre-r274914, and then again a clean > R> > build of r274914, and then confirm that the former is stable, but the > R> > latter panics? > R> > R> Yes, I just proceeded re-check both builds with removing obj dir each time and I still see the problem starting with r274914. > R> > R> Also restoring files like that on latest head makes things happy (no panics): > R> svnlite up -r274913 sys/kern/vfs_default.c sys/kern/vnode_if.src sys/sys/buf.h sys/sys/vnode.h sys/ufs/ffs/ffs_vnops.c sys/vm/swap_pager.c sys/vm/vm_pager.h sys/vm/vnode_pager.c sys/vm/vnode_pager.h > > Can you please try to un-union the struct buf and see if it helps? > Hi, Un-unioning helps partially: I receive much less panics and able to boot until login prompt in ~ 1/3 attempts with patch attached. Ruslan --uAKRQypu60I7Lcqm Content-Type: text/x-diff; charset=utf-8 Content-Disposition: attachment; filename="buf.patch" Index: sys/sys/buf.h =================================================================== --- sys/sys/buf.h (revision 275031) +++ sys/sys/buf.h (working copy) @@ -107,6 +107,7 @@ off_t b_offset; /* Offset into file. */ TAILQ_ENTRY(buf) b_bobufs; /* (V) Buffer's associated vnode. */ uint32_t b_vflags; /* (V) BV_* flags */ + TAILQ_ENTRY(buf) b_freelist; /* (Q) Free list position inactive. */ unsigned short b_qindex; /* (Q) buffer queue index */ uint32_t b_flags; /* B_* flags. */ b_xflags_t b_xflags; /* extra flags */ @@ -123,16 +124,11 @@ struct ucred *b_rcred; /* Read credentials reference. */ struct ucred *b_wcred; /* Write credentials reference. */ void *b_saveaddr; /* Original b_addr for physio. */ - union { - TAILQ_ENTRY(buf) bu_freelist; /* (Q) */ - struct { - void (*pg_iodone)(void *, vm_page_t *, int, int); - int pg_reqpage; - } bu_pager; - } b_union; -#define b_freelist b_union.bu_freelist -#define b_pager b_union.bu_pager - union cluster_info { + struct pager_info { + void (*pg_iodone)(void *, vm_page_t *, int, int); + int pg_reqpage; + } b_pager; + struct cluster_info { TAILQ_HEAD(cluster_list_head, buf) cluster_head; TAILQ_ENTRY(buf) cluster_entry; } b_cluster; --uAKRQypu60I7Lcqm--