Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 16 Oct 2013 15:30:12 +0100 (BST)
From:      Anton Shterenlikht <mexas@bris.ac.uk>
To:        kostikbel@gmail.com, mexas@bris.ac.uk
Cc:        freebsd-current@freebsd.org, freebsd-ia64@freebsd.org
Subject:   Re: panic: wrong page state m 0xe00000027a9adb40 + savecore deadlock
Message-ID:  <201310161430.r9GEUCYo025961@mech-cluster241.men.bris.ac.uk>
In-Reply-To: <20131016120142.GS3865@kib.kiev.ua>

next in thread | previous in thread | raw e-mail | index | archive | help
>From kostikbel@gmail.com Wed Oct 16 13:02:51 2013
>
>On Wed, Oct 16, 2013 at 02:55:26PM +0300, Konstantin Belousov wrote:
>> On Wed, Oct 16, 2013 at 09:02:19AM +0100, Anton Shterenlikht wrote:
>> > panic:
>> >  http://www.freebsd.org/cgi/query-pr.cgi?pr=3Dkern/182999
>>=20
>> db> show pginfo 0xe00000027d352600
>> page 0xe00000027d352600 obj 0xe0000000128fda00 pidx 0x0 phys 0x275dc6000 =
>q 255 hold 0 wire 1
>> af 0x0 of 0x0 f 0x0 act 0 busy 1 valid 0xff dirty 0x0
>>=20
>> AFAIR ia64 uses 8K pages.
>>=20
>> Please do the following:
>> 1. apply the patch at the end of this message, reproduce the problem
>> and show me both exact panic message from the patched kernel and 'show
>> pginfo addr' again.
>> 2. show me the ls -la <file> output for the file which was accessed
>> through nginx, also what is the filesystem where the file resides on ?
>Sure, I forgot the patch.
>
>diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
>index 322550b..9d46dc7 100644
>--- a/sys/kern/uipc_syscalls.c
>+++ b/sys/kern/uipc_syscalls.c
>@@ -2070,7 +2070,7 @@ free_page:
> 	}
> 	KASSERT(error !=3D 0 || (m->wire_count > 0 &&
> 	    vm_page_is_valid(m, off & PAGE_MASK, xfsize)),
>-	    ("wrong page state m %p", m));
>+	    ("wrong page state m %p off %#jx xfsize %d", m, off, xfsize));
> 	VM_OBJECT_WUNLOCK(obj);
> 	return (error);
> }

The patch didn't apply cleanly.
I concluded that my src was older
that yours, so I updated to r 256624.

Now I don't get this panic!
I don't know whether to be happy or not.

Anyway, I was on r255488 when the panic
happened, and there have been a lot of
changes under sys/kern. Specifically related
to the patch:

# svn info
Path: .
Working Copy Root Path: /usr/src
URL: https://svn0.eu.freebsd.org/base/head/sys/kern
Relative URL: ^/head/sys/kern
Repository Root: https://svn0.eu.freebsd.org/base
Repository UUID: ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
Revision: 256624
Node Kind: directory
Schedule: normal
Last Changed Author: mav
Last Changed Rev: 256614
Last Changed Date: 2013-10-16 10:56:40 +0100 (Wed, 16 Oct 2013)

# svn diff -r 255488 uipc_syscalls.c 
Index: uipc_syscalls.c
===================================================================
--- uipc_syscalls.c     (revision 255488)
+++ uipc_syscalls.c     (working copy)
@@ -123,21 +123,13 @@
 /*
  * sendfile(2)-related variables and associated sysctls
  */
-int nsfbufs;
-int nsfbufspeak;
-int nsfbufsused;
+static SYSCTL_NODE(_kern_ipc, OID_AUTO, sendfile, CTLFLAG_RW, 0,
+    "sendfile(2) tunables");
 static int sfreadahead = 1;
+SYSCTL_INT(_kern_ipc_sendfile, OID_AUTO, readahead, CTLFLAG_RW,
+    &sfreadahead, 0, "Number of sendfile(2) read-ahead MAXBSIZE blocks");
 
-SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufs, CTLFLAG_RDTUN, &nsfbufs, 0,
-    "Maximum number of sendfile(2) sf_bufs available");
-SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufspeak, CTLFLAG_RD, &nsfbufspeak, 0,
-    "Number of sendfile(2) sf_bufs at peak usage");
-SYSCTL_INT(_kern_ipc, OID_AUTO, nsfbufsused, CTLFLAG_RD, &nsfbufsused, 0,
-    "Number of sendfile(2) sf_bufs in use");
-SYSCTL_INT(_kern_ipc, OID_AUTO, sfreadahead, CTLFLAG_RW, &sfreadahead, 0,
-    "Number of sendfile(2) read-ahead MAXBSIZE blocks");
 
-
 static void
 sfstat_init(const void *unused)
 {
@@ -2076,10 +2068,10 @@
                        vm_page_free(m);
                vm_page_unlock(m);
        }
+       KASSERT(error != 0 || (m->wire_count > 0 &&
+           vm_page_is_valid(m, off & PAGE_MASK, xfsize)),
+           ("wrong page state m %p off %#jx xfsize %d", m, off, xfsize));
        VM_OBJECT_WUNLOCK(obj);
-       KASSERT(error != 0 || (m->wire_count > 0 && m->valid ==
-           VM_PAGE_BITS_ALL),
-           ("wrong page state m %p", m));
        return (error);
 }
 
#  

Please let me know if there is any
other diagnostics you'd like to see.

Otherwise, till next panic...

Many thanks for your help

Anton




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