From owner-svn-src-all@freebsd.org Sat Sep 16 22:28:53 2017 Return-Path: Delivered-To: svn-src-all@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 12B30E0CD7A; Sat, 16 Sep 2017 22:28:53 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-it0-x232.google.com (mail-it0-x232.google.com [IPv6:2607:f8b0:4001:c0b::232]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CA7AD65EB6; Sat, 16 Sep 2017 22:28:52 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-it0-x232.google.com with SMTP id w204so5327560itc.4; Sat, 16 Sep 2017 15:28:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=XV+bYAc1qvFYFktEPDs9gWEPWIw8K9H9PmAWyQfnGjE=; b=c5LoG03P6jxUt2iXR5To6H+i9sPRwHO7SkK6ZhUWW89pExEGKdga8AOl5f9GIy/Sj7 h2UKy0EprfSEFWt48oB5DMBuyMIJcQtY/xQr445EhrQT0CkKrzCf2FPRd9bRGAncvxeE wl/oSuPp3XBCDyGqjyxtX0Ev14MUGlHwX9cONS20PIp8MiurWJXDRAcU8xWgCAS8eted kb7hM+5dJPudROfCK57fjOVk2YyNgjzYHFKwVG0D5PJEkqfk/3p3ZuwEKQHu6g2kwoNz Ofw3/2TjsZWpZA4A8QLrjivEQ1J3m33y60evWRgpwIirhUwmB2fiyA2CxTFkHNs7DwwB xboQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=XV+bYAc1qvFYFktEPDs9gWEPWIw8K9H9PmAWyQfnGjE=; b=PXIS72/7HYJ9hbn6ZMFMgCN/x3+sGIbgURpu983S6c6fcIARb/rnOoSX1ezUM7Ka+w SjocGwS1URR6opi13x+8hHfAWQQeNQ48A3NYU6dXBRDLjuvMBcX24L3LUFq+LfDv4BMn DtK9Z77zb5EngBgPds1YIop2GPbKy3WQLSq2rJ4qlFGd/lGFDnWbrx9ci4cabkxM48SB BQOPQOq044dturJISa+8AA03SAYFyJWagYbrTDWf+4Yh+g9/Me/fzreiKuC5zpkcMpA7 cGnEwwngz1P42e+UXYghB8JnCk7SDszd6/KSA9/10Y+It/8kG1VJBlC+WZzs40JroWso HYMQ== X-Gm-Message-State: AHPjjUg0DqyEvoHMD8x/j2cpVq6076Z3XpCnW9Xug91C8OQtxg32njAg oc329mm1iVv6rDZ9GV4jJjfLaw== X-Google-Smtp-Source: AOwi7QAaoJYheX1+9t0BIsrB/3modXrwgRhVtcKzNvE44TJ3mxA8Rv2mpaifEn6fxE4UbSiKenBZpg== X-Received: by 10.36.202.197 with SMTP id k188mr10459397itg.94.1505600931876; Sat, 16 Sep 2017 15:28:51 -0700 (PDT) Received: from bish (toroon0560w-lp140-01-69-159-37-127.dsl.bell.ca. [69.159.37.127]) by smtp.gmail.com with ESMTPSA id v65sm1205057itf.38.2017.09.16.15.28.50 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sat, 16 Sep 2017 15:28:50 -0700 (PDT) Sender: Mark Johnston Date: Sat, 16 Sep 2017 18:28:46 -0400 From: Mark Johnston To: Andreas Tobler Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r323290 - head/sys/vm Message-ID: <20170916222846.GA88851@bish> References: <201709072143.v87Lhdsg060310@repo.freebsd.org> <20170914203232.GA72190@bish> <67bb96f2-da01-8bce-65ba-bf811f51e56d@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <67bb96f2-da01-8bce-65ba-bf811f51e56d@FreeBSD.org> User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.23 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: Sat, 16 Sep 2017 22:28:53 -0000 On Sat, Sep 16, 2017 at 09:01:56PM +0200, Andreas Tobler wrote: > On 14.09.17 22:32, Mark Johnston wrote: > > On Thu, Sep 14, 2017 at 09:51:17PM +0200, Andreas Tobler wrote: > >> Hi Mark, > >> > >> On 07.09.17 23:43, Mark Johnston wrote: > >>> Author: markj > >>> Date: Thu Sep 7 21:43:39 2017 > >>> New Revision: 323290 > >>> URL: https://svnweb.freebsd.org/changeset/base/323290 > >>> > >>> Log: > >>> Speed up vm_page_array initialization. > >>> > >>> We currently initialize the vm_page array in three passes: one to zero > >>> the array, one to initialize the "order" field of each page (necessary > >>> when inserting them into the vm_phys buddy allocator one-by-one), and > >>> one to initialize the remaining non-zero fields and individually insert > >>> each page into the allocator. > >>> > >>> Merge the three passes into one following a suggestion from alc: > >>> initialize vm_page fields in a single pass, and use vm_phys_free_contig() > >>> to efficiently insert physical memory segments into the buddy allocator. > >>> This reduces the initialization time to a third or a quarter of what it > >>> was before on most systems that I tested. > >>> > >>> Reviewed by: alc, kib > >>> MFC after: 3 weeks > >>> Differential Revision: https://reviews.freebsd.org/D12248 > >>> > >>> Modified: > >>> head/sys/vm/vm_page.c > >>> head/sys/vm/vm_phys.c > >>> head/sys/vm/vm_phys.h > >> > >> I just found out that this commit breaks booting my powerpc64 Quad G5. > >> It hangs, pressing ctrl-t shows: cmd: sh [*vm active pagequeue]. > >> > >> Sometimes it hangs earlier when the kbd is not there yet (usb), then I > >> can't get the process/task where it hangs. > >> > >> Note, this kernel is compiled with the default gcc (4.2.1-FreeBSD) > >> > >> Any ideas how to find out what's wrong? > > > > Are you able to break into DDB when the hang occurs? If so, the output > > of "show page" would be helpful. > > Unfortunately not from the beginning. The keyboard is usb and it gets > installed late. Once it survives the loading of the kbd and co, I can > enter into ddb. But it is a trial and error. So far I didn't succeed to > come that far. > > > Are you running with INVARIANTS configured? If not, please try that. > > The above was w/o INVARIANTS. With invariants the kernel panics > immediately after boot, see pic. Thanks. Could you please try applying the patch at the end of this email and see if that fixes the issue? I have not yet tried to compile it, sorry. > > >> The previous revision, r323289 seems stable, at least it survived > >> several kernel builds. > > > > Could you apply the patch below and capture the first page or so of > > output from after the kernel starts booting? > > I applied this diff and you see its output on the pic: > > https://people.freebsd.org/~andreast/r323290_generic64_with_dbg_patch.jpg > > I try now to get that far that I have a kbd and capture a 'show page'. I don't think that's necessary anymore given the information provided in the picture. diff --git a/sys/powerpc/aim/mmu_oea.c b/sys/powerpc/aim/mmu_oea.c index 04066418fcc1..b576474fcd1d 100644 --- a/sys/powerpc/aim/mmu_oea.c +++ b/sys/powerpc/aim/mmu_oea.c @@ -287,6 +287,7 @@ boolean_t moea_is_referenced(mmu_t, vm_page_t); int moea_ts_referenced(mmu_t, vm_page_t); vm_offset_t moea_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); boolean_t moea_page_exists_quick(mmu_t, pmap_t, vm_page_t); +void moea_page_init(mmu_t, vm_page_t); int moea_page_wired_mappings(mmu_t, vm_page_t); void moea_pinit(mmu_t, pmap_t); void moea_pinit0(mmu_t, pmap_t); @@ -334,6 +335,7 @@ static mmu_method_t moea_methods[] = { MMUMETHOD(mmu_ts_referenced, moea_ts_referenced), MMUMETHOD(mmu_map, moea_map), MMUMETHOD(mmu_page_exists_quick,moea_page_exists_quick), + MMUMETHOD(mmu_page_init, moea_page_init), MMUMETHOD(mmu_page_wired_mappings,moea_page_wired_mappings), MMUMETHOD(mmu_pinit, moea_pinit), MMUMETHOD(mmu_pinit0, moea_pinit0), @@ -1594,6 +1596,15 @@ moea_page_exists_quick(mmu_t mmu, pmap_t pmap, vm_page_t m) return (rv); } +void +moea_page_init(mmu_t mmu __unused, vm_page_t m) +{ + + m->md.mdpg_attrs = 0; + m->md.mdpg_cache_attrs = VM_MEMATTR_DEFAULT; + LIST_INIT(&m->md.mdpg_pvoh); +} + /* * Return the number of managed mappings to the given physical page * that are wired. diff --git a/sys/powerpc/aim/mmu_oea64.c b/sys/powerpc/aim/mmu_oea64.c index c0461ff57453..28c9c79916f1 100644 --- a/sys/powerpc/aim/mmu_oea64.c +++ b/sys/powerpc/aim/mmu_oea64.c @@ -251,6 +251,7 @@ boolean_t moea64_is_referenced(mmu_t, vm_page_t); int moea64_ts_referenced(mmu_t, vm_page_t); vm_offset_t moea64_map(mmu_t, vm_offset_t *, vm_paddr_t, vm_paddr_t, int); boolean_t moea64_page_exists_quick(mmu_t, pmap_t, vm_page_t); +void moea64_page_init(mmu_t, vm_page_t); int moea64_page_wired_mappings(mmu_t, vm_page_t); void moea64_pinit(mmu_t, pmap_t); void moea64_pinit0(mmu_t, pmap_t); @@ -298,6 +299,7 @@ static mmu_method_t moea64_methods[] = { MMUMETHOD(mmu_ts_referenced, moea64_ts_referenced), MMUMETHOD(mmu_map, moea64_map), MMUMETHOD(mmu_page_exists_quick,moea64_page_exists_quick), + MMUMETHOD(mmu_page_init, moea64_page_init), MMUMETHOD(mmu_page_wired_mappings,moea64_page_wired_mappings), MMUMETHOD(mmu_pinit, moea64_pinit), MMUMETHOD(mmu_pinit0, moea64_pinit0), @@ -1898,6 +1900,15 @@ moea64_page_exists_quick(mmu_t mmu, pmap_t pmap, vm_page_t m) return (rv); } +void +moea64_page_init(mmu_t mmu __unused, vm_page_t m) +{ + + m->md.mdpg_attrs = 0; + m->md.mdpg_cache_attrs = VM_MEMATTR_DEFAULT; + LIST_INIT(&m->md.mdpg_pvoh); +} + /* * Return the number of managed mappings to the given physical page * that are wired.