From owner-svn-src-head@freebsd.org Thu Sep 14 20:32:41 2017 Return-Path: Delivered-To: svn-src-head@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 DDF1AE0A461; Thu, 14 Sep 2017 20:32:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: from mail-qt0-x242.google.com (mail-qt0-x242.google.com [IPv6:2607:f8b0:400d:c0d::242]) (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 847A6684D9; Thu, 14 Sep 2017 20:32:41 +0000 (UTC) (envelope-from markjdb@gmail.com) Received: by mail-qt0-x242.google.com with SMTP id l25so326346qtf.2; Thu, 14 Sep 2017 13:32:41 -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=gQTMp9EJEWG4BITNlQGbis0fBUxcxiUv1Uz/oy4/kHA=; b=o2iSXtZgp1c4H+aKf44ODiWf938AJd2aGZmj/jVIiRwEuC6x71EKsA4NFcqb/GfnCx ZXE+vgGhAjvwc8tbhyLL4+F5FJK1Al2xqNzABEzuQjka802Vh61sdW9hP1JRJcdE3Tdy 7D2gM/RqY8HUBmBzU3uK144Yk0ywyloKo76FaP1Dyhv0LQf2GvccO/pYgvv2gQCCySkC A5yRoWuwtfbVKh/7g8vCwAifgwMyO+9hLo4n8x3rdaObVgZ0zGHO3JfeQ27T/m0aS6Vh Ph/cZVeQAYXB/E2CRQE2JJgZtNkK73oNvHG1vvYhjwQlD86G5Y/sKw3PGXlSqtZet5az JZjg== 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=gQTMp9EJEWG4BITNlQGbis0fBUxcxiUv1Uz/oy4/kHA=; b=S9jktkv6zEMw0d1isfiVtv5drjZ93dnbMDA+6rgWH57DpATBaCSPzEQNEgZ6gQIv6t +YOKW8XIdc4UJI3VXMfyfDCtXigzys56NM2fCUtOXu9X4zmy47pZF8JFYBmO9Hj5KpTC B1lPi/NKs27v9BvE9WKs4kVy9TvDeCscgPma9hOQI6D1L/rzFopcx65xfQL6nWe+bkgV iTYUcpYIm9n2DraiCmuMTKG9iAIUHahcQ4Pv+WnPADbdBztJ7zu7/rS62f1hBNO4RKCi x9h5ZbhwssauuJlI12OUg3bOIbkgTM1Cw7XH3XOPFVqiMoNWnybkQqq6AZK73Su8dcec Pzbw== X-Gm-Message-State: AHPjjUie6Xh/aItOGZv7OkmAaeLQTw3YASbbTzUQQjylLPKKjxGgUIOE qeHRbiWBFYKfv7J2 X-Google-Smtp-Source: AOwi7QCQkHgwfLGwG+8wDPnpdVOhMbpWbuMX5F+XGgpnkQ5qh2H5Am//7tJiQSWIfrRHvmEc9hFLMQ== X-Received: by 10.237.52.69 with SMTP id w63mr17515037qtd.78.1505421160226; Thu, 14 Sep 2017 13:32:40 -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 j206sm11520819qke.7.2017.09.14.13.32.38 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 14 Sep 2017 13:32:38 -0700 (PDT) Sender: Mark Johnston Date: Thu, 14 Sep 2017 16:32:32 -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: <20170914203232.GA72190@bish> References: <201709072143.v87Lhdsg060310@repo.freebsd.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.8.3 (2017-05-23) X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 14 Sep 2017 20:32:42 -0000 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. Are you running with INVARIANTS configured? If not, please try that. > 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? diff --git a/sys/vm/vm_page.c b/sys/vm/vm_page.c index fda8d1cf37f7..6862195c3e9c 100644 --- a/sys/vm/vm_page.c +++ b/sys/vm/vm_page.c @@ -648,8 +648,11 @@ vm_page_startup(vm_offset_t vaddr) * Add physical memory segments corresponding to the available * physical pages. */ - for (i = 0; phys_avail[i + 1] != 0; i += 2) + for (i = 0; phys_avail[i + 1] != 0; i += 2) { + printf("adding phys_avail seg %#jx - %#jx\n", + phys_avail[i], phys_avail[i + 1]); vm_phys_add_seg(phys_avail[i], phys_avail[i + 1]); + } /* * Initialize the physical memory allocator. @@ -664,6 +667,8 @@ vm_page_startup(vm_offset_t vaddr) vm_cnt.v_free_count = 0; for (segind = 0; segind < vm_phys_nsegs; segind++) { seg = &vm_phys_segs[segind]; + printf("inserting seg %d: %#jx - %#jx\n", segind, + (uintmax_t)seg->start, (uintmax_t)seg->end); for (pa = seg->start; pa < seg->end; pa += PAGE_SIZE) vm_phys_init_page(pa); @@ -679,6 +684,7 @@ vm_page_startup(vm_offset_t vaddr) seg->end > phys_avail[i + 1]) continue; + printf("inserting seg %d into vm_phys\n", segind); m = seg->first_page; pagecount = (u_long)atop(seg->end - seg->start); @@ -694,6 +700,7 @@ vm_page_startup(vm_offset_t vaddr) break; } } + printf("v_free_count: %u\n", vm_cnt.v_free_count); /* * Remove blacklisted pages from the physical memory allocator.