From owner-freebsd-arm@FreeBSD.ORG Tue Jun 10 16:22:22 2014 Return-Path: Delivered-To: freebsd-arm@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 4AC1D5B4; Tue, 10 Jun 2014 16:22:22 +0000 (UTC) Received: from pp2.rice.edu (proofpoint2.mail.rice.edu [128.42.201.101]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id EE82527E2; Tue, 10 Jun 2014 16:22:21 +0000 (UTC) Received: from pps.filterd (pp2.rice.edu [127.0.0.1]) by pp2.rice.edu (8.14.5/8.14.5) with SMTP id s5AGGXxt028072; Tue, 10 Jun 2014 11:22:10 -0500 Received: from mh1.mail.rice.edu (mh1.mail.rice.edu [128.42.201.20]) by pp2.rice.edu with ESMTP id 1mdnrm8a96-1; Tue, 10 Jun 2014 11:22:10 -0500 X-Virus-Scanned: by amavis-2.7.0 at mh1.mail.rice.edu, auth channel Received: from 108-254-203-201.lightspeed.hstntx.sbcglobal.net (108-254-203-201.lightspeed.hstntx.sbcglobal.net [108.254.203.201]) (using TLSv1 with cipher RC4-MD5 (128/128 bits)) (No client certificate requested) (Authenticated sender: alc) by mh1.mail.rice.edu (Postfix) with ESMTPSA id 3B9D7460110; Tue, 10 Jun 2014 11:22:10 -0500 (CDT) Message-ID: <539730B1.2040900@rice.edu> Date: Tue, 10 Jun 2014 11:22:09 -0500 From: Alan Cox User-Agent: Mozilla/5.0 (X11; FreeBSD i386; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Warner Losh , alc@freebsd.org, "freebsd-arm@freebsd.org" Subject: Re: svn commit: r266850 - in head/sys/arm/xscale: i80321 i8134x ixp425 pxa 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> In-Reply-To: <20140609221742.GV31367@funkthat.com> X-Enigmail-Version: 1.6 Content-Type: multipart/mixed; boundary="------------000600030207070805040206" X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 spamscore=0 suspectscore=11 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=7.0.1-1402240000 definitions=main-1406100196 X-BeenThere: freebsd-arm@freebsd.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: "Porting FreeBSD to ARM processors." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Jun 2014 16:22:22 -0000 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 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--