NetBSD Problem Report #54718

From gson@gson.org  Mon Nov 25 10:51:13 2019
Return-Path: <gson@gson.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.NetBSD.org", Issuer "mail.NetBSD.org CA" (not verified))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 891E77A17A
	for <gnats-bugs@gnats.NetBSD.org>; Mon, 25 Nov 2019 10:51:13 +0000 (UTC)
Message-Id: <20191125104845.64969253F37@guava.gson.org>
Date: Mon, 25 Nov 2019 12:48:45 +0200 (EET)
From: gson@gson.org (Andreas Gustafsson)
Reply-To: gson@gson.org (Andreas Gustafsson)
To: gnats-bugs@NetBSD.org
Subject: sparc install hangs since recent scheduler changes
X-Send-Pr-Version: 3.95

>Number:         54718
>Category:       port-sparc
>Synopsis:       sparc install hangs since recent scheduler changes
>Confidential:   no
>Severity:       critical
>Priority:       high
>Responsible:    ad
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Mon Nov 25 10:55:00 +0000 2019
>Closed-Date:    Mon Dec 02 20:09:36 +0000 2019
>Last-Modified:  Mon Dec 02 20:09:36 +0000 2019
>Originator:     Andreas Gustafsson
>Release:        NetBSD-current, source date >= 2019.11.23.22.35.08
>Organization:

>Environment:
System: NetBSD
Architecture: sparc
Machine: sparc
>Description:

Installing NetBSD-current/sparc under qemu, everything goes fine until
sysinst asks:

  On which disk do you want to install NetBSD?

and you type "a <enter>" to choose the first available disk.  Then,
instead of sysinst continuing to the next screen, nothing happens.

The problem appeared with these commits:

  2019.11.23.22.35.08 ad src/sys/kern/kern_runq.c 1.49
  2019.11.23.22.35.08 ad src/sys/kern/sched_4bsd.c 1.37

Logs at:

  http://releng.netbsd.org/b5reports/sparc/commits-2019.11.html#2019.11.23.22.35.08

Found using bracket and anita, verified by running qemu manually, not
tested on real hardware.

>How-To-Repeat:

>Fix:

>Release-Note:

>Audit-Trail:
From: Andreas Gustafsson <gson@gson.org>
To: gnats-bugs@netbsd.org
Cc: 
Subject: Re: port-sparc/54718: sparc install hangs since recent scheduler changes
Date: Mon, 25 Nov 2019 13:39:35 +0200

 To reproduce manually using a daily snapshort, run

   ftp http://nycdn.netbsd.org/pub/NetBSD-daily/HEAD/latest/images/NetBSD-9.99.18-sparc.iso
   dd if=/dev/zero of=sd bs=1m count=1024
   qemu-system-sparc -drive file=sd,format=raw,media=disk,snapshot=off -nographic -drive file=NetBSD-9.99.18-sparc.iso,format=raw,media=cdrom,readonly=on -boot d

 Then follow the prompts until you hit the bug.
 -- 
 Andreas Gustafsson, gson@gson.org

Responsible-Changed-From-To: port-sparc-maintainer->ad
Responsible-Changed-By: ad@NetBSD.org
Responsible-Changed-When: Mon, 25 Nov 2019 12:50:09 +0000
Responsible-Changed-Why:
I'm guessing this has something to do with slow softints.
I'll take a look this evening.


From: "Andrew Doran" <ad@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54718 CVS commit: src/sys/arch
Date: Fri, 29 Nov 2019 18:27:33 +0000

 Module Name:	src
 Committed By:	ad
 Date:		Fri Nov 29 18:27:33 UTC 2019

 Modified Files:
 	src/sys/arch/hppa/hppa: trap.c
 	src/sys/arch/sh3/include: userret.h
 	src/sys/arch/sh3/sh3: exception.c
 	src/sys/arch/sparc/include: userret.h
 	src/sys/arch/usermode/usermode: trap.c

 Log Message:
 PR port-sparc/54718 (sparc install hangs since recent scheduler changes)

 - userret() must be called every time we return to user, it's not optional.
 - If clearing the AST with interrupts off, you must loop over userret().


 To generate a diff of this commit:
 cvs rdiff -u -r1.112 -r1.113 src/sys/arch/hppa/hppa/trap.c
 cvs rdiff -u -r1.14 -r1.15 src/sys/arch/sh3/include/userret.h
 cvs rdiff -u -r1.68 -r1.69 src/sys/arch/sh3/sh3/exception.c
 cvs rdiff -u -r1.10 -r1.11 src/sys/arch/sparc/include/userret.h
 cvs rdiff -u -r1.71 -r1.72 src/sys/arch/usermode/usermode/trap.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Andrew Doran" <ad@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/54718 CVS commit: src/sys/kern
Date: Sun, 1 Dec 2019 13:20:42 +0000

 Module Name:	src
 Committed By:	ad
 Date:		Sun Dec  1 13:20:42 UTC 2019

 Modified Files:
 	src/sys/kern: kern_runq.c sched_4bsd.c sched_m2.c

 Log Message:
 PR port-sparc/54718 (sparc install hangs since recent scheduler changes)

 - sched_tick: cpu_need_resched is no longer the correct thing to do here.
   All we need to do is OR the request into the local ci_want_resched.

 - sched_resched_cpu: we need to set RESCHED_UPREEMPT even on softint LWPs,
   especially in the !__HAVE_FAST_SOFTINTS case, because the LWP with the
   LP_INTR flag could be running via softint_overlay() - i.e. it has been
   temporarily borrowed from a user process, and it needs to notice the
   resched after it has stopped running softints.


 To generate a diff of this commit:
 cvs rdiff -u -r1.50 -r1.51 src/sys/kern/kern_runq.c
 cvs rdiff -u -r1.38 -r1.39 src/sys/kern/sched_4bsd.c
 cvs rdiff -u -r1.34 -r1.35 src/sys/kern/sched_m2.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: open->closed
State-Changed-By: gson@NetBSD.org
State-Changed-When: Mon, 02 Dec 2019 20:09:36 +0000
State-Changed-Why:
Fixed by ad, thanks!


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.45 2018/12/21 14:23:33 maya Exp $
$NetBSD: gnats_config.sh,v 1.9 2014/08/02 14:16:04 spz Exp $
Copyright © 1994-2017 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.