NetBSD Problem Report #1964

From gnats  Sun Jan 21 16:57:34 1996
Received: from struis.fwi.uva.nl by pain.lcs.mit.edu (8.6.12/8.6.9) with ESMTP id QAA15570 for <gnats-bugs@gnats.netbsd.org>; Sun, 21 Jan 1996 16:52:53 -0500
Message-Id: <199601212142.WAA20415@struis.fwi.uva.nl>
Date: Sun, 21 Jan 1996 22:42:09 +0100
From: frank@fwi.uva.nl
Reply-To: frank@fwi.uva.nl
To: gnats-bugs@gnats.netbsd.org
Subject: i386 kernel page faults when processes are swapped out
X-Send-Pr-Version: 3.2

>Number:         1964
>Category:       port-i386
>Synopsis:       i386 kernel page faults when processes are swapped out
>Confidential:   no
>Severity:       serious
>Priority:       high
>Responsible:    fvdl
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Jan 21 17:05:01 +0000 1996
>Closed-Date:    Fri Apr 04 00:08:58 +0000 2003
>Last-Modified:  Fri Apr 04 00:08:58 +0000 2003
>Originator:     Frank van der Linden
>Release:        1.1A
>Organization:
Organized? Me?
>Environment:
NetBSD natte 1.1A NetBSD 1.1A (NATTE) #2: Sun Jan 21 17:33:02 MET 1996     root@:/usr/src/sys/arch/i386/compile/NATTE i386

>Description:
	Recently, swapping was enabled for the i386 port. However, when the
	system actually starts swapping, things may go wrong. When a process
	exits, gdt_compact() will get called in kernel mode, curproc = 0.
	gdt_compact() references the user areas of all processes, so a
	kernel page fault trap will occur when one of these happens to be
	swapped out.
>How-To-Repeat:
	Start up some big processes, let them run for a bit and then
	terminate one. For example: start up a kernel compile with
	'-pipe' in the CFLAGS, and use 'make -j 8'. (This will not
	work properly because of the vnode_if.* dependency and possibly
	others, but that is another story), and stop it after some time.

	DDB output:
kernel page fault trap, code=0
Stopped at      _gdt_compact+0x30:      movl    0x68(%ecx),%edx
db> trace
_gdt_compact(f81f17b0,f8213000,f875b600,f9b6b000,f9b6d000) at _gdt_compact+0x30
_gdt_put_slot(1f,f8214f44,f8100aeb,f9b46000,ffffffff) at _gdt_put_slot+0x76
_tss_free(f9b46000,ffffffff,0,f81f54a0,0) at _tss_free+0x17
_switch_exit(0,0,f8213194,0,f8214f7c) at _switch_exit+0x57
bpendtsleep(f81f27b0,4,f8191672,0) at bpendtsleep
_scheduler(f8719b00,f81106b8,212fb0,212000,221000) at _scheduler+0x60
_main(0,0,0,0,0) at _main+0x4da
db> show registers
es                    0x10
ds              0xf8210010  _end+0x170a0
edi                   0x30
esi                    0x3
ebp             0xf8214ed8  _end+0x1bf68
ebx                    0x6
edx                    0x3
ecx             0xf9b3f000  _end+0x1946090
eax                   0x20
eip             0xf819c310  _gdt_compact+0x30
cs              0xf8190008  _lock_clear_recursive+0x5cc
eflags             0x10286
esp             0xf8214ec4  _end+0x1bf54
ss              0xffff0010  _APTmap+0x3f0010
_gdt_compact+0x30:          movl 0x68(%ecx),%edx


>Fix:
	gdt_compact referencing all user areas rather seems to defeat
	the use of having them swapped out, store the needed info in the
	proc struct? (just a first thought, I haven't given it much
	thought)
>Release-Note:
>Audit-Trail:

From: "Charles M. Hannum" <mycroft>
To: frank@fwi.uva.nl
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: port-i386/1964: i386 kernel page faults when processes are swapped out
Date: Tue, 30 Jan 1996 07:12:29 -0500

            gdt_compact referencing all user areas rather seems to defeat
            the use of having them swapped out, [...]

 Not really.  Compaction is only done when the GDT shrinks, which is not
 very often.

 All that's really needed is to wrap a PHOLD()/PRELE() pair around the
 internals of the compactor loop.


From: "Charles M. Hannum" <mycroft>
To: frank@fwi.uva.nl
Cc: gnats-bugs@gnats.netbsd.org
Subject: Re: port-i386/1964: i386 kernel page faults when processes are swapped out
Date: Tue, 30 Jan 1996 07:23:26 -0500

    All that's really needed is to wrap a PHOLD()/PRELE() pair around the
    internals of the compactor loop.

 Actually, this is incorrect.  PHOLD() will be fairly unhappy if it 
 needs to swap in a process with curproc == 0.  Hmm.

State-Changed-From-To: open->analyzed 
State-Changed-By: mycroft 
State-Changed-When: Thu Feb 8 23:24:02 EST 1996 
State-Changed-Why:  
gdt_compact() should cause the process to be paged in, put this won't 
currently work because it's run with curproc == 0.  Have to think about 
how to fix it. 
Responsible-Changed-From-To: gnats-admin->port-i386-maintainer 
Responsible-Changed-By: fair 
Responsible-Changed-When: Mon Dec 28 09:49:50 PST 1998 
Responsible-Changed-Why:  
This PR is the responsibility of the portmaster, 
not the GNATS database administrator. 
Responsible-Changed-From-To: port-i386-maintainer->fvdl 
Responsible-Changed-By: lukem 
Responsible-Changed-When: Mon Jun 25 14:24:08 PDT 2001 
Responsible-Changed-Why:  
Frank is the submitter and now the i386 port master. 
Give it to him to fix :-) 
State-Changed-From-To: analyzed->closed 
State-Changed-By: fvdl 
State-Changed-When: Thu Apr 3 16:07:40 PST 2003 
State-Changed-Why:  
gdt_compact() is no more, so this PR can be closed. 
>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2007 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.