public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Re: linux-2.6.23 - acting funny
@ 2007-10-11 12:09 Helmut Toplizer
  2007-10-11 22:53 ` poison
  0 siblings, 1 reply; 5+ messages in thread
From: Helmut Toplizer @ 2007-10-11 12:09 UTC (permalink / raw)
  To: poison; +Cc: linux-kernel

[-- Attachment #1: Type: text/plain, Size: 743 bytes --]

Hi!

I had similar behavior in the kernel releases since I can think of.
(You may find some reports about at
http://marc.info/?a=113508574400006&r=1&w=2)

Maybe your problem is similar.

Here's what have been found out:
Plugin of ehci devices causes some strange DMA thing
which causes delays because of the CPU HLT instruction.
(DMA are handled with delays on HLT)

Possible fixes:
1) Kernel parameter: idle=poll
    Disables HLT and causes heat up and noise from the cpu

2) Don't insert EHCI-USB devices

3) Patch: attached, try out at your own risk.
    you need to add a kernel-boot parameter "disableviahlt"
   (You've got a via-chipset, right?)

Please report back to me if 1/2 works or to linux-ide if the patch works. 
Thanks

Helmut

[-- Attachment #2: 02_hlt_dma_patch.diff --]
[-- Type: text/x-diff, Size: 1895 bytes --]

--- kernel/drivers/ide/ide-dma.c	2006-08-20 11:31:53.000000000 +0200
+++ kernel/drivers/ide/ide-dma.c	2006-08-20 11:40:43.000000000 +0200
@@ -89,6 +89,57 @@
 #include <asm/io.h>
 #include <asm/irq.h>
 
+
+/* Some VIA boards show strange slowdown when HLT is eanbled  */
+/* So we disable the HLT during a IDE-DMA transfer.           */
+/* You need to pass disableviahlt at boottime to enable this  */
+/* workaround.                                                */
+#if defined(HAVE_DISABLE_HLT)
+
+static DEFINE_SPINLOCK(ide_hlt_lock);
+static int hlt_disabled;
+static int disableviahlt;
+static void ide_disable_hlt(void)
+{
+	unsigned long flags;
+	
+	spin_lock_irqsave(&ide_hlt_lock, flags);
+	if(disableviahlt) {
+		hlt_disabled++ ;
+		disable_hlt();
+	}
+	spin_unlock_irqrestore(&ide_hlt_lock, flags);
+}
+
+static void ide_enable_hlt(void)
+{
+	unsigned long flags;
+
+	spin_lock_irqsave(&ide_hlt_lock, flags);
+	if(hlt_disabled && disableviahlt){
+		hlt_disabled--;
+		enable_hlt();
+	}
+	spin_unlock_irqrestore(&ide_hlt_lock, flags);
+}
+
+static int __init disable_via_hlt(char *str)
+{
+    printk(KERN_WARNING "DISABLE VIA HLT  activated\n");
+    disableviahlt = 1;
+    return 1;
+}
+
+__setup("disableviahlt", disable_via_hlt);
+
+
+#else  /* HAVE_DISABLE_HLT */
+inline static void ide_disable_hlt(void)
+{}
+inline static void ide_enable_hlt(void)
+{}
+#endif /* HAVE_DISABLE_HLT */
+
 static const struct drive_list_entry drive_whitelist [] = {
 
 	{ "Micropolis 2112A"	,       "ALL"		},
@@ -301,6 +352,7 @@
 	if (count) {
 		if (!is_trm290)
 			*--table |= cpu_to_le32(0x80000000);
+		ide_disable_hlt();
 		return count;
 	}
 	printk(KERN_ERR "%s: empty DMA table?\n", drive->name);
@@ -332,6 +384,7 @@
 	int nents = HWIF(drive)->sg_nents;
 
 	pci_unmap_sg(dev, sg, nents, HWIF(drive)->sg_dma_direction);
+	ide_enable_hlt();
 }
 
 EXPORT_SYMBOL_GPL(ide_destroy_dmatable);

^ permalink raw reply	[flat|nested] 5+ messages in thread
* linux-2.6.23 - acting funny
@ 2007-10-11  2:30 poison
  0 siblings, 0 replies; 5+ messages in thread
From: poison @ 2007-10-11  2:30 UTC (permalink / raw)
  To: linux-kernel; +Cc: Ingo Molnar

[-- Attachment #1: Type: text/plain, Size: 800 bytes --]

Hi :)
I have two harddisks with encfs on top of reiserfs between which I could copy 
data at ~22MB/s before the upgrade from 2.6.22 to 2.6.23. 
After the upgrade the transfer rate stuck at ~14MB/s and changing nice values 
did not help anything.

And now the funny part: 
I noticed the transfer rate go up to ~20MB/s when I startet compiling stuff. 
I just need to run a CPU hog like:
  while true; do echo test > /dev/null; done
and the transfer rate jumps from ~14MB/s to ~20MB/s.

top shows the two encfs processes with ~30%(read) and 50%(write) CPU usage no 
matter if I run the CPU hog or not.

Could this eventually be due to the new scheduler? Do I need to tune anything?

System: E6600, 4GB RAM, Slackware 12, config attached.
Do you need anything else?

PS: please CC me, I'm not subscribed

[-- Attachment #2: config.gz --]
[-- Type: application/x-gzip, Size: 12696 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-10-14 20:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-10-11 12:09 linux-2.6.23 - acting funny Helmut Toplizer
2007-10-11 22:53 ` poison
2007-10-12  6:05   ` Ingo Molnar
2007-10-14 20:55     ` poison
  -- strict thread matches above, loose matches on Subject: below --
2007-10-11  2:30 poison

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox