From owner-freebsd-current@FreeBSD.ORG Tue Nov 27 15:06:37 2012 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3C6335C7; Tue, 27 Nov 2012 15:06:37 +0000 (UTC) (envelope-from kostikbel@gmail.com) Received: from kib.kiev.ua (kib.kiev.ua [IPv6:2001:470:d5e7:1::1]) by mx1.freebsd.org (Postfix) with ESMTP id 84C7E8FC08; Tue, 27 Nov 2012 15:06:36 +0000 (UTC) Received: from tom.home (localhost [127.0.0.1]) by kib.kiev.ua (8.14.5/8.14.5) with ESMTP id qARF6PTB077134; Tue, 27 Nov 2012 17:06:25 +0200 (EET) (envelope-from kostikbel@gmail.com) DKIM-Filter: OpenDKIM Filter v2.7.1 kib.kiev.ua qARF6PTB077134 Received: (from kostik@localhost) by tom.home (8.14.5/8.14.5/Submit) id qARF6P73077133; Tue, 27 Nov 2012 17:06:25 +0200 (EET) (envelope-from kostikbel@gmail.com) X-Authentication-Warning: tom.home: kostik set sender to kostikbel@gmail.com using -f Date: Tue, 27 Nov 2012 17:06:25 +0200 From: Konstantin Belousov To: Andre Oppermann Subject: Re: panic: vm_object_madvise: page 0xfffffe0413c58630 is fictitious Message-ID: <20121127150625.GJ3013@kib.kiev.ua> References: <50B4A374.5040705@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="gBYU9MM4gf8jKg2V" Content-Disposition: inline In-Reply-To: <50B4A374.5040705@freebsd.org> User-Agent: Mutt/1.5.21 (2010-09-15) X-Spam-Status: No, score=0.2 required=5.0 tests=ALL_TRUSTED, DKIM_ADSP_CUSTOM_MED,FREEMAIL_FROM,NML_ADSP_CUSTOM_MED autolearn=no version=3.3.2 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on tom.home Cc: alc@freebsd.org, freebsd-current@freebsd.org X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 27 Nov 2012 15:06:37 -0000 --gBYU9MM4gf8jKg2V Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Nov 27, 2012 at 12:26:44PM +0100, Andre Oppermann wrote: > FreeBSD bbb.ccc 10.0-CURRENT FreeBSD 10.0-CURRENT #0: > Fri Nov 23 17:00:40 CET 2012 > aaa@bbb.ccc:/usr/obj/usr/src/head/sys/GENERIC amd64 >=20 > #0 doadump (textdump=3D-2014022336) at pcpu.h:229 > #1 0xffffffff8033e2d2 in db_fncall (dummy1=3D,=20 > dummy2=3D, > dummy3=3D, dummy4=3D) > at /usr/src/head/sys/ddb/db_command.c:578 > #2 0xffffffff8033e074 in db_command (last_cmdp=3D, > cmd_table=3D, dopager=3D1) at=20 > /usr/src/head/sys/ddb/db_command.c:449 > #3 0xffffffff8033dd62 in db_command_loop () at=20 > /usr/src/head/sys/ddb/db_command.c:502 > #4 0xffffffff80340690 in db_trap (type=3D, code=3D0) > at /usr/src/head/sys/ddb/db_main.c:231 > #5 0xffffffff808b375e in kdb_trap (type=3D3, code=3D0, tf=3D out>) > at /usr/src/head/sys/kern/subr_kdb.c:654 > #6 0xffffffff80bfc71a in trap (frame=3D0xffffff8487f478a0) > at /usr/src/head/sys/amd64/amd64/trap.c:579 > #7 0xffffffff80be65b2 in calltrap () at /tmp/exception-3nQ6Cf.s:179 > #8 0xffffffff808b2f5e in kdb_enter (why=3D0xffffffff80e5e23b "panic",=20 > msg=3D) > at cpufunc.h:63 > #9 0xffffffff8088086f in panic (fmt=3D) > at /usr/src/head/sys/kern/kern_shutdown.c:628 > #10 0xffffffff80adea4a in vm_object_madvise (object=3D, > pindex=3D, end=3D8952, advise=3D) > at /usr/src/head/sys/vm/vm_object.c:1101 > #11 0xffffffff80ad759a in vm_map_madvise (map=3D0xfffffe0018260188,=20 > start=3D, > end=3D, behav=3D5) at=20 > /usr/src/head/sys/vm/vm_map.c:2140 > #12 0xffffffff80adbd8d in sys_madvise (td=3D,=20 > uap=3D) > at /usr/src/head/sys/vm/vm_mmap.c:752 > #13 0xffffffff80bfd3a5 in amd64_syscall (td=3D0xfffffe0018230000,=20 > traced=3D0) at subr_syscall.c:135 > #14 0xffffffff80be689b in Xfast_syscall () at /tmp/exception-3nQ6Cf.s:329 > #15 0x00000000016f3bfa in ?? () I think this is an omission in the check for the object types. BTW, this pattern already repeats in several places, I thought about adding either new pager method, like boolean_t vm_pager_is_pageable(), or just a flag fields to the struct vm_pager to classify the vm objects. I am curious, what was the process which caused the panic ? diff --git a/sys/vm/vm_object.c b/sys/vm/vm_object.c index e19750c..5b8ed23 100644 --- a/sys/vm/vm_object.c +++ b/sys/vm/vm_object.c @@ -1060,7 +1060,10 @@ shadowlookup: (tobject->flags & OBJ_ONEMAPPING) =3D=3D 0) { goto unlock_tobject; } - } else if (tobject->type =3D=3D OBJT_PHYS) + } else if (tobject->type =3D=3D OBJT_PHYS || + tobject->type =3D=3D OBJT_SG || + tobject->type =3D=3D OBJT_MGTDEVICE || + tobject->type =3D=3D OBJT_DEVICE) goto unlock_tobject; m =3D vm_page_lookup(tobject, tpindex); if (m =3D=3D NULL && advise =3D=3D MADV_WILLNEED) { --gBYU9MM4gf8jKg2V Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.19 (FreeBSD) iEYEARECAAYFAlC01vEACgkQC3+MBN1Mb4j9cgCeO9vu/sGtdDSGBCzqytogsdEw WvwAn3FkmqtYO5m94Ged1eOhqRJqSR59 =fXn/ -----END PGP SIGNATURE----- --gBYU9MM4gf8jKg2V--