Date: Tue, 10 Jun 2014 11:22:09 -0500 From: Alan Cox <alc@rice.edu> To: Warner Losh <imp@bsdimp.com>, alc@freebsd.org, "freebsd-arm@freebsd.org" <freebsd-arm@freebsd.org> Subject: Re: svn commit: r266850 - in head/sys/arm/xscale: i80321 i8134x ixp425 pxa Message-ID: <539730B1.2040900@rice.edu> In-Reply-To: <20140609221742.GV31367@funkthat.com> References: <53949D96.3060409@rice.edu> <20140608235611.GP31367@funkthat.com> <53950BB9.3090808@rice.edu> <20140609042206.GQ31367@funkthat.com> <5395D312.5000302@rice.edu> <20140609163302.GS31367@funkthat.com> <5395E725.7020807@rice.edu> <20140609174431.GT31367@funkthat.com> <9100CDFA-0C40-4BC8-AA9C-1DE37EEA6208@rice.edu> <6DA17B5C-1824-49BF-8192-432135D42C6E@bsdimp.com> <20140609221742.GV31367@funkthat.com>
next in thread | previous in thread | raw e-mail | index | archive | help
This is a multi-part message in MIME format. --------------000600030207070805040206 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit On 06/09/2014 17:17, John-Mark Gurney wrote: > Warner Losh wrote this message on Mon, Jun 09, 2014 at 14:08 -0600: >> On Jun 9, 2014, at 1:23 PM, Alan Cox <alc@rice.edu> wrote: >> >>> On Jun 9, 2014, at 12:44 PM, John-Mark Gurney wrote: >>> >>>> Alan Cox wrote this message on Mon, Jun 09, 2014 at 11:56 -0500: >>>>> I made a mistake with the new KASSERT()s in vm_reserv_break(). Try this. >>>> No worried, the new patch panics: >>>> panic: vm_reserv_break: 2 saved_object=0xc06e6378 x=253 m_tmp->object=0xc06e6378 (1) >>>> >>> >>> Is your arm processor running in big-endian or little-endian mode? >> Big Endian. > Specificly, TARGET_ARCH=armeb... So, ARMv4 in big-endian mode... > Please try the attached patch. --------------000600030207070805040206 Content-Type: text/plain; charset=ISO-8859-15; name="arm_debug9.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="arm_debug9.patch" Index: vm/vm_phys.c =================================================================== --- vm/vm_phys.c (revision 267282) +++ vm/vm_phys.c (working copy) @@ -693,9 +693,16 @@ vm_phys_free_pages(vm_page_t m, int order) void vm_phys_free_contig(vm_page_t m, u_long npages) { + vm_page_t m_tmp; u_int n; int order; + for (m_tmp = m; m_tmp < &m[npages]; m_tmp++) + KASSERT(m_tmp->object == NULL || + (m_tmp->flags & PG_CACHED) != 0, + ("vm_phys_free_contig: start %p %td %lu", + m, m_tmp - m, npages)); + /* * Avoid unnecessary coalescing by freeing the pages in the largest * possible power-of-two-sized subsets. @@ -714,6 +721,11 @@ vm_phys_free_contig(vm_page_t m, u_long npages) n = 1 << order; if (npages < n) break; + for (m_tmp = m; m_tmp < &m[n]; m_tmp++) + KASSERT(m_tmp->object == NULL || + (m_tmp->flags & PG_CACHED) != 0, + ("vm_phys_free_contig: xxx %p %td %u", + m, m_tmp - m, n)); vm_phys_free_pages(m, order); m += n; } @@ -721,6 +733,11 @@ vm_phys_free_contig(vm_page_t m, u_long npages) for (; npages > 0; npages -= n) { order = flsl(npages) - 1; n = 1 << order; + for (m_tmp = m; m_tmp < &m[n]; m_tmp++) + KASSERT(m_tmp->object == NULL || + (m_tmp->flags & PG_CACHED) != 0, + ("vm_phys_free_contig: yyy %p %td %u", + m, m_tmp - m, n)); vm_phys_free_pages(m, order); m += n; } Index: vm/vm_reserv.c =================================================================== --- vm/vm_reserv.c (revision 267282) +++ vm/vm_reserv.c (working copy) @@ -108,6 +108,18 @@ typedef u_long popmap_t; #define NPOPMAP howmany(VM_LEVEL_0_NPAGES, NBPOPMAP) /* + * XXX + */ +#undef setbit +#define setbit(a,i) ((a)[(i) / NBPOPMAP] |= 1UL << ((i) % NBPOPMAP)) +#undef clrbit +#define clrbit(a,i) ((a)[(i) / NBPOPMAP] &= ~(1UL << ((i) % NBPOPMAP))) +#undef isset +#define isset(a,i) ((a)[(i) / NBPOPMAP] & (1UL << ((i) % NBPOPMAP))) +#undef isclr +#define isclr(a,i) (((a)[(i) / NBPOPMAP] & (1UL << ((i) % NBPOPMAP))) == 0) + +/* * The reservation structure * * A reservation structure is constructed whenever a large physical page is @@ -646,7 +658,8 @@ found: static void vm_reserv_break(vm_reserv_t rv, vm_page_t m) { - int begin_zeroes, hi, i, lo; + int begin_zeroes, hi, i, lo, x; + vm_object_t saved_object; mtx_assert(&vm_page_queue_free_mtx, MA_OWNED); KASSERT(rv->object != NULL, @@ -653,6 +666,7 @@ vm_reserv_break(vm_reserv_t rv, vm_page_t m) ("vm_reserv_break: reserv %p is free", rv)); KASSERT(!rv->inpartpopq, ("vm_reserv_break: reserv %p's inpartpopq is TRUE", rv)); + saved_object = rv->object; LIST_REMOVE(rv, objq); rv->object = NULL; if (m != NULL) { @@ -703,6 +717,19 @@ vm_reserv_break(vm_reserv_t rv, vm_page_t m) if (i != NPOPMAP) /* Convert from ffsl() to ordinary bit numbering. */ hi--; + for (x = begin_zeroes; x < NBPOPMAP * i + hi; x++) { + vm_page_t m_tmp = &rv->pages[x]; + KASSERT(isclr(rv->popmap, x), + ("vm_reserv_break: 1 saved_object=%p x=%d m_tmp->object=%p (%d)", + saved_object, x, m_tmp->object, m_tmp->object == kmem_object)); + } + for (x = begin_zeroes; x < NBPOPMAP * i + hi; x++) { + vm_page_t m_tmp = &rv->pages[x]; + KASSERT(m_tmp->object == NULL || + (m_tmp->flags & PG_CACHED) != 0, + ("vm_reserv_break: 2 saved_object=%p x=%d m_tmp->object=%p (%d)", + saved_object, x, m_tmp->object, m_tmp->object == kmem_object)); + } vm_phys_free_contig(&rv->pages[begin_zeroes], NBPOPMAP * i + hi - begin_zeroes); } while (i < NPOPMAP); --------------000600030207070805040206--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?539730B1.2040900>