NetBSD Problem Report #36952

From martin@duskware.de  Sun Sep  9 09:11:00 2007
Return-Path: <martin@duskware.de>
Received: from mail.netbsd.org (mail.netbsd.org [204.152.190.11])
	by narn.NetBSD.org (Postfix) with ESMTP id 440B163B8A2
	for <gnats-bugs@gnats.netbsd.org>; Sun,  9 Sep 2007 09:11:00 +0000 (UTC)
Message-Id: <20070908230039.5EB5A63B8E9@narn.NetBSD.org>
Date: Sat,  8 Sep 2007 23:00:39 +0000 (UTC)
From: jjhartley@gmail.com
Reply-To: jjhartley@gmail.com
To: netbsd-bugs-owner@NetBSD.org
Subject: swapctl(8) doesn't 
X-Send-Pr-Version: www-1.0

>Number:         36952
>Category:       port-i386
>Synopsis:       swapctl(8) doesn't
>Confidential:   no
>Severity:       non-critical
>Priority:       medium
>Responsible:    port-i386-maintainer
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun Sep 09 09:15:00 +0000 2007
>Closed-Date:    Mon May 27 02:28:27 +0000 2019
>Last-Modified:  Mon May 27 02:28:27 +0000 2019
>Originator:     James Hartley
>Release:        4.0_RC1
>Organization:
>Environment:
NetBSD lederman 4.0_RC1 NetBSD 4.0_RC1 (GENERIC) #0: Sat Sep  1 15:24:09 PDT 2007  builds@wb42:/home/builds/ab/netbsd-4-0-RC1/i386/200709011431Z-obj/home/builds/ab/netbsd-4-0-RC1/src/sys/arch/i386/compile/GENERIC i386

>Description:
I am unable to add swap space created on a USB drive.
>How-To-Repeat:
The disklabel for the USB drive is:

$ sudo disklabel sd1
Password:
# /dev/rsd1d:
type: SCSI
disk: 0A              
label: fictitious
flags:
bytes/sector: 512
sectors/track: 32
tracks/cylinder: 64
sectors/cylinder: 2048
cylinders: 76319
total sectors: 156301488
rpm: 3600
interleave: 1
trackskew: 0
cylinderskew: 0
headswitch: 0           # microseconds
track-to-track seek: 0  # microseconds
drivedata: 0 

16 partitions:
#        size    offset     fstype [fsize bsize cpg/sgs]
 b:   2048000         0       swap                     # (Cyl.      0 -    999)
 d: 156301488         0     unused      0     0        # (Cyl.      0 -  76319*)
 e:  20480000   2048000     4.2BSD      0     0     0  # (Cyl.   1000 -  10999)
 f:  20480000  22528000     4.2BSD      0     0     0  # (Cyl.  11000 -  20999)
 g:  20480000  43008000     4.2BSD      0     0     0  # (Cyl.  21000 -  30999)
 h:  20480000  63488000     4.2BSD      0     0     0  # (Cyl.  31000 -  40999)
 i:  20480000  83968000     4.2BSD      0     0     0  # (Cyl.  41000 -  50999)
 j:  20480000 104448000     4.2BSD      0     0     0  # (Cyl.  51000 -  60999)
 k:  31373488 124928000     4.2BSD      0     0     0  # (Cyl.  61000 -  76319*)
$ 

/etc/fstab was edited as follows:

$ cat /etc/fstab
# NetBSD /etc/fstab
# See /usr/share/examples/fstab/ for more examples.
/dev/sd0a               /       ffs     rw               1 1
/dev/sd0b               none    swap    sw               0 0
/dev/sd0e               /usr    ffs     rw,softdep       1 2
/dev/sd0f               /var    ffs     rw,softdep       1 2
/dev/sd0g               /home   ffs     rw,softdep       1 2
/dev/sd0b               /tmp    mfs     rw,-s=262300
/dev/sd1b               none    swap    sw               0 0
/dev/sd1e               /usr/src        ffs     rw,softdep      1 2
/dev/sd1f               /usr/xsrc       ffs     rw,softdep      1 2
/dev/sd1g               /usr/objdir     ffs     rw,softdep      1 2
/dev/sd1h               /usr/tooldir    ffs     rw,softdep      1 2
/dev/sd1i               /usr/releasedir ffs     rw,softdep      1 2
/dev/sd1j               /usr/destdir    ffs     rw,softdep      1 2
kernfs          /kern   kernfs  rw
procfs          /proc   procfs  rw,noauto
$ 

After attachment of the USB drive, attempt to increase system swap through swapctl(8):

$ sudo swapctl -A
Password:
swapctl: /dev/sd0b: Device busy
$ sudo swapctl -l
Device      512-blocks     Used    Avail Capacity  Priority
/dev/sd0b       262300   262288       12   100%    0
$ 

The dmesg(8) for the system is:

Copyright (c) 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, 2006
    The NetBSD Foundation, Inc.  All rights reserved.
Copyright (c) 1982, 1986, 1989, 1991, 1993
    The Regents of the University of California.  All rights reserved.

NetBSD 4.0_RC1 (GENERIC) #0: Sat Sep  1 15:24:09 PDT 2007
        builds@wb42:/home/builds/ab/netbsd-4-0-RC1/i386/200709011431Z-obj/home/builds/ab/netbsd-4-0-
RC1/src/sys/arch/i386/compile/GENERIC
total memory = 127 MB
rbus: rbus_min_start set to 0x20000000
avail memory = 115 MB
timecounter: Timecounters tick every 10.000 msec
timecounter: Timecounter "i8254" frequency 1193182 Hz quality 100
BIOS32 rev. 0 found at 0xfd7a0
mainbus0 (root)
cpu0 at mainbus0: (uniprocessor)
cpu0: Intel Pentium III (686-class), 598.65 MHz, id 0x673
cpu0: features 387f9ff<FPU,VME,DE,PSE,TSC,MSR,PAE,MCE,CX8,SEP,MTRR>
cpu0: features 387f9ff<PGE,MCA,CMOV,PAT,PSE36,PN,MMX>
cpu0: features 387f9ff<FXSR,SSE>
cpu0: I-cache 16 KB 32B/line 4-way, D-cache 16 KB 32B/line 4-way
cpu0: L2 cache 512 KB 32B/line 4-way
cpu0: ITLB 32 4 KB entries 4-way, 2 4 MB entries fully associative
cpu0: DTLB 64 4 KB entries 4-way, 8 4 MB entries 4-way
cpu0: serial number 0000-0673-0003-2FEB-4510-F79A
cpu0: 32 page colors
acpi0 at mainbus0: Advanced Configuration and Power Interface
acpi0: using Intel ACPI CA subsystem version 20060217
acpi0: X/RSDT: OemId <PTLTD ,  RSDT  ,00000000>, AslId <PTL ,01000000>
acpi0: SCI interrupting at int 9
acpi0: fixed-feature power button present
timecounter: Timecounter "ACPI-Safe" frequency 3579545 Hz quality 900
ACPI-Safe 24-bit timer
mpacpi: could not get bus number, assuming bus 0
LNKA: ACPI: Found matching pin for 0.13.INTA at func 0: 11
LNKB: ACPI: Found matching pin for 0.14.INTA at func 0: 10
LNKC: ACPI: Found matching pin for 0.15.INTA at func 0: 15
LNKC: BIOS IRQ 15 for 0.15.INTA is invalid
LNKD: ACPI: Found matching pin for 0.15.INTB at func 1: 9
LNKA: ACPI: Found matching pin for 0.15.INTC at func 2: 11
LNKD: ACPI: Found matching pin for 0.7.INTD at func 2: 9
ACPI Object Type 'Processor' (0x0c) at acpi0 not configured
PNP0A03 [PCI/PCI-X Host Bridge] at acpi0 not configured
PNP0C02 [Plug and Play motherboard register resources] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
PNP0C0F [PCI interrupt link device] at acpi0 not configured
ACPI Object Type 'Power' (0x0b) at acpi0 not configured
PNP0C0B [ACPI Fan] at acpi0 not configured
PNP0201 [EISA DMA Controller] at acpi0 not configured
PNP0B00 [AT Real-Time Clock] at acpi0 not configured
PNP0000 [AT Interrupt Controller] at acpi0 not configured
npx1 at acpi0 (PNP0C04)
npx1: io 0xf0-0xff irq 13
npx1: reported by CPUID; using exception 16
attimer1 at acpi0 (PNP0100): AT Timer
attimer1: io 0x40-0x43 irq 0
pcppi1 at acpi0 (PNP0800)
pcppi1: io 0x61
pcppi1: children must have an explicit unit
midi0 at pcppi1: PC speaker (CPU-intensive output)
sysbeep0 at pcppi1
PNP0A06 [Generic Container Device] at acpi0 not configured
PNP0700 [PC standard floppy disk controller] at acpi0 not configured
com3 at acpi0 (PNP0501-1)
com3: io 0x3f8-0x3ff irq 4
com3: ns16550a, working fifo
lpt3 at acpi0 (PNP0400-1)
lpt3: io 0x378-0x37b irq 7
pckbc1 at acpi0 (PNP0303): kbd port
pckbc1: io 0x60,0x64 irq 1
pckbc2 at acpi0 (PNP0F13): aux port
pckbc2: irq 12
pcppi1: attached to attimer1
pckbd0 at pckbc1 (kbd slot)
pckbc1: using irq 1 for kbd slot
wskbd0 at pckbd0: console keyboard
pms0 at pckbc1 (aux slot)
pckbc1: using irq 12 for aux slot
wsmouse0 at pms0 mux 0
pci0 at mainbus0 bus 0: configuration mode 1
pci0: i/o space, memory space enabled, rd/line, rd/mult, wr/inv ok
pchb0 at pci0 dev 0 function 0
pchb0: Intel 82443BX Host Bridge/Controller (rev. 0x03)
agp0 at pchb0: aperture at 0xf8000000, size 0x4000000
ppb0 at pci0 dev 1 function 0: Intel 82443BX AGP Interface (rev. 0x03)
pci1 at ppb0 bus 1
pci1: i/o space, memory space enabled
vga1 at pci1 dev 0 function 0: Matrox MGA G400 AGP (rev. 0x05)
wsdisplay0 at vga1 kbdmux 1: console (80x25, vt100 emulation), using wskbd0
wsmux1: connecting to wsdisplay0
piixpcib0 at pci0 dev 7 function 0
piixpcib0: Intel 82371AB (PIIX4) PCI-ISA Bridge (rev. 0x02)
piixpcib0: SpeedStep SMI enabled
piixide0 at pci0 dev 7 function 1
piixide0: Intel 82371AB IDE controller (PIIX4) (rev. 0x01)
piixide0: device disabled (at device)
uhci0 at pci0 dev 7 function 2: Intel 82371AB (PIIX4) USB Host Controller (rev. 0x01)
uhci0: interrupting at irq 9
usb0 at uhci0: USB revision 1.0
uhub0 at usb0
uhub0: Intel UHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub0: 2 ports with 2 removable, self powered
piixpm0 at pci0 dev 7 function 3: Power Management Controller
timecounter: Timecounter "piixpm0" frequency 3579545 Hz quality 900
piixpm0 24-bit timer
piixpm0: interrupting at SMI
iic0 at piixpm0: I2C bus
ahc1 at pci0 dev 13 function 0: Adaptec 2940 Ultra2 SCSI adapter
ahc1: interrupting at irq 11
ahc1: aic7890/91: Ultra2 Wide Channel A, SCSI Id=7, 32/253 SCBs
scsibus0 at ahc1: 16 targets, 8 luns per target
fxp0 at pci0 dev 14 function 0: i82559 Ethernet, rev 8
fxp0: interrupting at irq 10
fxp0: Ethernet address 00:90:27:a7:50:80
inphy0 at fxp0 phy 1: i82555 10/100 media interface, rev. 4
inphy0: 10baseT, 10baseT-FDX, 100baseTX, 100baseTX-FDX, auto
ohci0 at pci0 dev 15 function 0: NEC USB Host Controller (rev. 0x43)
LNKC: Picked IRQ 9 with weight 6
ohci0: interrupting at irq 9
ohci0: OHCI version 1.0
usb1 at ohci0: USB revision 1.0
uhub1 at usb1
uhub1: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub1: 3 ports with 3 removable, self powered
ohci1 at pci0 dev 15 function 1: NEC USB Host Controller (rev. 0x43)
ohci1: interrupting at irq 9
ohci1: OHCI version 1.0
usb2 at ohci1: USB revision 1.0
uhub2 at usb2
uhub2: NEC OHCI root hub, class 9/0, rev 1.00/1.00, addr 1
uhub2: 2 ports with 2 removable, self powered
ehci0 at pci0 dev 15 function 2: NEC USB Host Controller (rev. 0x04)
ehci0: interrupting at irq 11
ehci0: BIOS has given up ownership
ehci0: EHCI version 1.0
ehci0: companion controllers, 3 ports each: ohci0 ohci1
usb3 at ehci0: USB revision 2.0
uhub3 at usb3
uhub3: NEC EHCI root hub, class 9/0, rev 2.00/1.00, addr 1
uhub3: 5 ports with 5 removable, self powered
isa0 at piixpcib0
isapnp0 at isa0 port 0x279: ISA Plug 'n Play device support
fdc0 at isa0 port 0x3f0-0x3f7 irq 6 drq 2
isapnp0: no ISA Plug 'n Play devices found
timecounter: Timecounter "clockinterrupt" frequency 100 Hz quality 0
fd0 at fdc0 drive 0: 1.44MB, 80 cyl, 2 head, 18 sec
Kernelized RAIDframe activated
scsibus0: waiting 2 seconds for devices to settle...
uhub4 at uhub3 port 5
uhub4: NEC Corporation USB2.0 Hub Controller, class 9/0, rev 2.00/1.00, addr 2
uhub4: single transaction translator
uhub4: 4 ports with 4 removable, self powered
sd0 at scsibus0 target 0 lun 0: <IBM, DMVS09D, 0100> disk fixed
sd0: 8748 MB, 11727 cyl, 5 head, 305 sec, 512 bytes/sect x 17916240 sectors
sd0: sync (25.00ns offset 31), 16-bit (80.000MB/s) transfers, tagged queueing
cd0 at scsibus0 target 3 lun 0: <PLEXTOR, CD-ROM PX-40TW, 1.03> cdrom removable
cd0: sync (50.00ns offset 15), 16-bit (40.000MB/s) transfers
boot device: sd0
root on sd0a dumps on sd0b
root file system type: ffs
umass0 at uhub4 port 3 configuration 1 interface 0
umass0: Genesys Logic USB TO IDE, rev 2.00/0.33, addr 3
umass0: using SCSI over Bulk-Only
scsibus1 at umass0: 2 targets, 1 lun per target
sd1 at scsibus1 target 0 lun 0: <ST980821, 0A, 0811> disk fixed
sd1: fabricating a geometry
sd1: 76319 MB, 76319 cyl, 64 head, 32 sec, 512 bytes/sect x 156301488 sectors
wsdisplay0: screen 1 added (80x25, vt100 emulation)
wsdisplay0: screen 2 added (80x25, vt100 emulation)
wsdisplay0: screen 3 added (80x25, vt100 emulation)
wsdisplay0: screen 4 added (80x25, vt100 emulation)


>Fix:

>Release-Note:

>Audit-Trail:
From: dieter roelants <dieter.NetBSD@pandora.be>
To: gnats-bugs@NetBSD.org
Cc: 
Subject: Re: port-i386/36952: swapctl(8) doesn't
Date: Sun, 9 Sep 2007 12:25:00 +0200

 On Sun,  9 Sep 2007 09:15:01 +0000 (UTC)
 jjhartley@gmail.com wrote:

 > $ sudo swapctl -A
 > Password:
 > swapctl: /dev/sd0b: Device busy
 > $ sudo swapctl -l
 > Device      512-blocks     Used    Avail Capacity  Priority
 > /dev/sd0b       262300   262288       12   100%    0
 > $ 

 Apparently, swapctl err's out on first failure. Anwyay, you can use
 swapctl -a /dev/sd1b for now.

 I propose this patch:

 --- swapctl.c   27 Aug 2006 21:07:39 -0000      1.32
 +++ swapctl.c   9 Sep 2007 10:18:46 -0000
 @@ -469,7 +469,8 @@ add_swap(char *path, int priority)

         if (swapctl(SWAP_ON, path, priority) < 0) {
  oops:
 -               err(1, "%s", path);
 +               warn("%s", path);
 +               return 0;
         }
         return (1);
  }

 Kind regards
 dieter

From: matthew green <mrg@eterna.com.au>
To: gnats-bugs@NetBSD.org
Cc: port-i386-maintainer@netbsd.org, gnats-admin@netbsd.org,
	netbsd-bugs@netbsd.org, jjhartley@gmail.com
Subject: re: port-i386/36952: swapctl(8) doesn't 
Date: Wed, 19 Sep 2007 11:48:46 +1000


     Apparently, swapctl err's out on first failure. Anwyay, you can use
     swapctl -a /dev/sd1b for now.

     I propose this patch:

     --- swapctl.c   27 Aug 2006 21:07:39 -0000      1.32
     +++ swapctl.c   9 Sep 2007 10:18:46 -0000
     @@ -469,7 +469,8 @@ add_swap(char *path, int priority)

             if (swapctl(SWAP_ON, path, priority) < 0) {
      oops:
     -               err(1, "%s", path);
     +               warn("%s", path);
     +               return 0;
             }
             return (1);
      }


 this patch seems fine to me.

State-Changed-From-To: open->closed
State-Changed-By: maya@NetBSD.org
State-Changed-When: Mon, 27 May 2019 02:28:27 +0000
State-Changed-Why:
The patch mentioned here, for what was likely your issue, was committed in swapctl.c:1.40.
There's some chance you had a secondary issue, but I highly doubt you can reproduce this failure or remember if it was caused by something else.
Thanks for the report.
(If you do have different issues, please reply)


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.43 2018/01/16 07:36:43 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.