Re: Hitachi disk: spurious completions during NCQ

2007-10-14 Thread Don Mullis

> ata3.00: spurious completions during NCQ issue=0x0 SAct=0x407fd 
> FIS=005040a1:0002
> ata3.00: cmd 61/08:00:c7:5a:82/00:00:1b:00:00/40 tag 0 cdb 0x0 data 4096 out
>  res 50/00:10:07:5b:82/00:00:1b:00:00/40 Emask 0x2 (HSM violation)


This has been seen with several Hitachi drives.  There's speculation
that it's due to a bug in the drive firmware:

http://groups.google.it/group/linux.kernel/browse_thread/thread/a4bd3c19565a2009/389817602f0cd551?hl=it&lnk=st&q=hitachi+hsm+violation&rnum=3#389817602f0cd551
https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.22/+bug/137470


A workaround:

Index: /etc/rc.local
===
--- .orig/etc/rc.local  2007-10-13 14:57:10.0 -0700
+++ /etc/rc.local   2007-10-13 14:59:21.0 -0700
@@ -11,4 +11,7 @@
 #
 # By default this script does nothing.

+# See 
https://bugs.launchpad.net/ubuntu/+source/linux-source-2.6.22/+bug/137470/
+echo 1 > /sys/block/sda/device/queue_depth
+
 exit 0
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.23-mm1 [PATCH] restore default ARCH

2007-10-12 Thread Don Mullis
KAMEZAWA Hiroyuki <[EMAIL PROTECTED]> writes:

> [EMAIL PROTECTED] ref-2.6.23-mm1]$ make menuconfig
> Makefile:456: /home/kamezawa/ref-2.6.23-mm1/arch//Makefile: No such file or 
> directory
> make: *** No rule to make target 
> `/home/kamezawa/ref-2.6.23-mm1/arch//Makefile'.  Stop.
> ==
>
> $(ARCH) cannot be detected automatically...
>
> What information is useful for fixing this ?


This works for i386 on Ubuntu:



Definition of ARCH to the empty string defeated default native ARCH
assignment during initial run of make; eliminate said definition.

Signed-off-by: Don Mullis <[EMAIL PROTECTED]>
---
 Makefile |5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

Index: linux-2.6.23-mm/Makefile
===
--- linux-2.6.23-mm.orig/Makefile   2007-10-11 23:28:43.0 -0700
+++ linux-2.6.23-mm/Makefile2007-10-11 23:30:50.0 -0700
@@ -189,9 +189,8 @@
 # Default value for CROSS_COMPILE is not to prefix executables
 # Note: Some architectures assign CROSS_COMPILE in their arch/*/Makefile

-# The empty ARCH and CROSS_COMPILE statements exist so it is easy to
-# patch in hardcoded values for ARCH and CROSS_COMPILE
-ARCH   ?=
+# The empty CROSS_COMPILE statement exists so it is easy to
+# patch in a hardcoded value.
 CROSS_COMPILE  ?=

 # Kbuild save the ARCH and CROSS_COMPILE setting in .kbuild
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.23-rc8-mm2: OOPS in mmc on boot

2007-10-04 Thread Don Mullis
That patch boots without complaint as well.

BTW, the earlier failure messages did not make it
into /var/log/messages, only the dmesg buffer.
This is with standard Ubuntu Gutsy logging levels.

 
On Thu, 2007-10-04 at 18:42 +0200, Jens Axboe wrote:
> On Thu, Oct 04 2007, Pierre Ossman wrote:
> > On Thu, 04 Oct 2007 09:19:40 -0700
> > Don Mullis <[EMAIL PROTECTED]> wrote:
> > 
> > > This patch fixes the boot.
> > > 
> > 
> > Fantastic. Then will try to get this upstream then.
> 
> I already put it in the sgchain drivers part. If you could please ack
> it, that would be nice :-). I have a bunch of driver
> updates/work-arounds there.
> 
> > > > It looks like missing init of the sg list in mmc, does this work?
> > > > 
> > 
> > Jens, is this zeroing needed for each invocation, or really just once
> > to get the list in a known state?
> 
> Once should actually be enough, so you could move it to init as well.
> Don, care to verify with the below patch as well?
> 
> > Also, is chaining already upstream so Linus should have this for 2.6.23?
> 
> No, it's for 2.6.24.
> 
> diff --git a/drivers/mmc/card/queue.c b/drivers/mmc/card/queue.c
> index b0abc7d..a5d0354 100644
> --- a/drivers/mmc/card/queue.c
> +++ b/drivers/mmc/card/queue.c
> @@ -153,14 +153,14 @@ int mmc_init_queue(struct mmc_queue *mq, struct 
> mmc_card *card, spinlock_t *lock
>   blk_queue_max_hw_segments(mq->queue, bouncesz / 512);
>   blk_queue_max_segment_size(mq->queue, bouncesz);
>  
> - mq->sg = kmalloc(sizeof(struct scatterlist),
> + mq->sg = kzalloc(sizeof(struct scatterlist),
>   GFP_KERNEL);
>   if (!mq->sg) {
>   ret = -ENOMEM;
>   goto cleanup_queue;
>   }
>  
> - mq->bounce_sg = kmalloc(sizeof(struct scatterlist) *
> + mq->bounce_sg = kzalloc(sizeof(struct scatterlist) *
>   bouncesz / 512, GFP_KERNEL);
>   if (!mq->bounce_sg) {
>   ret = -ENOMEM;
> @@ -177,7 +177,7 @@ int mmc_init_queue(struct mmc_queue *mq, struct mmc_card 
> *card, spinlock_t *lock
>   blk_queue_max_hw_segments(mq->queue, host->max_hw_segs);
>   blk_queue_max_segment_size(mq->queue, host->max_seg_size);
>  
> - mq->sg = kmalloc(sizeof(struct scatterlist) *
> + mq->sg = kzalloc(sizeof(struct scatterlist) *
>   host->max_phys_segs, GFP_KERNEL);
>   if (!mq->sg) {
>   ret = -ENOMEM;
> 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.23-rc8-mm2: OOPS in mmc on boot

2007-10-04 Thread Don Mullis
This patch fixes the boot.


On Thu, 2007-10-04 at 09:25 +0200, Jens Axboe wrote: 
> On Wed, Oct 03 2007, Andrew Morton wrote:
> > On Wed, 03 Oct 2007 23:11:02 -0700 Don Mullis <[EMAIL PROTECTED]> wrote:
> > 
> > > OOPS followed by a 3 minute timeout, then completion of boot.
> > > Not seen if card (Kingston microSD adapter) is ejected; not seen in 
> > > 2.6.23-rc8.
> > > Running on a Dell XPS M1330 laptop.
> > > 
> > > `dmesg` reports:
> > > 
> > > [   13.695045] mmcblk0: mmc0:e95c SD02G 1966080KiB
> > > [   13.695155]  mmcblk0: p1
> > > [   13.706907] BUG: unable to handle kernel paging request at virtual 
> > > address 6b6b6b7a
> > > [   13.707026] printing eip: c01f09f0 *pde = 
> > > [   13.707174] Oops:  [#1] SMP
> > > [   13.707326] last sysfs file: /class/mmc_host/mmc0/mmc0:e95c/serial
> > > [   13.707389] Modules linked in: mmc_block sr_mod iwl4965 cdrom 
> > > serio_raw mac80211 piix sdhci pcspkr psmouse ide_core iTCO_wdt 
> > > iTCO_vendor_support watchdog_core watchdog_dev cfg80211 mmc_core shpchp 
> > > pci_hotplug intel_agp agpgart battery ac power_supply button evdev 
> > > ata_generic ext3 jbd mbcache sg sd_mod usbhid hid ahci ata_piix libata 
> > > scsi_mod ohci1394 tg3 ieee1394 ehci_hcd uhci_hcd thermal processor fan 
> > > fuse
> > > [   13.709649]
> > > [   13.709705] Pid: 4089, comm: mmcqd Not tainted (2.6.23-rc8-mm2 #27)
> > > [   13.709767] EIP: 0060:[] EFLAGS: 00010206 CPU: 0
> > > [   13.709831] EIP is at blk_rq_map_sg+0xc0/0x160
> > > [   13.709889] EAX: 04b6a000 EBX: c4a030e0 ECX: 04b6b000 EDX: c100
> > > [   13.709951] ESI: 6b6b6b6a EDI: c11535d0 EBP: c4971e30 ESP: c4971df4
> > > [   13.710013]  DS: 007b ES: 007b FS: 00d8 GS:  SS: 0068
> > > [   13.710074] Process mmcqd (pid: 4089, ti=c497 task=c387b660 
> > > task.ti=c497)
> > > [   13.710137] last branch before last exception/interrupt
> > > [   13.710249]  from c0129bf8 (vprintk+0x1d8/0x340)
> > > [   13.710359]  to c0129c9c (vprintk+0x27c/0x340)
> > > [   13.710453] Stack: c4971e08 c013d85f c48a0440 2000 04b6c000 
> > > c3914180 0001 0001
> > > [   13.710920]1000  c4923700 0100 c48ca3a0 
> > > c48f6d88 c48f6d88 c4971e40
> > > [   13.711390]f8c39e58 c48f6d88 c4a9f020 c4971fbc f8c396c9 
> > > c017de04 0004 c4971e84
> > > [   13.711857] Call Trace:
> > > [   13.711971]  [] mmc_queue_map_sg+0x28/0xc0 [mmc_block]
> > > [   13.712085]  [] mmc_blk_issue_rq+0x199/0x780 [mmc_block]
> > > [   13.712193]  [] mmc_queue_thread+0x78/0xe0 [mmc_block]
> > > [   13.712309]  [] kthread+0x42/0x70
> > > [   13.712415]  [] kernel_thread_helper+0x7/0x14
> > > [   13.712523]  ===
> > > [   13.712584] Code: 0c 03 4f 08 8b 7f 04 01 cf 89 7d d4 8b 3b 89 f8 29 
> > > d0 c1 f8 03 69 c0 39 8e e3 38 c1 e0 0c 03 43 08 39 45 d4 74 73 90 8d 74 
> > > 26 00 <8b> 46 10 8d 4e 10 89 3e 89 c2 83 e2 fe a8 01 8b 45 e4 0f 45 ca
> > > [   13.71] EIP: [] blk_rq_map_sg+0xc0/0x160 SS:ESP 
> > > 0068:c4971df4
> > > [   13.845668] Synaptics Touchpad, model: 1, fw: 6.3, id: 0x1c0b1, caps: 
> > > 0xa04753/0x20
> > > [   13.879914] input: SynPS/2 Synaptics TouchPad as /class/input/input7
> > > [  192.162711] Adding 2731008k swap on /dev/sda7.  Priority:-1 extents:1 
> > > across:2731008k
> > 
> > This could be due to git-block changes (or a lack of them ;))
> 
> It looks like missing init of the sg list in mmc, does this work?
> 
> --- linux-2.6.23-rc8/drivers/mmc/card/queue.c~2007-10-04 
> 09:22:02.0 +0200
> +++ linux-2.6.23-rc8/drivers/mmc/card/queue.c 2007-10-04 09:23:13.0 
> +0200
> @@ -334,14 +334,18 @@ static void copy_sg(struct scatterlist *
>  
>  unsigned int mmc_queue_map_sg(struct mmc_queue *mq)
>  {
> + struct request *rq = mq->req;
>   unsigned int sg_len;
>  
> - if (!mq->bounce_buf)
> - return blk_rq_map_sg(mq->queue, mq->req, mq->sg);
> + if (!mq->bounce_buf) {
> + memset(mq->sg, 0, rq->nr_hw_segments * sizeof(struct 
> scatterlist));
> + return blk_rq_map_sg(mq->queue, rq, mq->sg);
> + }
>  
>   BUG_ON(!mq->bounce_sg);
>  
> - sg_len = blk_rq_map_sg(mq->queue, mq->req, mq->bounce_sg);
> + memset(mq->bounce_sg, 0, rq->nr_hw_segments * sizeof(struct 
> scatterlist));
> + sg_len = blk_rq_map_sg(mq->queue, rq, mq->bounce_sg);
>  
>   mq->bounce_sg_len = sg_len;
>  
> 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


2.6.23-rc8-mm2: OOPS in mmc on boot

2007-10-04 Thread Don Mullis
OOPS followed by a 3 minute timeout, then completion of boot.
Not seen if card (Kingston microSD adapter) is ejected; not seen in 2.6.23-rc8.
Running on a Dell XPS M1330 laptop.

`dmesg` reports:

[   13.695045] mmcblk0: mmc0:e95c SD02G 1966080KiB
[   13.695155]  mmcblk0: p1
[   13.706907] BUG: unable to handle kernel paging request at virtual address 
6b6b6b7a
[   13.707026] printing eip: c01f09f0 *pde = 
[   13.707174] Oops:  [#1] SMP
[   13.707326] last sysfs file: /class/mmc_host/mmc0/mmc0:e95c/serial
[   13.707389] Modules linked in: mmc_block sr_mod iwl4965 cdrom serio_raw 
mac80211 piix sdhci pcspkr psmouse ide_core iTCO_wdt iTCO_vendor_support 
watchdog_core watchdog_dev cfg80211 mmc_core shpchp pci_hotplug intel_agp 
agpgart battery ac power_supply button evdev ata_generic ext3 jbd mbcache sg 
sd_mod usbhid hid ahci ata_piix libata scsi_mod ohci1394 tg3 ieee1394 ehci_hcd 
uhci_hcd thermal processor fan fuse
[   13.709649]
[   13.709705] Pid: 4089, comm: mmcqd Not tainted (2.6.23-rc8-mm2 #27)
[   13.709767] EIP: 0060:[] EFLAGS: 00010206 CPU: 0
[   13.709831] EIP is at blk_rq_map_sg+0xc0/0x160
[   13.709889] EAX: 04b6a000 EBX: c4a030e0 ECX: 04b6b000 EDX: c100
[   13.709951] ESI: 6b6b6b6a EDI: c11535d0 EBP: c4971e30 ESP: c4971df4
[   13.710013]  DS: 007b ES: 007b FS: 00d8 GS:  SS: 0068
[   13.710074] Process mmcqd (pid: 4089, ti=c497 task=c387b660 
task.ti=c497)
[   13.710137] last branch before last exception/interrupt
[   13.710249]  from c0129bf8 (vprintk+0x1d8/0x340)
[   13.710359]  to c0129c9c (vprintk+0x27c/0x340)
[   13.710453] Stack: c4971e08 c013d85f c48a0440 2000 04b6c000 c3914180 
0001 0001
[   13.710920]1000  c4923700 0100 c48ca3a0 c48f6d88 
c48f6d88 c4971e40
[   13.711390]f8c39e58 c48f6d88 c4a9f020 c4971fbc f8c396c9 c017de04 
0004 c4971e84
[   13.711857] Call Trace:
[   13.711971]  [] mmc_queue_map_sg+0x28/0xc0 [mmc_block]
[   13.712085]  [] mmc_blk_issue_rq+0x199/0x780 [mmc_block]
[   13.712193]  [] mmc_queue_thread+0x78/0xe0 [mmc_block]
[   13.712309]  [] kthread+0x42/0x70
[   13.712415]  [] kernel_thread_helper+0x7/0x14
[   13.712523]  ===
[   13.712584] Code: 0c 03 4f 08 8b 7f 04 01 cf 89 7d d4 8b 3b 89 f8 29 d0 c1 
f8 03 69 c0 39 8e e3 38 c1 e0 0c 03 43 08 39 45 d4 74 73 90 8d 74 26 00 <8b> 46 
10 8d 4e 10 89 3e 89 c2 83 e2 fe a8 01 8b 45 e4 0f 45 ca
[   13.71] EIP: [] blk_rq_map_sg+0xc0/0x160 SS:ESP 0068:c4971df4
[   13.845668] Synaptics Touchpad, model: 1, fw: 6.3, id: 0x1c0b1, caps: 
0xa04753/0x20
[   13.879914] input: SynPS/2 Synaptics TouchPad as /class/input/input7
[  192.162711] Adding 2731008k swap on /dev/sda7.  Priority:-1 extents:1 
across:2731008k


`lspci -vvv` reports:

03:01.1 Generic system peripheral [0805]: Ricoh Co Ltd R5C822 
SD/SDIO/MMC/MS/MSPro Host Adapter (rev 22) (prog-if 01)
Subsystem: Dell Unknown device 0209
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr- 
Stepping- SERR+ FastB2B-
Status: Cap+ 66MHz- UDF- FastB2B- ParErr- DEVSEL=medium >TAbort- 
SERR- TAbort- 
SERR- TAbort- 
SERR- TAbort- 
SERR- http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH -mm] fix DocBook build

2007-01-28 Thread Don Mullis
Fix DocBook build.
Regression was introduced by
gregkh-usb-usb-linux-usb_ch9h-becomes-linux-usb-ch9h.patch

Tested by `make htmldocs`.

Signed-off-by: Don Mullis <[EMAIL PROTECTED]>
Cc: [EMAIL PROTECTED]
---
 Documentation/DocBook/gadget.tmpl |4 ++--
 Documentation/DocBook/usb.tmpl|6 +++---
 2 files changed, 5 insertions(+), 5 deletions(-)

Index: linux-2.6.19/Documentation/DocBook/gadget.tmpl
===
--- linux-2.6.19.orig/Documentation/DocBook/gadget.tmpl
+++ linux-2.6.19/Documentation/DocBook/gadget.tmpl
@@ -482,13 +482,13 @@ slightly.
 Gadget drivers
 rely on common USB structures and constants
 defined in the
-<linux/usb_ch9.h>
+<linux/usb/ch9.h>
 header file, which is standard in Linux 2.6 kernels.
 These are the same types and constants used by host
 side drivers (and usbcore).
 
 
-!Iinclude/linux/usb_ch9.h
+!Iinclude/linux/usb/ch9.h
 
 
 Core Objects and Methods
Index: linux-2.6.19/Documentation/DocBook/usb.tmpl
===
--- linux-2.6.19.orig/Documentation/DocBook/usb.tmpl
+++ linux-2.6.19/Documentation/DocBook/usb.tmpl
@@ -187,13 +187,13 @@
 
 USB-Standard Types
 
-In <linux/usb_ch9.h> you will find
+In <linux/usb/ch9.h> you will find
 the USB data types defined in chapter 9 of the USB specification.
 These data types are used throughout USB, and in APIs including
 this host side API, gadget APIs, and usbfs.
 
 
-!Iinclude/linux/usb_ch9.h
+!Iinclude/linux/usb/ch9.h
 
 
 
@@ -574,7 +574,7 @@ for (;;) {
 #include <asm/byteorder.h>
The standard USB device model requests, from "Chapter 9" of
the USB 2.0 specification, are automatically included from
-   the <linux/usb_ch9.h> header.
+   the <linux/usb/ch9.h> header.

 
Unless noted otherwise, the ioctl requests
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: `make htmldocs` fails -- 2.6.20-rc4-mm1

2007-01-22 Thread Don Mullis
On Mon, 2007-01-22 at 22:22 -0800, Randy Dunlap wrote:
> On Mon, 22 Jan 2007 22:02:30 -0800 Don Mullis wrote:
> 
> > 
> > Bisection shows the bad patch to be:
> > gregkh-driver-uio-documentation.patch
> > 
> > The htmldocs build failure can be eliminated by:
> > quilt remove Documentation/DocBook/kernel-api.tmpl
> 
> or by:  quilt delete gregkh-driver-uio-documentation.patch ??

That would fix the htmldoc build too, but would throw out lots of
documentation.  Greg K-H would seem the prime candidate to propose a
fix.


> How about an accurate description of what kernel tree has this problem?
> It's not 2.6.19.  It's not 2.6.20-rc5.

2.6.20-rc4-mm1, sorry.  Forgot that posting as a reply to the
2.6.20-rc4-mm1 announcement is no help for someone receiving the mail
directly.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


`make htmldocs` fails

2007-01-22 Thread Don Mullis

Bisection shows the bad patch to be:
gregkh-driver-uio-documentation.patch

The htmldocs build failure can be eliminated by:
quilt remove Documentation/DocBook/kernel-api.tmpl

The error messages were:

.../linux-2.6.19 $ make htmldocs
  DOCPROC Documentation/DocBook/kernel-api.xml

Warning(/noback/kernel.org/2.6.20-rc_fault-injection/linux-2.6.19//drivers/uio/uio.c:521):
 No description found for parameter 'owner'

Warning(/noback/kernel.org/2.6.20-rc_fault-injection/linux-2.6.19//drivers/uio/uio.c:521):
 No description found for parameter 'info'

Warning(/noback/kernel.org/2.6.20-rc_fault-injection/linux-2.6.19//drivers/uio/uio.c:591):
 No description found for parameter 'idev'

Error(/noback/kernel.org/2.6.20-rc_fault-injection/linux-2.6.19//include/linux/uio_driver.h:33):
 cannot understand prototype: 'struct uio_info '

Warning(/noback/kernel.org/2.6.20-rc_fault-injection/linux-2.6.19//include/linux/uio_driver.h):
 no structured comments found
make[1]: *** [Documentation/DocBook/kernel-api.xml] Error 1
make: *** [htmldocs] Error 2

The failure was observed on an up-to-date Fedora Core 5 host. 
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] kbuild: move tags from ARCH and include/ ahead of drivers

2007-01-04 Thread Don Mullis
Move tags extracted from the ARCH and include/ sub-trees ahead of
those from device drivers, so that the former will appear first
during searches. 

Saves user time during interactive searches for certain patterns
that happen to find unwanted matches in driver files.

Example in emacs:
 "M-x find-tag PAGE_SIZE"
 "M-1 M-." (repeated until definition from asm-i386/page.h appears)

Signed-off-by: Don Mullis <[EMAIL PROTECTED]>
---
Tested with emacs/etags/ctags v22.0.92 by:
 1) running `make TAGS`, `make tags` with and without patch (ARCH=i386).
 2) verifying improved behavior of tag definition searching with
   "M-x find-tag PAGE_SIZE", "M-1 M-." in emacs

 Makefile |   11 ++-
 1 file changed, 6 insertions(+), 5 deletions(-)

Index: linux-2.6.19/Makefile
===
--- linux-2.6.19.orig/Makefile
+++ linux-2.6.19/Makefile
@@ -1292,10 +1292,7 @@ endif
 ALLSOURCE_ARCHS := $(ARCH)
 
 define find-sources
-( find $(__srctree) $(RCS_FIND_IGNORE) \
-  \( -name include -o -name arch \) -prune -o \
-  -name $1 -print; \
- for ARCH in $(ALLSOURCE_ARCHS) ; do \
+( for ARCH in $(ALLSOURCE_ARCHS) ; do \
   find $(__srctree)arch/$${ARCH} $(RCS_FIND_IGNORE) \
-name $1 -print; \
  done ; \
@@ -1309,7 +1306,11 @@ define find-sources
-name $1 -print; \
  done ; \
  find $(__srctree)include/asm-generic $(RCS_FIND_IGNORE) \
-  -name $1 -print )
+  -name $1 -print; \
+ find $(__srctree) $(RCS_FIND_IGNORE) \
+  \( -name include -o -name arch \) -prune -o \
+  -name $1 -print; \
+ )
 endef
 
 define all-sources


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 5/5 -mm] fault-injection: defaults likely to please a new user

2006-12-07 Thread Don Mullis
Assign defaults most likely to please a new user:
 1) generate some logging output
(verbose=2)
 2) avoid injecting failures likely to lock up UI
(ignore_gfp_wait=1, ignore_gfp_highmem=1)

Signed-off-by: Don Mullis <[EMAIL PROTECTED]>
Cc: Akinobu Mita <[EMAIL PROTECTED]>
---
 include/linux/fault-inject.h |1 +
 mm/page_alloc.c  |2 ++
 mm/slab.c|1 +
 3 files changed, 4 insertions(+)

Index: linux-2.6.18/include/linux/fault-inject.h
===
--- linux-2.6.18.orig/include/linux/fault-inject.h
+++ linux-2.6.18/include/linux/fault-inject.h
@@ -52,6 +52,7 @@ struct fault_attr {
.times = ATOMIC_INIT(1),\
.require_end = ULONG_MAX,   \
.stacktrace_depth = 32, \
+   .verbose = 2,   \
}
 
 #define DECLARE_FAULT_ATTR(name) struct fault_attr name = 
FAULT_ATTR_INITIALIZER
Index: linux-2.6.18/mm/page_alloc.c
===
--- linux-2.6.18.orig/mm/page_alloc.c
+++ linux-2.6.18/mm/page_alloc.c
@@ -914,6 +914,8 @@ static struct fail_page_alloc_attr {
 
 } fail_page_alloc = {
.attr = FAULT_ATTR_INITIALIZER,
+   .ignore_gfp_wait = 1,
+   .ignore_gfp_highmem = 1,
 };
 
 static int __init setup_fail_page_alloc(char *str)
Index: linux-2.6.18/mm/slab.c
===
--- linux-2.6.18.orig/mm/slab.c
+++ linux-2.6.18/mm/slab.c
@@ -3108,6 +3108,7 @@ static struct failslab_attr {
 
 } failslab = {
.attr = FAULT_ATTR_INITIALIZER,
+   .ignore_gfp_wait = 1,
 };
 
 static int __init setup_failslab(char *str)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 4/5 -mm] fault-injection: optimize and simplify should_fail()

2006-12-07 Thread Don Mullis
Trivial optimization and simplification of should_fail().

Do cheaper disqualification tests first (performance gain not quantified).
Simplify logic; eliminate goto.

Signed-off-by: Don Mullis <[EMAIL PROTECTED]>
Cc: Akinobu Mita <[EMAIL PROTECTED]>
---
 lib/fault-inject.c |   11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

Index: linux-2.6.18/lib/fault-inject.c
===
--- linux-2.6.18.orig/lib/fault-inject.c
+++ linux-2.6.18/lib/fault-inject.c
@@ -142,9 +142,6 @@ bool should_fail(struct fault_attr *attr
if (attr->task_filter && !fail_task(attr, current))
return false;
 
-   if (!fail_stacktrace(attr))
-   return false;
-
if (atomic_read(&attr->times) == 0)
return false;
 
@@ -159,12 +156,12 @@ bool should_fail(struct fault_attr *attr
return false;
}
 
-   if (attr->probability > random32() % 100)
-   goto fail;
+   if (attr->probability <= random32() % 100)
+   return false;
 
-   return false;
+   if (!fail_stacktrace(attr))
+   return false;
 
-fail:
fail_dump(attr);
 
if (atomic_read(&attr->times) != -1)


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 3/5 -mm] fault-injection: Clamp debugfs stacktrace-depth to MAX_STACK_TRACE_DEPTH

2006-12-07 Thread Don Mullis
Clamp /debug/fail*/stacktrace-depth to MAX_STACK_TRACE_DEPTH.
Ensures that a read of /debug/fail*/stacktrace-depth always
returns a truthful answer.

Signed-off-by: Don Mullis <[EMAIL PROTECTED]>
Cc: Akinobu Mita <[EMAIL PROTECTED]>
---
 lib/fault-inject.c |   27 +++
 1 file changed, 23 insertions(+), 4 deletions(-)

Index: linux-2.6.18/lib/fault-inject.c
===
--- linux-2.6.18.orig/lib/fault-inject.c
+++ linux-2.6.18/lib/fault-inject.c
@@ -53,6 +53,8 @@ static bool fail_task(struct fault_attr 
return !in_interrupt() && task->make_it_fail;
 }
 
+#define MAX_STACK_TRACE_DEPTH 32
+
 #ifdef CONFIG_STACK_UNWIND
 
 static asmlinkage int fail_stacktrace_callback(struct unwind_frame_info *info,
@@ -98,8 +100,7 @@ static bool fail_stacktrace(struct fault
 
trace.nr_entries = 0;
trace.entries = entries;
-   trace.max_entries = (depth < MAX_STACK_TRACE_DEPTH) ?
-   depth : MAX_STACK_TRACE_DEPTH;
+   trace.max_entries = depth;
trace.skip = 1;
trace.all_contexts = 0;
 
@@ -179,6 +180,13 @@ static void debugfs_ul_set(void *data, u
*(unsigned long *)data = val;
 }
 
+static void debugfs_ul_set_MAX_STACK_TRACE_DEPTH(void *data, u64 val)
+{
+   *(unsigned long *)data =
+   val < MAX_STACK_TRACE_DEPTH ?
+   val : MAX_STACK_TRACE_DEPTH;
+}
+
 static u64 debugfs_ul_get(void *data)
 {
return *(unsigned long *)data;
@@ -192,6 +200,17 @@ static struct dentry *debugfs_create_ul(
return debugfs_create_file(name, mode, parent, value, &fops_ul);
 }
 
+DEFINE_SIMPLE_ATTRIBUTE(fops_ul_MAX_STACK_TRACE_DEPTH, debugfs_ul_get,
+   debugfs_ul_set_MAX_STACK_TRACE_DEPTH, "%llu\n");
+
+static struct dentry *debugfs_create_ul_MAX_STACK_TRACE_DEPTH(
+   const char *name, mode_t mode,
+   struct dentry *parent, unsigned long *value)
+{
+   return debugfs_create_file(name, mode, parent, value,
+  &fops_ul_MAX_STACK_TRACE_DEPTH);
+}
+
 static void debugfs_atomic_t_set(void *data, u64 val)
 {
atomic_set((atomic_t *)data, val);
@@ -284,8 +303,8 @@ int init_fault_attr_dentries(struct faul
mode, dir, &attr->task_filter);
 
attr->dentries.stacktrace_depth_file =
-   debugfs_create_ul("stacktrace-depth", mode, dir,
- &attr->stacktrace_depth);
+   debugfs_create_ul_MAX_STACK_TRACE_DEPTH(
+   "stacktrace-depth", mode, dir, &attr->stacktrace_depth);
 
attr->dentries.require_start_file =
debugfs_create_ul("require-start", mode, dir, 
&attr->require_start);


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/5 -mm] fault-injection: Use bool-true-false throughout

2006-12-07 Thread Don Mullis
Use bool-true-false throughout.

Signed-off-by: Don Mullis <[EMAIL PROTECTED]>
Cc: Akinobu Mita <[EMAIL PROTECTED]>
---
 include/linux/fault-inject.h |2 +-
 lib/fault-inject.c   |   40 +++-
 2 files changed, 20 insertions(+), 22 deletions(-)

Index: linux-2.6.18/include/linux/fault-inject.h
===
--- linux-2.6.18.orig/include/linux/fault-inject.h
+++ linux-2.6.18/include/linux/fault-inject.h
@@ -57,7 +57,7 @@ struct fault_attr {
 #define DECLARE_FAULT_ATTR(name) struct fault_attr name = 
FAULT_ATTR_INITIALIZER
 int setup_fault_attr(struct fault_attr *attr, char *str);
 void should_fail_srandom(unsigned long entropy);
-int should_fail(struct fault_attr *attr, ssize_t size);
+bool should_fail(struct fault_attr *attr, ssize_t size);
 
 #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
 
Index: linux-2.6.18/lib/fault-inject.c
===
--- linux-2.6.18.orig/lib/fault-inject.c
+++ linux-2.6.18/lib/fault-inject.c
@@ -48,7 +48,7 @@ static void fail_dump(struct fault_attr 
 
 #define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0)
 
-static int fail_task(struct fault_attr *attr, struct task_struct *task)
+static bool fail_task(struct fault_attr *attr, struct task_struct *task)
 {
return !in_interrupt() && task->make_it_fail;
 }
@@ -68,15 +68,15 @@ static asmlinkage int fail_stacktrace_ca
break;
if (attr->reject_start <= UNW_PC(info) &&
   UNW_PC(info) < attr->reject_end)
-   return 0;
+   return false;
if (attr->require_start <= UNW_PC(info) &&
   UNW_PC(info) < attr->require_end)
-   found = 1;
+   found = true;
}
return found;
 }
 
-static int fail_stacktrace(struct fault_attr *attr)
+static bool fail_stacktrace(struct fault_attr *attr)
 {
struct unwind_frame_info info;
 
@@ -85,9 +85,7 @@ static int fail_stacktrace(struct fault_
 
 #elif defined(CONFIG_STACKTRACE)
 
-#define MAX_STACK_TRACE_DEPTH 32
-
-static int fail_stacktrace(struct fault_attr *attr)
+static bool fail_stacktrace(struct fault_attr *attr)
 {
struct stack_trace trace;
int depth = attr->stacktrace_depth;
@@ -109,26 +107,26 @@ static int fail_stacktrace(struct fault_
for (n = 0; n < trace.nr_entries; n++) {
if (attr->reject_start <= entries[n] &&
   entries[n] < attr->reject_end)
-   return 0;
+   return false;
if (attr->require_start <= entries[n] &&
   entries[n] < attr->require_end)
-   found = 1;
+   found = true;
}
return found;
 }
 
 #else
 
-static inline int fail_stacktrace(struct fault_attr *attr)
+static inline bool fail_stacktrace(struct fault_attr *attr)
 {
-   static int firsttime = 1;
+   static bool firsttime = true;
 
if (firsttime) {
printk(KERN_WARNING
"This architecture does not implement save_stack_trace()\n");
-   firsttime = 0;
+   firsttime = false;
}
-   return 0;
+   return false;
 }
 
 #endif
@@ -138,32 +136,32 @@ static inline int fail_stacktrace(struct
  * http://www.nongnu.org/failmalloc/
  */
 
-int should_fail(struct fault_attr *attr, ssize_t size)
+bool should_fail(struct fault_attr *attr, ssize_t size)
 {
if (attr->task_filter && !fail_task(attr, current))
-   return 0;
+   return false;
 
if (!fail_stacktrace(attr))
-   return 0;
+   return false;
 
if (atomic_read(&attr->times) == 0)
-   return 0;
+   return false;
 
if (atomic_read(&attr->space) > size) {
atomic_sub(size, &attr->space);
-   return 0;
+   return false;
}
 
if (attr->interval > 1) {
attr->count++;
if (attr->count % attr->interval)
-   return 0;
+   return false;
}
 
if (attr->probability > random32() % 100)
goto fail;
 
-   return 0;
+   return false;
 
 fail:
fail_dump(attr);
@@ -171,7 +169,7 @@ fail:
if (atomic_read(&attr->times) != -1)
atomic_dec_not_zero(&attr->times);
 
-   return 1;
+   return true;
 }
 
 #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 1/5 -mm] fault-injection: Correct, disambiguate, and reformat documentation.

2006-12-07 Thread Don Mullis
Correct, disambiguate, and reformat documentation.

Signed-off-by: Don Mullis <[EMAIL PROTECTED]>
Cc: Akinobu Mita <[EMAIL PROTECTED]>
---
 Documentation/fault-injection/failmodule.sh   |4 -
 Documentation/fault-injection/fault-injection.txt |   70 +++---
 2 files changed, 37 insertions(+), 37 deletions(-)

Index: linux-2.6.18/Documentation/fault-injection/failmodule.sh
===
--- linux-2.6.18.orig/Documentation/fault-injection/failmodule.sh
+++ linux-2.6.18/Documentation/fault-injection/failmodule.sh
@@ -26,6 +26,6 @@ fi
 # Disable any fault injection
 echo 0 > /debug/$1/stacktrace-depth
 
-echo `cat /sys/module/$2/sections/.text` > /debug/$1/address-start
-echo `cat /sys/module/$2/sections/.exit.text` > /debug/$1/address-end
+echo `cat /sys/module/$2/sections/.text` > /debug/$1/require-start
+echo `cat /sys/module/$2/sections/.exit.text` > /debug/$1/require-end
 echo $STACKTRACE_DEPTH > /debug/$1/stacktrace-depth
Index: linux-2.6.18/Documentation/fault-injection/fault-injection.txt
===
--- linux-2.6.18.orig/Documentation/fault-injection/fault-injection.txt
+++ linux-2.6.18/Documentation/fault-injection/fault-injection.txt
@@ -17,7 +17,7 @@ o fail_page_alloc
 
 o fail_make_request
 
-  injects disk IO errors on permitted devices by
+  injects disk IO errors on devices permitted by setting
   /sys/block//make-it-fail or
   /sys/block///make-it-fail. (generic_make_request())
 
@@ -29,16 +29,16 @@ o debugfs entries
 fault-inject-debugfs kernel module provides some debugfs entries for runtime
 configuration of fault-injection capabilities.
 
-- /debug/*/probability:
+- /debug/fail*/probability:
 
likelihood of failure injection, in percent.
Format: 
 
-   Note that one-failure-per-handred is a very high error rate
-   for some testcases. Please set probably=100 and configure
-   /debug/*/interval for such testcases.
+   Note that one-failure-per-hundred is a very high error rate
+   for some testcases.  Consider setting probability=100 and configure
+   /debug/fail*/interval for such testcases.
 
-- /debug/*/interval:
+- /debug/fail*/interval:
 
specifies the interval between failures, for calls to
should_fail() that pass all the other tests.
@@ -46,37 +46,36 @@ configuration of fault-injection capabil
Note that if you enable this, by setting interval>1, you will
probably want to set probability=100.
 
-- /debug/*/times:
+- /debug/fail*/times:
 
specifies how many times failures may happen at most.
A value of -1 means "no limit".
 
-- /debug/*/space:
+- /debug/fail*/space:
 
specifies an initial resource "budget", decremented by "size"
on each call to should_fail(,size).  Failure injection is
suppressed until "space" reaches zero.
 
-- /debug/*/verbose
+- /debug/fail*/verbose
 
Format: { 0 | 1 | 2 }
-   specifies the verbosity of the messages when failure is injected.
-   We default to 0 (no extra messages), setting it to '1' will
-   print only to tell failure happened, '2' will print call trace too -
-   it is useful to debug the problems revealed by fault injection
-   capabilities.
+   specifies the verbosity of the messages when failure is
+   injected.  '0' means no messages; '1' will print only a single
+   log line per failure; '2' will print a call trace too -- useful
+   to debug the problems revealed by fault injection.
 
-- /debug/*/task-filter:
+- /debug/fail*/task-filter:
 
-   Format: { 0 | 1 }
-   A value of '0' disables filtering by process (default).
+   Format: { 'Y' | 'N' }
+   A value of 'N' disables filtering by process (default).
Any positive value limits failures to only processes indicated by
/proc//make-it-fail==1.
 
-- /debug/*/require-start:
-- /debug/*/require-end:
-- /debug/*/reject-start:
-- /debug/*/reject-end:
+- /debug/fail*/require-start:
+- /debug/fail*/require-end:
+- /debug/fail*/reject-start:
+- /debug/fail*/reject-end:
 
specifies the range of virtual addresses tested during
stacktrace walking.  Failure is injected only if some caller
@@ -85,22 +84,23 @@ configuration of fault-injection capabil
Default required range is [0,ULONG_MAX) (whole of virtual address 
space).
Default rejected range is [0,0).
 
-- /debug/*/stacktrace-depth:
+- /debug/fail*/stacktrace-depth:
 
specifies the maximum stacktrace depth walked during search
-   for a caller within [address-start,address-end).
+   for a caller within [require-start,require-end) OR
+   [reject-start,reject-end).
 
 - /debug/fail_page_alloc/ignore-gfp-highmem:
 
-   Format

Re: [PATCH 2/2 -mm] fault-injection: lightweight code-coverage maximizer

2006-11-29 Thread Don Mullis
On Wed, 2006-11-29 at 11:37 +0900, Akinobu Mita wrote:
> On Tue, Nov 28, 2006 at 12:14:36PM -0800, Don Mullis wrote:
> > First, waiting a few seconds for the standard FC-6 daemons to wake up.
> > Then, Xemacs and Firefox.  Not tested on SMP.
> 
> Is it failslab or fail_page_alloc ?

Usually failslab, as it exposes unique stacks more quickly.

> > > This doesn't maximize code coverage. It makes fault-injector reject
> > > any failures which have same stacktrace before.
> > 
> > Since the volume of (repeated) dumps is greatly reduced, 
> > interval/probability can be set more aggressively without crippling
> > interaction.  This increases the number of error recovery paths covered
> > per unit of wall clock time.
> > 
> It seems artificial. Injecting failures into slab or page allocator causes
> vastly greater range of errors and it should be. I feel what you really
> want is new fault capability.

When conducting an expensive test, one would naturally prefer not to
repeat it on cases that are nearly the same, and therefore unlikely to
expose a bug, at least until all the "more distinctive" cases have
been hit.  Which cases actually do contain a bug is of course
not knowable a priori, and "distinctiveness" is subjective.

The claim of this patch is that uniqueness of call stack is 
a better proxy for likelihood to contain a bug than mere number
of calls to should_fail() -- which can be thought of as the null proxy.

> Fault injection is designed be extensible. It's not only for failslab,
> fail_page_alloc, and fail_make_request.

Sure.

> Common debugfs entries for fault capabilities will be complicated
> soon by pushing new entries for every fault case or pattern.

True.  "space" seems useful only for storage allocation calls.
Should it be dropped from the common set of debugfs entries?


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 1/2 -mm] fault-injection: safer defaults, trivial optimization, cleanup

2006-11-28 Thread Don Mullis
On Tue, 2006-11-28 at 13:37 -0800, Andrew Morton wrote:

> We'd prefer one-patch-per-concept, please. This all sounds like about
> six patches.

Understood.

> We _could_ merge this patch as-is, but it means that when this stuff
> finally hits mainline it would go in as a nice sequence of logical patches,
> followed by a random thing which is splattered all over all the preceding
> patches.

Does this argue for a respin of the original patches, folding in
content from this one, rather than splitting it into an additional six to
be appended to the series?

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: [PATCH 2/2 -mm] fault-injection: lightweight code-coverage maximizer

2006-11-28 Thread Don Mullis
On Tue, 2006-11-28 at 18:18 +0900, Akinobu Mita wrote:
> On Mon, Nov 27, 2006 at 11:51:30PM -0800, Don Mullis wrote:
> > Upon keying in
> > echo 1 >probability
> > echo 3 >verbose
> > echo -1 >times
> > a few dozen stacks are printk'ed, then system responsiveness
> > recovers to normal.  Similarly, starting a non-trivial program
> > will print a few stacks before responsiveness recovers.
> 
> What kind of test did you do?

First, waiting a few seconds for the standard FC-6 daemons to wake up.
Then, Xemacs and Firefox.  Not tested on SMP.


> This doesn't maximize code coverage. It makes fault-injector reject
> any failures which have same stacktrace before.

Since the volume of (repeated) dumps is greatly reduced, 
interval/probability can be set more aggressively without crippling
interaction.  This increases the number of error recovery paths covered
per unit of wall clock time.


> Updating array in this way is not safe (SMP or interrupt).
 
You're right.  Patch forthcoming.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.19-rc6-mm1 -- sched-improve-migration-accuracy.patch slows boot

2006-11-28 Thread Don Mullis
On Mon, 2006-11-27 at 11:16 +0100, Ingo Molnar wrote:
> could you run this utility:
> 
>   http://people.redhat.com/mingo/time-warp-test/time-warp-test.c
> 
> on your box for a while (10 minutes or so) - what does it print?
> 
>   Ingo

1 CPUs, running 1 parallel test-tasks.
checking for time-warps via:
- read time stamp counter (RDTSC) instruction (cycle resolution)
- gettimeofday (TOD) syscall (usec resolution)
- clock_gettime(CLOCK_MONOTONIC) syscall (nsec resolution)

new TOD-warp maximum:   -442709 usecs,  00042352e214e2f8 ->
00042352e20e21a3
 | 0.69 us, TSC-warps:0 | 6.89 us, TOD-warps:1 | 6.89 us, CLOCK-warps:0
|


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH 2/2 -mm] fault-injection: lightweight code-coverage maximizer

2006-11-27 Thread Don Mullis
Allow all non-unique call stacks, as judged by pushed sequence of EIPs,
to be to be ignored as failure candidates.

Upon keying in
echo 1 >probability
echo 3 >verbose
echo -1 >times
a few dozen stacks are printk'ed, then system responsiveness
recovers to normal.  Similarly, starting a non-trivial program
will print a few stacks before responsiveness recovers.

Intent is to make code-coverage-maximizing test lightweight, perhaps
light enough to remain enabled during the course of the developer's
interactive testing of new code.

Enabled by default. (/debug/fail*/stacktrace-depth > 0)

Signed-off-by: Don Mullis <[EMAIL PROTECTED]>
Cc: Akinobu Mita <[EMAIL PROTECTED]>
---
 Documentation/fault-injection/fault-injection.txt |7 +
 include/linux/fault-inject.h  |4 
 lib/fault-inject.c|  123 +++---
 3 files changed, 120 insertions(+), 14 deletions(-)

Index: linux-2.6.18/include/linux/fault-inject.h
===
--- linux-2.6.18.orig/include/linux/fault-inject.h
+++ linux-2.6.18/include/linux/fault-inject.h
@@ -23,6 +23,8 @@ struct fault_attr {
unsigned long require_end;
unsigned long reject_start;
unsigned long reject_end;
+   unsigned long uniquestack_depth;
+   atomic_t uniquestack_hash_table[256];
 
unsigned long count;
 
@@ -42,6 +44,7 @@ struct fault_attr {
struct dentry *require_end_file;
struct dentry *reject_start_file;
struct dentry *reject_end_file;
+   struct dentry *uniquestack_depth_file;
} dentries;
 
 #endif
@@ -53,6 +56,7 @@ struct fault_attr {
.require_end = ULONG_MAX,   \
.stacktrace_depth = 32, \
.verbose = 2,   \
+   .uniquestack_depth = 32,\
}
 
 #define DECLARE_FAULT_ATTR(name) struct fault_attr name = 
FAULT_ATTR_INITIALIZER
Index: linux-2.6.18/lib/fault-inject.c
===
--- linux-2.6.18.orig/lib/fault-inject.c
+++ linux-2.6.18/lib/fault-inject.c
@@ -1,3 +1,4 @@
+
 #include 
 #include 
 #include 
@@ -9,8 +10,12 @@
 #include 
 #include 
 #include 
+#include 
+#include 
 #include 
 
+#define MAX_STACK_TRACE_DEPTH 32
+
 /*
  * setup_fault_attr() is a helper function for various __setup handlers, so it
  * returns 0 on error, because that is what __setup handlers do.
@@ -21,10 +26,11 @@ int __init setup_fault_attr(struct fault
unsigned long interval;
int times;
int space;
+   unsigned long uniquestack_depth;
 
-   /* ",,," */
-   if (sscanf(str, "%lu,%lu,%d,%d",
-   &interval, &probability, &space, ×) < 4) {
+   /* "" */
+   if (sscanf(str, "%lu,%lu,%d,%d,%lu", &interval,
+  &probability, &space, ×, &uniquestack_depth) < 5) {
printk(KERN_WARNING
"FAULT_INJECTION: failed to parse arguments\n");
return 0;
@@ -34,6 +40,8 @@ int __init setup_fault_attr(struct fault
attr->interval = interval;
atomic_set(&attr->times, times);
atomic_set(&attr->space, space);
+   attr->uniquestack_depth = (uniquestack_depth <= MAX_STACK_TRACE_DEPTH) ?
+   uniquestack_depth : MAX_STACK_TRACE_DEPTH;
 
return 1;
 }
@@ -53,8 +61,6 @@ static bool fail_task(struct fault_attr 
return !in_interrupt() && task->make_it_fail;
 }
 
-#define MAX_STACK_TRACE_DEPTH 32
-
 #ifdef CONFIG_STACK_UNWIND
 
 static asmlinkage int fail_stacktrace_callback(struct unwind_frame_info *info,
@@ -85,26 +91,54 @@ static bool fail_stacktrace(struct fault
return unwind_init_running(&info, fail_stacktrace_callback, attr);
 }
 
+static asmlinkage int unique_stack_callback(struct unwind_frame_info *info,
+   void *arg)
+{
+   u32 entries[MAX_STACK_TRACE_DEPTH];
+   int depth;
+   struct fault_attr *attr = arg;
+
+   for (depth = 0; depth < attr->uniquestack_depth
+   && unwind(info) == 0 && UNW_PC(info); depth++) {
+   if (arch_unw_user_mode(info))
+   break;
+   }
+   if (attr->verbose > 8)
+   printk("%s: depth=%d, jhash=%x\n",
+  __FUNCTION__, depth,
+  jhash( entries, depth*sizeof(entries[0]), 0));
+   return jhash( entries, depth*sizeof(entries[0]), 0/*initval*/);
+}
+
+static int unique_stack_p(struct fault_attr *attr)
+{
+   struct unwind_frame_info info;
+
+   return unwind_init_ru

[PATCH 1/2 -mm] fault-injection: safer defaults, trivial optimization, cleanup

2006-11-27 Thread Don Mullis
Set /debug/fail*/* defaults supposed most likely to please a new user.
Clamp /debug/fail*/stacktrace-depth to MAX_STACK_TRACE_DEPTH.

In should_fail(), move stack-unwinding test past cheaper tests (performance
gain not quantified).  Simplify logic; eliminate goto.
Use bool/true/false consistently.

Correct and disambiguate documentation.

Signed-off-by: Don Mullis <[EMAIL PROTECTED]>
Cc: Akinobu Mita <[EMAIL PROTECTED]>
---
 Documentation/fault-injection/failmodule.sh   |4 -
 Documentation/fault-injection/fault-injection.txt |   39 +--
 include/linux/fault-inject.h  |3 
 lib/fault-inject.c|   74 +-
 mm/page_alloc.c   |2 
 mm/slab.c |1 
 6 files changed, 71 insertions(+), 52 deletions(-)

Index: linux-2.6.18/mm/slab.c
===
--- linux-2.6.18.orig/mm/slab.c
+++ linux-2.6.18/mm/slab.c
@@ -3111,6 +3111,7 @@ static struct failslab_attr {
 
 } failslab = {
.attr = FAULT_ATTR_INITIALIZER,
+   .ignore_gfp_wait = 1,
 };
 
 static int __init setup_failslab(char *str)
Index: linux-2.6.18/include/linux/fault-inject.h
===
--- linux-2.6.18.orig/include/linux/fault-inject.h
+++ linux-2.6.18/include/linux/fault-inject.h
@@ -52,12 +52,13 @@ struct fault_attr {
.times = ATOMIC_INIT(1),\
.require_end = ULONG_MAX,   \
.stacktrace_depth = 32, \
+   .verbose = 2,   \
}
 
 #define DECLARE_FAULT_ATTR(name) struct fault_attr name = 
FAULT_ATTR_INITIALIZER
 int setup_fault_attr(struct fault_attr *attr, char *str);
 void should_fail_srandom(unsigned long entropy);
-int should_fail(struct fault_attr *attr, ssize_t size);
+bool should_fail(struct fault_attr *attr, ssize_t size);
 
 #ifdef CONFIG_FAULT_INJECTION_DEBUG_FS
 
Index: linux-2.6.18/lib/fault-inject.c
===
--- linux-2.6.18.orig/lib/fault-inject.c
+++ linux-2.6.18/lib/fault-inject.c
@@ -48,11 +48,13 @@ static void fail_dump(struct fault_attr 
 
 #define atomic_dec_not_zero(v) atomic_add_unless((v), -1, 0)
 
-static int fail_task(struct fault_attr *attr, struct task_struct *task)
+static bool fail_task(struct fault_attr *attr, struct task_struct *task)
 {
return !in_interrupt() && task->make_it_fail;
 }
 
+#define MAX_STACK_TRACE_DEPTH 32
+
 #ifdef CONFIG_STACK_UNWIND
 
 static asmlinkage int fail_stacktrace_callback(struct unwind_frame_info *info,
@@ -68,15 +70,15 @@ static asmlinkage int fail_stacktrace_ca
break;
if (attr->reject_start <= UNW_PC(info) &&
   UNW_PC(info) < attr->reject_end)
-   return 0;
+   return false;
if (attr->require_start <= UNW_PC(info) &&
   UNW_PC(info) < attr->require_end)
-   found = 1;
+   found = true;
}
return found;
 }
 
-static int fail_stacktrace(struct fault_attr *attr)
+static bool fail_stacktrace(struct fault_attr *attr)
 {
struct unwind_frame_info info;
 
@@ -85,9 +87,7 @@ static int fail_stacktrace(struct fault_
 
 #elif defined(CONFIG_STACKTRACE)
 
-#define MAX_STACK_TRACE_DEPTH 32
-
-static int fail_stacktrace(struct fault_attr *attr)
+static bool fail_stacktrace(struct fault_attr *attr)
 {
struct stack_trace trace;
int depth = attr->stacktrace_depth;
@@ -100,8 +100,7 @@ static int fail_stacktrace(struct fault_
 
trace.nr_entries = 0;
trace.entries = entries;
-   trace.max_entries = (depth < MAX_STACK_TRACE_DEPTH) ?
-   depth : MAX_STACK_TRACE_DEPTH;
+   trace.max_entries = depth;
trace.skip = 1;
trace.all_contexts = 0;
 
@@ -109,26 +108,26 @@ static int fail_stacktrace(struct fault_
for (n = 0; n < trace.nr_entries; n++) {
if (attr->reject_start <= entries[n] &&
   entries[n] < attr->reject_end)
-   return 0;
+   return false;
if (attr->require_start <= entries[n] &&
   entries[n] < attr->require_end)
-   found = 1;
+   found = true;
}
return found;
 }
 
 #else
 
-static inline int fail_stacktrace(struct fault_attr *attr)
+static inline bool fail_stacktrace(struct fault_attr *attr)
 {
-   static int firsttime = 1;
+   static bool firsttime = true;
 
if (firsttime) 

Re: [patch] Re: 2.6.19-rc6-mm1 -- sched-improve-migration-accuracy.patch slows boot

2006-11-27 Thread Don Mullis
> The below should fix it, can you confirm?

Brings boot speed back to normal.

Acked-by: Don Mullis <[EMAIL PROTECTED]>


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/


Re: 2.6.19-rc6-mm1 -- sched-improve-migration-accuracy.patch slows boot

2006-11-26 Thread Don Mullis
> This must be a bisection false positive.  The patch in question is
> essentially a no-op for a UP kernel.

Testing alternately with 
1) all -mm1 patches applied, and 
2) all except sched-improve-migration-accuracy*.path applied,
confirms the misbehavior.


-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/