All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 1/2] scsi: Add scsi_device max_cmd_len
From: Stefan Richter @ 2006-04-01 10:31 UTC (permalink / raw)
  To: Jeff Garzik
  Cc: Christoph Hellwig, Brian King, James.Bottomley, linux-ide,
	linux-scsi
In-Reply-To: <442B15F4.30506@pobox.com>

Jeff Garzik wrote on 2006-03-30:
> James Bottomley wrote:
>> This really doesn't look correct.  What you want is a sata transport
>> class with a max command length in the host device.
> 
> Christoph Hellwig wrote:
>> this sounds wrong to me.  cdb length is a limitation of the host 
>> (driver).
>> A target will reject unknown commands, no matter what length they have.
> 
> In practice, CDB length may be limited by both the host and the device. 
>  This applies to ATAPI, and some USB storage too IIRC.  For ATAPI, you 
> read the CDB length from the device's IDENTIFY PACKET DEVICE info page.

BTW, in case of SBP-2 devices, the CDB length is a property of the 
logical unit and is read from the IEEE 1394 node's configuration ROM. 
Linux' sbp2 driver implements only a CDB length of 12 bytes though.
-- 
Stefan Richter
-=====-=-==- -=-- ----=
http://arcgraph.de/sr/

^ permalink raw reply

* Re: [PATCH] ia64 build fixes
From: Keir Fraser @ 2006-04-01 10:10 UTC (permalink / raw)
  To: Alex Williamson; +Cc: xen-devel, xen-ia64-devel
In-Reply-To: <1143848687.18506.39.camel@localhost>


On 1 Apr 2006, at 00:44, Alex Williamson wrote:

>    Include features header in xenbus_probe and build features.c
>
> Signed-off-by: Alex Williamson <alex.williamson@hp.com>

Taken, thanks. Can you also look at supporting HYPERVISOR_sched_op() 
before 3.0.2, in addition to the old HYPERVISOR_sched_op_compat()? It 
should be pretty trivial to do. You'd want to base the patch on a tree 
after changeset 9510, as I internally rename sched_op/sched_op_new in 
that patch.

After 3.0.2 we'll be removing the fallback to sched_op_compat in the 
Linux tree (it's fairly pointless as we broke compatibility of new 
guest on old Xen in other ways too since 3.0.1). If we do that before 
you add support for the new hypercall, we'll break ia64.

  -- Keir

^ permalink raw reply

* OOPS 2.6.16 and 2.6.16-git14
From: Erik Slagter @ 2006-04-01 10:04 UTC (permalink / raw)
  To: linux-acpi, linux-kernel

> I get a kernel OOPS using 2.6.16 and 2.6.16-git14, I was using 2.6.14.2
> before without the problem.
> 
> The OOPS happens when doing either
> 
> echo "3" > /proc/acpi/sleep
> 
> or
> 
> echo "mem" > /sys/power/state
> 
> As I have a laptop without serial ports, I'd have to write down the
> oops, so please forgive that I didn't write down ALL the output, I think
> I have the most important stuff, though.
> 
> Please note that it also happens when mentioned modules are not linked
> in and that I enabled the kernel read-only pages option (although that
> doesn't seem to be related).
> 
> I am not subscribed, so please CC.

Currently I cannot reproduce this, this may have to do with:

 - moved pl2303 adapter from one usb2 hub to another because kernel
barfed about it and that solved the barfing
 - compiled various versions of the kernel so many times, I lost track
of the exact config
 - different usb hub and perifs at home and at work.

As soon as I can reproduce the issue, I'll file a proper bug report
including photographs of the output.

Thanks for your time and effort.

^ permalink raw reply

* [Qemu-devel] [PATCH] destdir support
From: Patrick Mauritz @ 2006-04-01  9:56 UTC (permalink / raw)
  To: qemu-devel

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

Hi,

the attached patch adds DESTDIR at the right places in the makefile,
which is suitable for packaging (build with --prefix=/usr, install
with make install DESTDIR=/foo, then you have the resulting tree in
/foo/usr/...)


patrick mauritz

[-- Attachment #2: 20060401-destdir.patch --]
[-- Type: text/x-patch, Size: 2132 bytes --]

# 
# 
# patch "Makefile"
#  from [24ce1c8e1082fb804f509f5fd27617f226893745]
#    to [7249eece15dfa3b0c06aa0d0f2b916214fbe9226]
# 
# patch "Makefile.target"
#  from [556cc7e70656a74d391e395e641eafed16ed2c88]
#    to [b414edd14d60c4dc7d00a55d38616613c83ff1b7]
# 
============================================================
--- Makefile	24ce1c8e1082fb804f509f5fd27617f226893745
+++ Makefile	7249eece15dfa3b0c06aa0d0f2b916214fbe9226
@@ -44,21 +44,21 @@
 common  de-ch  es     fo  fr-ca  hu     ja  mk  nl-be      pt  sl     tr
 
 install: all 
-	mkdir -p "$(bindir)"
-	install -m 755 -s $(TOOLS) "$(bindir)"
-	mkdir -p "$(datadir)"
+	mkdir -p "$(DESTDIR)$(bindir)"
+	install -m 755 -s $(TOOLS) "$(DESTDIR)$(bindir)"
+	mkdir -p "$(DESTDIR)$(datadir)"
 	install -m 644 pc-bios/bios.bin pc-bios/vgabios.bin \
                        pc-bios/vgabios-cirrus.bin \
                        pc-bios/ppc_rom.bin pc-bios/video.x \
                        pc-bios/proll.elf \
-                       pc-bios/linux_boot.bin "$(datadir)"
-	mkdir -p "$(docdir)"
-	install -m 644 qemu-doc.html  qemu-tech.html "$(docdir)"
+                       pc-bios/linux_boot.bin "$(DESTDIR)$(datadir)"
+	mkdir -p "$(DESTDIR)$(docdir)"
+	install -m 644 qemu-doc.html  qemu-tech.html "$(DESTDIR)$(docdir)"
 ifndef CONFIG_WIN32
-	mkdir -p "$(mandir)/man1"
-	install qemu.1 qemu-img.1 "$(mandir)/man1"
-	mkdir -p "$(datadir)/keymaps"
-	install -m 644 $(addprefix keymaps/,$(KEYMAPS)) "$(datadir)/keymaps"
+	mkdir -p "$(DESTDIR)$(mandir)/man1"
+	install qemu.1 qemu-img.1 "$(DESTDIR)$(mandir)/man1"
+	mkdir -p "$(DESTDIR)$(datadir)/keymaps"
+	install -m 644 $(addprefix keymaps/,$(KEYMAPS)) "$(DESTDIR)$(datadir)/keymaps"
 endif
 	for d in $(TARGET_DIRS); do \
 	$(MAKE) -C $$d $@ || exit 1 ; \
============================================================
--- Makefile.target	556cc7e70656a74d391e395e641eafed16ed2c88
+++ Makefile.target	b414edd14d60c4dc7d00a55d38616613c83ff1b7
@@ -469,7 +469,7 @@
 
 install: all 
 ifneq ($(PROGS),)
-	install -m 755 -s $(PROGS) "$(bindir)"
+	install -m 755 -s $(PROGS) "$(DESTDIR)$(bindir)"
 endif
 
 ifneq ($(wildcard .depend),)

^ permalink raw reply

* Re: Handling devices that don't have a bus
From: Russell King @ 2006-04-01  9:47 UTC (permalink / raw)
  To: Alan Stern; +Cc: Greg KH, David Brownell, Kernel development list
In-Reply-To: <Pine.LNX.4.44L0.0603301520330.4652-100000@iolanthe.rowland.org>

On Thu, Mar 30, 2006 at 03:45:50PM -0500, Alan Stern wrote:
> I recently tried running the dummy_hcd driver for the first time in a 
> while, and it crashed when the gadget driver was unloaded.  It turns out 
> this was because the gadget's embedded struct device is registered without 
> a bus, which triggers an oops when the device's driver is unbound.  The 
> oops could be fixed by doing this:

Can you provide the oops itself please?

> Part of the problem here is that most of the USB controllers are platform
> devices and so belong on the platform bus.

You're making a connection where no such connection exists.  Devices
are only part of the platform bus if they explicitly want to be (in
much the same way that devices are only part of the PCI bus if they
explicitly set dev->bus to be the PCI bus.)

> But struct usb_gadget contains an embedded struct device, not an embedded
> struct platform_device... so the gadget _can't_ be registered on its 
> parent's bus.

>From what I can see, the embedded device does not belong to any bus at
all since dev->bus is NULL.  Hence, I don't think it's the embedded
struct device which is causing the problem here.

It would be good to see the entire oops to see what's going on.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

^ permalink raw reply

* [PATCH/RFC] libata-dev: handle DRQ=1 ERR=1 (revised)
From: Albert Lee @ 2006-04-01  9:38 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide@vger.kernel.org
In-Reply-To: <442E4444.1050806@tw.ibm.com>

Handle DRQ=1 ERR=1 situation. Revised according to what IDE try_to_flush_leftover_data() does.

Changes:
 - For ATA PIO writes and ATAPI devices, just stop the HSM and let EH handle it.
 - For ATA PIO reads, read only one block of junk data and then let EH handle it.

Signed-off-by: Albert Lee <albertcc@tw.ibm.com>
---
Thanks for the IDE try_to_flush_leftover_data() pointer.
The difference between IDE and irq-pio (before this patch):
 1. IDE only does the data transfer for PIO reads.
    For PIO writes and ATAPI, it just stops and abort/reset.
 2. For PIO reads, only one block of data is transferred. EH then takes over if DRQ is still set after that.
    The behavior of irq-pio before this patch is: let HSM go on, until the device set DRQ=0 or all data read.

Te IDE behavior looks safer. (When the device is in bad status, we really should not
write any data to it.)

Patch against irq-pio branch (08a556db919f67e1e4d33ae8d40f7222da34d994).
For your review, thanks.

--- irq-pio0/drivers/scsi/libata-core.c	2006-04-01 10:34:59.000000000 +0800
+++ irq-pio-drq/drivers/scsi/libata-core.c	2006-04-01 17:09:00.000000000 +0800
@@ -3651,13 +3651,16 @@ fsm_start:
 
 		/* Device should not ask for data transfer (DRQ=1)
 		 * when it finds something wrong.
-		 * Anyway, we respect DRQ here and let HSM go on
-		 * without changing hsm_task_state to HSM_ST_ERR.
+		 * We ignore DRQ here and stop the HSM by
+		 * changing hsm_task_state to HSM_ST_ERR and
+		 * let the EH abort the command or reset the device.
 		 */
 		if (unlikely(status & (ATA_ERR | ATA_DF))) {
 			printk(KERN_WARNING "ata%d: DRQ=1 with device error, dev_stat 0x%X\n",
 			       ap->id, status);
 			qc->err_mask |= AC_ERR_DEV;
+			ap->hsm_task_state = HSM_ST_ERR;
+			goto fsm_start;
 		}
 
 		/* Send the CDB (atapi) or the first data block (ata pio out).
@@ -3704,13 +3707,16 @@ fsm_start:
 
 			/* Device should not ask for data transfer (DRQ=1)
 			 * when it finds something wrong.
-			 * Anyway, we respect DRQ here and let HSM go on
-			 * without changing hsm_task_state to HSM_ST_ERR.
+			 * We ignore DRQ here and stop the HSM by
+			 * changing hsm_task_state to HSM_ST_ERR and
+			 * let the EH abort the command or reset the device.
 			 */
 			if (unlikely(status & (ATA_ERR | ATA_DF))) {
 				printk(KERN_WARNING "ata%d: DRQ=1 with device error, dev_stat 0x%X\n",
 				       ap->id, status);
 				qc->err_mask |= AC_ERR_DEV;
+				ap->hsm_task_state = HSM_ST_ERR;
+				goto fsm_start;
 			}
 
 			atapi_pio_bytes(qc);
@@ -3728,20 +3734,32 @@ fsm_start:
 				goto fsm_start;
 			}
 
-			/* Some devices may ask for data transfer (DRQ=1)
-			 * alone with ERR=1 for PIO reads.
-			 * We respect DRQ here and let HSM go on without
-			 * changing hsm_task_state to HSM_ST_ERR.
+			/* For PIO reads, some devices may ask for
+			 * data transfer (DRQ=1) alone with ERR=1.
+			 * We respect DRQ here and transfer one
+			 * block of junk data before changing the
+			 * hsm_task_state to HSM_ST_ERR.
+			 *
+			 * For PIO writes, ERR=1 DRQ=1 doesn't make
+			 * sense since the data block has been
+			 * transferred to the device.
 			 */
 			if (unlikely(status & (ATA_ERR | ATA_DF))) {
-				/* For writes, ERR=1 DRQ=1 doesn't make
-				 * sense since the data block has been
-				 * transferred to the device.
-				 */
-				WARN_ON(qc->tf.flags & ATA_TFLAG_WRITE);
-
 				/* data might be corrputed */
 				qc->err_mask |= AC_ERR_DEV;
+
+				if (!(qc->tf.flags & ATA_TFLAG_WRITE)) {
+					ata_pio_sectors(qc);
+					ata_altstatus(ap);
+					status = ata_wait_idle(ap);
+				}
+
+				/* ata_pio_sectors() might change the
+				 * state to HSM_ST_LAST. so, the state
+				 * is changed after ata_pio_sectors().
+				 */
+				ap->hsm_task_state = HSM_ST_ERR;
+				goto fsm_start;
 			}
 
 			ata_pio_sectors(qc);



^ permalink raw reply

* Re: Handling devices that don't have a bus
From: Russell King @ 2006-04-01  9:38 UTC (permalink / raw)
  To: Greg KH; +Cc: Alan Stern, David Brownell, Kernel development list
In-Reply-To: <20060330222626.GA18633@kroah.com>

On Thu, Mar 30, 2006 at 02:26:26PM -0800, Greg KH wrote:
> On Thu, Mar 30, 2006 at 03:45:50PM -0500, Alan Stern wrote:
> > Greg et al.:
> > 
> > I recently tried running the dummy_hcd driver for the first time in a 
> > while, and it crashed when the gadget driver was unloaded.  It turns out 
> > this was because the gadget's embedded struct device is registered without 
> > a bus, which triggers an oops when the device's driver is unbound.  The 
> > oops could be fixed by doing this:
> 
> Why not make the dummy gadget a platform device?  That should keep this
> from happening, right?
> 
> > Index: usb-2.6/drivers/base/dd.c
> > ===================================================================
> > --- usb-2.6.orig/drivers/base/dd.c
> > +++ usb-2.6/drivers/base/dd.c
> > @@ -209,7 +209,7 @@ static void __device_release_driver(stru
> >  		sysfs_remove_link(&dev->kobj, "driver");
> >  		klist_remove(&dev->knode_driver);
> >  
> > -		if (dev->bus->remove)
> > +		if (dev->bus && dev->bus->remove)
> >  			dev->bus->remove(dev);
> >  		else if (drv->remove)
> >  			drv->remove(dev);
> > 
> > but I'm not so sure this is the right approach.  (Russell wrote the line 
> > that this would change; that's why I have CC'ed him.)  Is the current 
> > policy that every device is supposed to belong to a bus?

If a device belongs to a bus, dev->bus will be non-NULL.  I don't see
what "every device is supposed to belong to a bus" fits with the problem.

> > Part of the problem here is that most of the USB controllers are platform
> > devices and so belong on the platform bus.  That's true of dummy_hcd.  
> > But struct usb_gadget contains an embedded struct device, not an embedded
> > struct platform_device... so the gadget _can't_ be registered on its 
> > parent's bus.
> 
> ah, ick :(

If the device's dev->bus is NULL, we don't register it on the parents
bus, but we do register it in the device tree as a child of the parent
device.

I think there's confusion here.

> I think your patch is the right thing.  Care to resend it with a proper
> Signed-off-by: line so I can apply it?

First lets sort out the confusion before applying any patches.

-- 
Russell King
 Linux kernel    2.6 ARM Linux   - http://www.arm.linux.org.uk/
 maintainer of:  2.6 Serial core

^ permalink raw reply

* Re: [RFC][patch] console_flush()
From: Keir Fraser @ 2006-04-01  9:32 UTC (permalink / raw)
  To: Jimi Xenidis; +Cc: xen-devel
In-Reply-To: <0224EBCD-1722-4ECE-8CFF-16086F62A3A3@watson.ibm.com>


On 31 Mar 2006, at 20:24, Jimi Xenidis wrote:

> It occurs to me that since console_sync_start/stop use ++ and -- 
> respectively, that it was designed to be "nested" and bracket code 
> segments.  If this is indeed desirable than perhaps we need another 
> interface that simply flushed the console.
> The only real use I can see for it is to flush after the panic message 
> rather than using console_sync_start() before it.

It's designed to be nestable, but it doesn't have to be used that way. 
The only argument for a new interface function is if we thought its 
name and use were significantly less confusing or weird, which I don't 
think is the case here. I also like the current strategy of switching 
to synchronous console mode *before* writing the critical info you care 
about, rather than flushing it after, although I suppose it doesn't 
really matter much either way.

  -- Keir

^ permalink raw reply

* Re: [patch 2.6.16-mm2 9/9] sched throttle tree extract - export tunables
From: Mike Galbraith @ 2006-04-01  9:31 UTC (permalink / raw)
  To: Ingo Molnar, Andrew Morton; +Cc: lkml, Peter Williams, Nick Piggin, Con Kolivas
In-Reply-To: <1143883607.7617.71.camel@homer>

This patch is a convenience for people testing this patch series.  It
exports throttling tunables to userland, and is utterly disposable.

Signed-off-by: Mike Galbraith <efault@gmx.de>

--- linux-2.6.16-mm2/include/linux/sysctl.h.org	2006-03-31 11:25:16.000000000 +0200
+++ linux-2.6.16-mm2/include/linux/sysctl.h	2006-03-31 14:08:28.000000000 +0200
@@ -148,6 +148,8 @@ enum
 	KERN_SPIN_RETRY=70,	/* int: number of spinlock retries */
 	KERN_ACPI_VIDEO_FLAGS=71, /* int: flags for setting up video after ACPI sleep */
 	KERN_IA64_UNALIGNED=72, /* int: ia64 unaligned userland trap enable */
+	KERN_SCHED_THROTTLE1=73,  /* int: throttling credit period 1 in secs */
+	KERN_SCHED_THROTTLE2=74,  /* int: throttling credit period 2 in secs */
 };
 
 
--- linux-2.6.16-mm2/kernel/sysctl.c.org	2006-03-31 11:24:50.000000000 +0200
+++ linux-2.6.16-mm2/kernel/sysctl.c	2006-03-31 14:08:28.000000000 +0200
@@ -73,6 +73,9 @@ extern int printk_ratelimit_burst;
 extern int pid_max_min, pid_max_max;
 extern int sysctl_drop_caches;
 extern int percpu_pagelist_fraction;
+extern int credit_c1;
+extern int credit_c2;
+extern int credit_max;
 
 #if defined(CONFIG_X86_LOCAL_APIC) && defined(CONFIG_X86)
 int unknown_nmi_panic;
@@ -230,6 +233,11 @@ static ctl_table root_table[] = {
 	{ .ctl_name = 0 }
 };
 
+/* Constants for minimum and maximum testing in vm_table and
+ * kern_table.  We use these as one-element integer vectors. */
+static int zero;
+static int one_hundred = 100;
+
 static ctl_table kern_table[] = {
 	{
 		.ctl_name	= KERN_OSTYPE,
@@ -684,15 +692,31 @@ static ctl_table kern_table[] = {
 		.proc_handler	= &proc_dointvec,
 	},
 #endif
+	{
+		.ctl_name	= KERN_SCHED_THROTTLE1,
+		.procname	= "credit_c1",
+		.data		= &credit_c1,
+		.maxlen		= sizeof (int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec_minmax,
+		.strategy	= &sysctl_intvec,
+		.extra1		= &zero,
+		.extra2		= &credit_max,
+	},
+	{
+		.ctl_name	= KERN_SCHED_THROTTLE2,
+		.procname	= "credit_c2",
+		.data		= &credit_c2,
+		.maxlen		= sizeof (int),
+		.mode		= 0644,
+		.proc_handler	= &proc_dointvec_minmax,
+		.strategy	= &sysctl_intvec,
+		.extra1		= &zero,
+		.extra2		= &credit_max,
+	},
 	{ .ctl_name = 0 }
 };
 
-/* Constants for minimum and maximum testing in vm_table.
-   We use these as one-element integer vectors. */
-static int zero;
-static int one_hundred = 100;
-
-
 static ctl_table vm_table[] = {
 	{
 		.ctl_name	= VM_OVERCOMMIT_MEMORY,
--- linux-2.6.16-mm2/kernel/sched.c-8.slice_accounting	2006-03-24 09:40:33.000000000 +0100
+++ linux-2.6.16-mm2/kernel/sched.c	2006-03-24 09:51:06.000000000 +0100
@@ -220,11 +220,12 @@ static int task_interactive_idle(task_t 
  *           credit that fits in 32 bits jiffies is 42949 seconds.
  */
 
-#define CREDIT_C1 10
-#define CREDIT_C2 14400
+int credit_c1 = 10;
+int credit_c2 = 14400;
+int credit_max = 42949;
 
-#define C1 (CREDIT_C1 * MAX_BONUS * HZ)
-#define C2 (CREDIT_C2 * MAX_BONUS * HZ + C1)
+#define C1 (credit_c1 * MAX_BONUS * HZ)
+#define C2 (credit_c2 * MAX_BONUS * HZ + C1)
 #define C3 (MAX_BONUS * C2)
 
 #define credit_exhausted(p, credit) \



^ permalink raw reply

* Re: [patch] make evtchn_upcall_pending arch-specific type
From: Keir Fraser @ 2006-04-01  9:30 UTC (permalink / raw)
  To: Jimi Xenidis; +Cc: xen-devel, Hollis Blanchard, xen-ppc-devel
In-Reply-To: <5BD25DCF-992A-4C95-B349-622F213EA4F4@watson.ibm.com>


On 1 Apr 2006, at 04:55, Jimi Xenidis wrote:

>> Before going down this route, what about just casting the field to 
>> long, since it is actually aligned on a suitable boundary, as it 
>> happens?
>
> We tried that, but to get the right bit we would have to use 56 not 0.

Actually, evtchn_upcall_pending is touched in very few places in Xen 
common code. Using bit 56 is not very pretty but should be easy to hide 
behind a macro? You can hide the cast to long inside the same macro. 
You already need to arch-dep the event_pending() macro, for your MSR.EE 
check, and that's one of the main ways in which common code accesses 
the pending flag.

Would that be nicer than adding another one-shot typedef in the public 
headers and bloating a struct on PPC?

  -- Keir

^ permalink raw reply

* Re: [patch 2.6.16-mm2 8/9] sched throttle tree extract - maximize timeslice accounting
From: Mike Galbraith @ 2006-04-01  9:26 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Andrew Morton, lkml, Peter Williams, Nick Piggin, Con Kolivas
In-Reply-To: <1143883385.7617.66.camel@homer>

This patch maximizes time slice accounting.  A task which receives too
much CPU time due to missing the timer interrupt will have the excess
deducted from it's next slice.

Signed-off-by: Mike Galbraith <efault@gmx.de>

--- linux-2.6.16-mm2/kernel/sched.c-7.implement_throttle	2006-03-24 09:36:08.000000000 +0100
+++ linux-2.6.16-mm2/kernel/sched.c	2006-03-24 09:40:33.000000000 +0100
@@ -2966,13 +2966,28 @@ static void refresh_timeslice(task_t *p)
 	unsigned int slice = last_slice(p);
 	unsigned int slice_avg, cpu, idle;
 	long run_time = -1 * p->slice_time_ns;
+	long slice_time_ns = task_timeslice_ns(p);
 	int w = MAX_BONUS, delta, bonus;
 
 	/*
-	 * Update time_slice.
+	 * Update time_slice.  Account for unused fragment,
+	 * or excess time received due to missed tick.
 	 */
-	p->slice_time_ns = task_timeslice_ns(p);
-	p->time_slice = task_timeslice(p);
+	p->slice_time_ns += slice_time_ns;
+	/*
+	 * Not common, but this does happen on SMP systems.
+	 * Timeslice theft of this magnitude has never been
+	 * observed in the wild, so assume that this is BS,
+	 * and give the poor task it's full slice.  Theory:
+	 * mostly idle task migrates between CPUs numerous
+	 * times during it's slice, timestamp rounding leads
+	 * to wildly inaccurate calculation.  Rounding has
+	 * maximum effect on those who stretch their slice,
+	 * but is also fairly meaningless, so ignore it.
+	 */
+	if (unlikely(p->slice_time_ns < NS_TICK))
+		p->slice_time_ns = slice_time_ns;
+	p->time_slice = NS_TO_JIFFIES(p->slice_time_ns);
 	set_last_slice(p, p->time_slice);
 
 	/*



^ permalink raw reply

* Re: OSS emulation question
From: Adrian McMenamin @ 2006-04-01  9:25 UTC (permalink / raw)
  To: Clemens Ladisch; +Cc: alsa-devel
In-Reply-To: <20060331093731.GB21761@turing.informatik.uni-halle.de>

On Fri, 2006-03-31 at 11:37 +0200, Clemens Ladisch wrote:
> Adrian McMenamin wrote:
> > On Thu, 2006-03-30 at 14:55 +0200, Clemens Ladisch wrote:
> > > See snd_mixer_oss_build() in core/oss/mixer_oss.c for a list of mixer
> > > control names that get mapped to OSS controls (e.g., "Master Playback
> > > Volume"/"...Switch" would be mapped to SOUND_MIXER_VOLUME).
> > 
> > I have implemented master volume and master switch but all I get is:
> > 
> > audio/gain: setable Volume/PCM-Level not supported by your audio device:
> > 0000
> > 
> > what is the minimum set of controls I need to have settable volume
> > in /dev/mixer (ie oss emulation)?
> 
> One control should be enough.
> 
> What are the contents of /proc/asound/cardX/oss_mixer?

Doesn't look good....


/proc/asound/card0 # cat oss_mixer
VOLUME "" 0
BASS "" 0
TREBLE "" 0
SYNTH "" 0
PCM "" 0
SPEAKER "" 0
LINE "" 0
MIC "" 0
CD "" 0
IMIX "" 0
ALTPCM "" 0
RECLEV "" 0
IGAIN "" 0
OGAIN "" 0
LINE1 "" 0
LINE2 "" 0
LINE3 "" 0
DIGITAL1 "" 0
DIGITAL2 "" 0
DIGITAL3 "" 0
PHONEIN "" 0
PHONEOUT "" 0
VIDEO "" 0
RADIO "" 0
MONITOR "" 0





-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

^ permalink raw reply

* Re: [patch 2.6.16-mm2 7/9] sched throttle tree extract - implement throttling
From: Mike Galbraith @ 2006-04-01  9:23 UTC (permalink / raw)
  To: Ingo Molnar, Andrew Morton; +Cc: lkml, Peter Williams, Nick Piggin, Con Kolivas
In-Reply-To: <1143882731.7617.55.camel@homer>

This patch implements task throttling.  In order to determine whether a
task needs throttling, compute slice_avg, which is the upper limit a
task's sleep_avg can be and be sane.  A task which consumes no more than
what is expected accrues CPU credit, which may be used later, on a slice
by slice basis.  This allows interactive tasks to perform in high cpu
usage bursts, yet we retain control over their long term cpu usage.  A
task which exhausts it's earned credit will have it's sleep_avg trimmed,
and consequently it's priority trimmed to match it's actual cpu usage.

Signed-off-by: Mike Galbraith <efault@gmx.de>

--- linux-2.6.16-mm2/include/linux/sched.h.org	2006-02-28 06:11:17.000000000 +0100
+++ linux-2.6.16-mm2/include/linux/sched.h	2006-02-28 06:11:41.000000000 +0100
@@ -736,14 +736,14 @@ struct task_struct {
 	unsigned short ioprio;
 	unsigned int btrace_seq;
 
-	unsigned long sleep_avg;
+	unsigned long sleep_avg, last_slice, throttle;
 	unsigned long long timestamp, last_ran;
 	unsigned long long sched_time; /* sched_clock time spent running */
 	enum sleep_type sleep_type;
 
 	unsigned long policy;
 	cpumask_t cpus_allowed;
-	unsigned int time_slice, first_time_slice;
+	unsigned int time_slice, slice_info;
 	long slice_time_ns;
 
 #ifdef CONFIG_SCHEDSTATS
--- linux-2.6.16-mm2/kernel/sched.c-6.move_division	2006-03-23 15:18:48.000000000 +0100
+++ linux-2.6.16-mm2/kernel/sched.c	2006-03-23 16:28:04.000000000 +0100
@@ -80,6 +80,21 @@
 #define NS_TO_JIFFIES(TIME)	((TIME) / (1000000000 / HZ))
 #define JIFFIES_TO_NS(TIME)	((TIME) * (1000000000 / HZ))
 
+#if (BITS_PER_LONG < 64)
+#define JIFFIES_TO_NS64(TIME) \
+	((unsigned long long)(TIME) * ((unsigned long) (1000000000 / HZ)))
+
+#define NS64_TO_JIFFIES(TIME) \
+	((((unsigned long long)((TIME)) >> BITS_PER_LONG) * \
+	(1 + NS_TO_JIFFIES(~0UL))) + NS_TO_JIFFIES((unsigned long)(TIME)))
+#else /* BITS_PER_LONG < 64 */
+
+#define NS64_TO_JIFFIES(TIME) NS_TO_JIFFIES(TIME)
+#define JIFFIES_TO_NS64(TIME) JIFFIES_TO_NS(TIME)
+
+#endif /* BITS_PER_LONG < 64 */
+
+
 /*
  * These are the 'tuning knobs' of the scheduler:
  *
@@ -177,6 +192,115 @@ static int task_interactive_idle(task_t 
 	return p->sleep_avg + sleep_time >= INTERACTIVE_SLEEP_AVG(p);
 }
 
+/*
+ * Interactive boost can lead to starvation if the decision to
+ * boost a task turns out to be a bad one.  To combat this, we
+ * compute the sane upper limit for cpu usage 'slice_avg' based
+ * upon a task's sleep_avg, and use this information combined
+ * with a timer to determine when intervention is required.
+ *
+ * When a task is behaving as it's sleep_avg indicates it should,
+ * it's throttle is moved forward, otherwise it will timeout, and
+ * the task's priority will be lowered.
+ *
+ * Throttling tunables.
+ *
+ * CREDIT_C1: The amount of cpu time in seconds that a new task
+ *           will run completely free, ie the head start a task
+ *           has before it has to push it's timer forward to avoid
+ *           being throttled.  Each conforming slice thereafter
+ *           increases it's stored credit, and vice versa.
+ *
+ * CREDIT_C2: The maximum amount of CPU time in seconds a task
+ *           can store for later use.  When a task has no stored
+ *           credit left, now is time C2.  Tasks begin life with
+ *           C1 seconds credit, ie C2 is C1 seconds in front of
+ *           them, and the 'buffer' will grow in front of them
+ *           if they perform in a conformant manner.  The maximum
+ *           credit that fits in 32 bits jiffies is 42949 seconds.
+ */
+
+#define CREDIT_C1 10
+#define CREDIT_C2 14400
+
+#define C1 (CREDIT_C1 * MAX_BONUS * HZ)
+#define C2 (CREDIT_C2 * MAX_BONUS * HZ + C1)
+#define C3 (MAX_BONUS * C2)
+
+#define credit_exhausted(p, credit) \
+	(time_after_eq(jiffies, (p)->throttle + (credit)))
+
+/*
+ * Masks for p->slice_info, formerly p->first_time_slice.
+ * SLICE_FTS:   0x80000000  Task is in it's first ever timeslice.
+ * SLICE_NEW:   0x40000000  Slice refreshed.
+ * SLICE_SPA:   0x3FFE0000  Spare bits.
+ * SLICE_LTS:   0x0001FF80  Last time slice
+ * SLICE_AVG:   0x0000007F  Task slice_avg stored as percentage.
+ */
+#define SLICE_AVG_BITS    7
+#define SLICE_LTS_BITS   10
+#define SLICE_SPA_BITS   13
+#define SLICE_NEW_BITS    1
+#define SLICE_FTS_BITS    1
+
+#define SLICE_AVG_SHIFT   0
+#define SLICE_LTS_SHIFT   (SLICE_AVG_SHIFT + SLICE_AVG_BITS)
+#define SLICE_SPA_SHIFT   (SLICE_LTS_SHIFT + SLICE_LTS_BITS)
+#define SLICE_NEW_SHIFT   (SLICE_SPA_SHIFT + SLICE_SPA_BITS)
+#define SLICE_FTS_SHIFT   (SLICE_NEW_SHIFT + SLICE_NEW_BITS)
+
+#define INFO_MASK(x)      ((1U << (x))-1)
+#define SLICE_AVG_MASK    (INFO_MASK(SLICE_AVG_BITS) << SLICE_AVG_SHIFT)
+#define SLICE_LTS_MASK    (INFO_MASK(SLICE_LTS_BITS) << SLICE_LTS_SHIFT)
+#define SLICE_SPA_MASK    (INFO_MASK(SLICE_SPA_BITS) << SLICE_SPA_SHIFT)
+#define SLICE_NEW_MASK    (INFO_MASK(SLICE_NEW_BITS) << SLICE_NEW_SHIFT)
+#define SLICE_FTS_MASK    (INFO_MASK(SLICE_FTS_BITS) << SLICE_FTS_SHIFT)
+
+/*
+ * p->slice_info access macros.
+ */
+#define first_time_slice(p) ((p)->slice_info & SLICE_FTS_MASK)
+#define set_first_time_slice(p) ((p)->slice_info |= SLICE_FTS_MASK)
+#define clr_first_time_slice(p) ((p)->slice_info &= ~SLICE_FTS_MASK)
+
+#define slice_is_new(p) ((p)->slice_info & SLICE_NEW_MASK)
+#define set_slice_is_new(p) ((p)->slice_info |= SLICE_NEW_MASK)
+#define clr_slice_is_new(p) ((p)->slice_info &= ~SLICE_NEW_MASK)
+
+#define last_slice(p) (((p)->slice_info & SLICE_LTS_MASK) >> SLICE_LTS_SHIFT)
+#define set_last_slice(p, n) ((p)->slice_info = (((p)->slice_info & \
+	~SLICE_LTS_MASK) | (((n) << SLICE_LTS_SHIFT) & SLICE_LTS_MASK)))
+
+#define NS_SLEEP_AVG_PCNT (NS_MAX_SLEEP_AVG / 100)
+
+#define slice_avg(p) ((typeof((p)->sleep_avg)) \
+	((((p)->slice_info & SLICE_AVG_MASK) >> SLICE_AVG_SHIFT) * \
+	NS_SLEEP_AVG_PCNT))
+#define set_slice_avg(p, n) ((p)->slice_info = (((p)->slice_info & \
+	~SLICE_AVG_MASK) | ((((n) / NS_SLEEP_AVG_PCNT) \
+	<< SLICE_AVG_SHIFT) & SLICE_AVG_MASK)))
+#define slice_avg_raw(p)  \
+	(((p)->slice_info & SLICE_AVG_MASK) >> SLICE_AVG_SHIFT)
+#define set_slice_avg_raw(p, n) ((p)->slice_info = (((p)->slice_info & \
+	~SLICE_AVG_MASK) | (((n) << SLICE_AVG_SHIFT) & SLICE_AVG_MASK)))
+
+/*
+ * cpu usage macros.
+ */
+#define cpu_avg(p) \
+	(100 - slice_avg_raw(p))
+
+#define cpu_max(p) \
+	(100 - ((p)->sleep_avg / NS_SLEEP_AVG_PCNT))
+
+#define time_this_slice(p) \
+	(jiffies - (p)->last_slice)
+
+#define cpu_this_slice(p) \
+	(100 * last_slice(p) / max((unsigned) time_this_slice(p), \
+	(unsigned) last_slice(p)))
+
 #define TASK_PREEMPTS_CURR(p, rq) \
 	((p)->prio < (rq)->curr->prio)
 
@@ -890,13 +1014,20 @@ static int recalc_task_prio(task_t *p, u
 
 	if (likely(sleep_time > 0)) {
 		/*
+		 * Update throttle position.
+		 */
+		p->throttle += NS64_TO_JIFFIES(__sleep_time);
+		if (time_before(jiffies, p->throttle))
+			p->throttle = jiffies;
+
+		/*
 		 * Tasks that sleep a long time are categorised as idle.
 		 * They will only have their sleep_avg increased to a
 		 * level that makes them just interactive priority to stay
 		 * active yet prevent them suddenly becoming cpu hogs and
 		 * starving other processes.
 		 */
-		if (task_interactive_idle(p, sleep_time)) {
+		if (C2 && task_interactive_idle(p, sleep_time)) {
 			unsigned long ceiling = INTERACTIVE_SLEEP_AVG(p);
 
 			/*
@@ -951,6 +1082,7 @@ static void activate_task(task_t *p, run
 		runqueue_t *this_rq = this_rq();
 		now = (now - this_rq->timestamp_last_tick)
 			+ rq->timestamp_last_tick;
+
 	}
 #endif
 
@@ -1571,16 +1703,28 @@ void fastcall sched_fork(task_t *p, int 
 	 * resulting in more scheduling fairness.
 	 */
 	local_irq_disable();
-	p->slice_time_ns = current->slice_time_ns >> 1;
-	if (unlikely(p->slice_time_ns < NS_TICK))
-		p->slice_time_ns = NS_TICK;
+	p->slice_time_ns = (current->slice_time_ns + NS_TICK) >> 1;
 	p->time_slice = NS_TO_JIFFIES(p->slice_time_ns);
+	if (unlikely(p->slice_time_ns < NS_TICK)) {
+		p->slice_time_ns = NS_TICK;
+		p->time_slice = 1;
+	}
 	/*
 	 * The remainder of the first timeslice might be recovered by
 	 * the parent if the child exits early enough.
 	 */
-	p->first_time_slice = 1;
+	set_first_time_slice(p);
 	p->timestamp = sched_clock();
+
+	/*
+	 * Set up slice_info for the child.
+	 */
+	set_slice_avg(p, p->sleep_avg);
+	set_last_slice(p, p->time_slice);
+	set_slice_is_new(p);
+	p->last_slice = jiffies;
+	p->throttle = jiffies - C2 + C1;
+
 	current->slice_time_ns >>= 1;
 	if (unlikely(current->slice_time_ns < NS_TICK)) {
 		/*
@@ -1695,7 +1839,7 @@ void fastcall sched_exit(task_t *p)
 	 * the sleep_avg of the parent as well.
 	 */
 	rq = task_rq_lock(p->parent, &flags);
-	if (p->first_time_slice && task_cpu(p) == task_cpu(p->parent)) {
+	if (first_time_slice(p) && task_cpu(p) == task_cpu(p->parent)) {
 		p->parent->slice_time_ns += p->slice_time_ns;
 		if (unlikely(p->parent->slice_time_ns > task_timeslice_ns(p)))
 			p->parent->slice_time_ns = task_timeslice_ns(p);
@@ -2813,6 +2957,89 @@ void account_steal_time(struct task_stru
 }
 
 /*
+ * Refresh timeslice and associated slice information.
+ * @p: the process to refresh.
+ */
+static void refresh_timeslice(task_t *p)
+{
+	unsigned long slice_time = jiffies - p->last_slice;
+	unsigned int slice = last_slice(p);
+	unsigned int slice_avg, cpu, idle;
+	long run_time = -1 * p->slice_time_ns;
+	int w = MAX_BONUS, delta, bonus;
+
+	/*
+	 * Update time_slice.
+	 */
+	p->slice_time_ns = task_timeslice_ns(p);
+	p->time_slice = task_timeslice(p);
+	set_last_slice(p, p->time_slice);
+
+	/*
+	 * Update sleep_avg.
+	 *
+	 * Tasks charged proportionately less run_time at high
+	 * sleep_avg to delay them losing their interactive status
+	 */
+	run_time += JIFFIES_TO_NS(slice);
+	if (C2)
+		run_time /= SLEEP_AVG_DIVISOR(p);
+	if (p->sleep_avg >= run_time)
+		p->sleep_avg -= run_time;
+	else p->sleep_avg = 0;
+
+	/*
+	 * Update slice_avg.
+	 */
+	slice_avg = slice_avg_raw(p);
+	cpu = cpu_this_slice(p);
+	idle = 100 - cpu;
+
+	delta = max(slice_avg, idle) - min(slice_avg, idle);
+	w = 1 + (delta / w);
+	slice_avg = (w * slice_avg + idle) / (w + 1);
+	set_slice_avg_raw(p, slice_avg);
+
+	/*
+	 * If we've hit the timeout, we aren't draining enough sleep_avg
+	 * to catch up with the task's cpu usage.  Up the ante to bring
+	 * the task back toward balance.  This is important, because it
+	 * allows interactive tasks to push their throttle back enough
+	 * that they can both sustain, and rapidly recover from throttling
+	 * instead of descending into C3.
+	 */
+	if (credit_exhausted(p, C2) && p->sleep_avg > slice_avg(p)) {
+		unsigned long run_time = p->sleep_avg - slice_avg(p);
+		run_time /= w;
+		if (p->sleep_avg >= run_time)
+			p->sleep_avg -= run_time;
+	}
+
+	/*
+	 * Update throttle position.
+	 */
+	if (cpu < cpu_max(p) + PCNT_PER_DYNPRIO || !credit_exhausted(p, C1)) {
+		bonus = idle * PCNT_PER_DYNPRIO / 100;
+		p->throttle += (slice_time - slice) * bonus;
+	} else if (cpu >= cpu_max(p) + PCNT_PER_DYNPRIO) {
+		bonus = (cpu - cpu_max(p)) / PCNT_PER_DYNPRIO;
+		p->throttle -= slice_time * bonus;
+	}
+
+	if (time_before(jiffies, p->throttle))
+		p->throttle = jiffies;
+	else if (credit_exhausted(p, C3))
+		p->throttle = jiffies - C3;
+
+	/*
+	 * And finally, stamp and flag the new slice.
+	 */
+	clr_first_time_slice(p);
+	set_slice_is_new(p);
+	p->last_slice = jiffies;
+}
+
+/*
  * This function gets called by the timer code, with HZ frequency.
  * We call it with interrupts disabled.
  *
@@ -2863,9 +3090,7 @@ void scheduler_tick(void)
 		 * FIFO tasks have no timeslices.
 		 */
 		if ((p->policy == SCHED_RR) && !p->time_slice) {
-			p->slice_time_ns = task_timeslice_ns(p);
-			p->time_slice = task_timeslice(p);
-			p->first_time_slice = 0;
+			refresh_timeslice(p);
 			set_tsk_need_resched(p);
 
 			/* put it at the end of the queue: */
@@ -2874,22 +3099,10 @@ void scheduler_tick(void)
 		goto out_unlock;
 	}
 	if (!p->time_slice) {
-		long slice_time_ns = task_timeslice_ns(p);
-		long run_time = (-1 * p->slice_time_ns) + slice_time_ns;
 		dequeue_task(p, rq->active);
 		set_tsk_need_resched(p);
-		p->slice_time_ns = slice_time_ns;
-		p->time_slice = task_timeslice(p);
-		/*
-		 * Tasks are charged proportionately less run_time at high
-		 * sleep_avg to delay them losing their interactive status
-		 */
-		run_time /= SLEEP_AVG_DIVISOR(p);
-		if (p->sleep_avg >= run_time)
-			p->sleep_avg -= run_time;
-		else p->sleep_avg = 0;
+		refresh_timeslice(p);
 		p->prio = effective_prio(p);
-		p->first_time_slice = 0;
 
 		if (!rq->expired_timestamp)
 			rq->expired_timestamp = jiffies;
@@ -3280,6 +3493,14 @@ switch_tasks:
 
 	prev->timestamp = prev->last_ran = now;
 
+	/*
+	 * Tag start of execution of a new timeslice.
+	 */
+	if (unlikely(slice_is_new(next))) {
+		next->last_slice = jiffies;
+		clr_slice_is_new(next);
+	}
+
 	sched_info_switch(prev, next);
 	if (likely(prev != next)) {
 		next->timestamp = now;



^ permalink raw reply

* [parisc-linux] [PATCH] Fixs to work on ARM and PARIC platforms.
From: Ryan Bradetich @ 2006-04-01  9:22 UTC (permalink / raw)
  To: fuse-devel, parisc-linux


[-- Attachment #1.1: Type: text/plain, Size: 1161 bytes --]

Hello all,

I spend the last couple days tracking down why FUSE would not work on the
ARM and PARISC platform ... With the hints from  James Bottomley in the
"Example filesystems fail to init on parisc" thread and a fair amount of
persistence I was got a patch that works.

The patch really fixes two bugs:

1.  The rwlock tree_lock  in struct fuse was not properly initialized using
pthread_rwlock_init().    This normally works on other archs (besides
PARISC) since the lock can be initialized to 0 values, this is not true on
the PARISC platform ... these locks must be initialized properly to work on
PARISC.

2. I had to add an additional cache flush in the fuse_copy_do function.  On
both ARM and PARISC, the data was corrupted unless cache is flushed first.
Unfortunately I hit it with a very big hammer (flush_cache_all) ... I am
hoping someone more familiar with the caches will suggest a better flush
function to use.  I tried to use the flush_kernel_dcache_page and
flush_dcache_page functions without any luck :(


Hopefully this work will enable FUSE to work on these architectures in the
near future.

Thanks,

- Ryan

[-- Attachment #1.2: Type: text/html, Size: 1251 bytes --]

[-- Attachment #2: fuse-kernel.patch --]
[-- Type: text/x-patch, Size: 299 bytes --]

--- fuse-2.6.0-pre2/kernel/dev.c.orig	2006-04-01 00:40:28.000000000 -0800
+++ fuse-2.6.0-pre2/kernel/dev.c	2006-04-01 00:40:43.000000000 -0800
@@ -522,6 +522,7 @@
 {
 	unsigned ncpy = min(*size, cs->len);
 	if (val) {
+		flush_cache_all();
 		if (cs->write)
 			memcpy(cs->buf, *val, ncpy);
 		else

[-- Attachment #3: fuse-lib.patch --]
[-- Type: text/x-patch, Size: 332 bytes --]

--- fuse-2.6.0-pre2/lib/fuse.c.orig	2006-04-01 00:54:32.000000000 -0800
+++ fuse-2.6.0-pre2/lib/fuse.c	2006-04-01 00:47:48.000000000 -0800
@@ -2068,6 +2068,7 @@
     }
 
     mutex_init(&f->lock);
+    pthread_rwlock_init(&f->tree_lock, PTHREAD_RWLOCK_PREFER_READER_NP);
     memcpy(&f->op, op, op_size);
     f->compat = compat;
 

[-- Attachment #4: Type: text/plain, Size: 169 bytes --]

_______________________________________________
parisc-linux mailing list
parisc-linux@lists.parisc-linux.org
http://lists.parisc-linux.org/mailman/listinfo/parisc-linux

^ permalink raw reply

* Re: snd-nm256: hard lockup on every second module load after powerup
From: Adrian Bunk @ 2006-04-01  9:21 UTC (permalink / raw)
  To: Lee Revell; +Cc: Christian Trefzer, Takashi Iwai, lkml, alsa-devel
In-Reply-To: <1143841995.27146.25.camel@mindpipe>

On Fri, Mar 31, 2006 at 04:53:13PM -0500, Lee Revell wrote:
> On Fri, 2006-03-31 at 23:12 +0200, Adrian Bunk wrote:
> > > Actually, the changes in Linus' current git have fixed the hang for
> > me.
> > > Good job - thanks a lot, guys!
> > > 
> > > Kind regards,
> > > Chris
> > 
> > Takashi, would it be possible getting the fixes for this hard lookup 
> > into 2.6.16.2?
> > 
> 
> Is a 225 line patch to fix a driver that's never worked appropriate for
> -stable?

If it was only "not working" it wasn't that bad, but "hard lockup" is 
really bad.

> Lee

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

^ permalink raw reply

* Re: Kernel for MPC Lite 5200 will not compile
From: Matthias Fechner @ 2006-04-01  9:19 UTC (permalink / raw)
  To: linuxppc-embedded
In-Reply-To: <4429A0E5.8010308@246tNt.com>

Hello Sylvain,

* Sylvain Munaut <tnt@246tNt.com> [28-03-06 22:47]:
> If it still doesnt work, report it and I'll have a closer look. Maybe
> something changed
> recently and I didn't update my tree since a few days ...

ok, I have now the board to really test it.
I tried to boot over NFS, the kernel was loaded successfully but it
will not really boot, I got:
--- cut ---
U-Boot 1.1.4 (Jan 23 2006 - 11:03:09)

CPU:   MPC5200 v1.2 at 396 MHz
       Bus 132 MHz, IPB 66 MHz, PCI 33 MHz
       Board: Motorola MPC5200 (IceCube)
       I2C:   85 kHz, ready
       DRAM:  64 MB
       FLASH: 16 MB
       PCI:   Bus Dev VenId DevId Class Int
               00  1a  1057  5803  0680  00
       In:    serial
       Out:   serial
       Err:   serial
       Net:   FEC ETHERNET
       IDE:   Bus 0: not available  
	       
Autostarting.V13_02_06_OP. Press any key to abort..
	       
Hit any key to stop autoboot:  0 
Using FEC ETHERNET device
TFTP from server 192.168.0.151; our IP address is 192.168.0.101
Filename 'MPC5200/uImage'.
Load address: 0x200000
Loading: #################################################################
         #################################################################
         #################################################################
         ############
done
Bytes transferred = 1057133 (10216d hex)
## Booting image at 00200000 ...
   Image Name:   Linux-2.6.16-rc1-gaf4f75fd
   Created:      2006-03-29  16:45:14 UTC
   Image Type:   PowerPC Linux Kernel Image (gzip compressed)
   Data Size:    1057069 Bytes =  1 MB
   Load Address: 00000000
   Entry Point:  00000000
   Verifying Checksum ... OK
   Uncompressing Kernel Image ... OK
id mach(): done
MMU:enter
MMU:hw init
MMU:mapin
MMU:setio
MMU:exit
setup_arch: enter
setup_arch: bootmem
arch: exit
--- cut ---

After this the board wait for something until it will reboot.
I have the following variables set in U-Boot:
--- cut ---
baudrate=115200
ethact=FEC ETHERNET
1ipaddr=192.168.10.101
ethaddr=00:04:9F:00:11:02
stdin=serial
stdout=serial
stderr=serial
bootcmd=tftp 200000; bootm 200000
preboot=echo;echo Autostarting. Press any key to abort..;echo
serverip=192.168.0.151
ipaddr=192.168.0.101
netmask=255.255.255.0
bootdelay=5
hostname=icecube
nfsroot=root=/dev/nfs rw nfsroot=192.168.0.151:/usr/local/eldk/ppc_6xx
ip=ip=192.168.0.101:192.168.0.151:192.168.0.151:255.255.255.0:icecube::off
flashroot=root=/dev/mtdblock2 rw
rootfs=root=/dev/nfs rw nfsroot=192.168.0.151:/usr/local/eldk/ppc_6xx
bootfile=MPC5200/uImage
bootargs=root=/dev/nfs rw nfsroot=192.168.0.151:/usr/local/eldk/ppc_6xx ip=192.168.0.101:192.168.0.151:192.168.0.151:255.255.255.0:icecube::off
--- cut ---

The kernel is built with nfs support:
CONFIG_NFS_FS=y
CONFIG_NFS_V3=y
# CONFIG_NFS_V3_ACL is not set
CONFIG_NFS_V4=y
# CONFIG_NFS_DIRECTIO is not set
# CONFIG_NFSD is not set
CONFIG_LOCKD=y
CONFIG_LOCKD_V4=y
CONFIG_NFS_COMMON=y
CONFIG_SUNRPC=y
CONFIG_SUNRPC_GSS=y
CONFIG_RPCSEC_GSS_KRB5=y

I tried to find if the networkcard from the board will work, but I
cannot find a driver in the kernel for it.
What can be the problem for this?

Thx a lot!

Best regards,
Matthias

^ permalink raw reply

* netfilter: IP_NF_CONNTRACK_NETLINK=y, IP_NF_NAT=m compile error
From: Adrian Bunk @ 2006-04-01  9:18 UTC (permalink / raw)
  To: Athanasius, Linus Torvalds, linux-kernel, coreteam
  Cc: netfilter-devel, netdev
In-Reply-To: <20060331170916.GL28030@miggy.org>

On Fri, Mar 31, 2006 at 06:09:16PM +0100, Athanasius wrote:
> On Tue, Mar 28, 2006 at 05:39:32PM +0100, Athanasius wrote:
> >   CC      init/version.o
> >   LD      init/built-in.o
> >   LD      .tmp_vmlinux1
> > net/built-in.o(.text+0x7c990): In function `ctnetlink_parse_nat_proto':
> > : undefined reference to `ip_nat_proto_find_get'
> > net/built-in.o(.text+0x7c9b2): In function `ctnetlink_parse_nat_proto':
> > : undefined reference to `ip_nat_proto_put'
> > net/built-in.o(.text+0x7d695): In function `ctnetlink_change_conntrack':
> > : undefined reference to `ip_nat_setup_info'
> > net/built-in.o(.text+0x7da9f): In function `ctnetlink_create_conntrack':
> > : undefined reference to `ip_nat_setup_info'
> > make: *** [.tmp_vmlinux1] Error 1
> ...
> > CONFIG_IP_NF_TARGET_TCPMSS=m
> > CONFIG_IP_NF_NAT=m
> > CONFIG_IP_NF_NAT_NEEDED=y
> > CONFIG_IP_NF_TARGET_MASQUERADE=m
> 
> ...
> 
>   It looks like the problem was that "CONFIG_IP_NF_NAT=m".  I changed
> this to 'y' and things look to be compiling fine now.
>...

First of all thanks for your report.

More exactly, it's the combination CONFIG_IP_NF_CONNTRACK_NETLINK=y, 
CONFIG_IP_NF_NAT=m.

Can someone who understands the netfilter dependencies please look into 
this bug?

It's present in both 2.6.16.1 and 2.6.16-mm2.
 
> -Ath

cu
Adrian

-- 

       "Is there not promise of rain?" Ling Tan asked suddenly out
        of the darkness. There had been need of rain for many days.
       "Only a promise," Lao Er said.
                                       Pearl S. Buck - Dragon Seed

^ permalink raw reply

* Re: On the subject of DRQ and EH...
From: Albert Lee @ 2006-04-01  9:13 UTC (permalink / raw)
  To: Jeff Garzik; +Cc: linux-ide@vger.kernel.org
In-Reply-To: <442DC9E7.5000203@garzik.org>

Jeff Garzik wrote:
> grep for try_to_flush_leftover_data in drivers/ide.
> 

Thanks for the pointer. Patch to follow.

--
Albert



^ permalink raw reply

* Re: [patch 2.6.16-mm2 6/9] sched throttle tree extract - move division to slow path
From: Mike Galbraith @ 2006-04-01  9:12 UTC (permalink / raw)
  To: Ingo Molnar, Andrew Morton; +Cc: lkml, Peter Williams, Nick Piggin, Con Kolivas
In-Reply-To: <1143881983.7617.41.camel@homer>

This patch moves division of runtime from the fast path into the slow
path.  In doing so, it converts the task's time slice into nanoseconds,
which also disallows high frequency scheduling tasks from stealing time
from their neighbors by ducking the timer interrupt. (two birds, one
stone)

slice_time_ns is identical in function to time_slice, but conversion of
everything that referred to time_slice to nanoseconds just made a mess.
Ergo, I close the lesser of two evils, and duplicated what was necessary
to allow use of nanoseconds only where needed.

Signed-off-by: Mike Galbraith <efault@gmx.de>

--- linux-2.6.16-mm2/include/linux/sched.h.org	2006-03-31 11:25:02.000000000 +0200
+++ linux-2.6.16-mm2/include/linux/sched.h	2006-03-31 11:27:32.000000000 +0200
@@ -744,6 +744,7 @@ struct task_struct {
 	unsigned long policy;
 	cpumask_t cpus_allowed;
 	unsigned int time_slice, first_time_slice;
+	long slice_time_ns;
 
 #ifdef CONFIG_SCHEDSTATS
 	struct sched_info sched_info;
--- linux-2.6.16-mm2/kernel/sched.c-5.interactive_idle	2006-04-01 09:12:51.000000000 +0200
+++ linux-2.6.16-mm2/kernel/sched.c	2006-03-31 13:34:12.000000000 +0200
@@ -102,6 +102,7 @@
 #define NS_MAX_SLEEP_AVG_PCNT	(NS_MAX_SLEEP_AVG / 100)
 #define PCNT_PER_DYNPRIO	(100 / MAX_BONUS)
 #define NS_PER_DYNPRIO		(PCNT_PER_DYNPRIO * NS_MAX_SLEEP_AVG_PCNT)
+#define NS_TICK			(1000000000 / HZ)
 
 /*
  * If a task is 'interactive' then we reinsert it in the active
@@ -156,6 +157,8 @@
 #define TASK_INTERACTIVE(p) \
 	((p)->prio <= (p)->static_prio - DELTA(p))
 
+#define SLEEP_AVG_DIVISOR(p) (1 + CURRENT_BONUS(p))
+
 #define INTERACTIVE_SLEEP_AVG(p) \
 	(min(JIFFIES_TO_NS(MAX_SLEEP_AVG * (MAX_BONUS / 2 + DELTA(p)) / \
 	MAX_BONUS), NS_MAX_SLEEP_AVG))
@@ -202,6 +205,11 @@ static inline unsigned int task_timeslic
 	return static_prio_timeslice(p->static_prio);
 }
 
+static inline unsigned int task_timeslice_ns(task_t *p)
+{
+	return static_prio_timeslice(p->static_prio) * NS_TICK;
+}
+
 #define task_hot(p, now, sd) ((long long) ((now) - (p)->last_ran)	\
 				< (long long) (sd)->cache_hot_time)
 
@@ -1563,21 +1571,23 @@ void fastcall sched_fork(task_t *p, int 
 	 * resulting in more scheduling fairness.
 	 */
 	local_irq_disable();
-	p->time_slice = (current->time_slice + 1) >> 1;
+	p->slice_time_ns = current->slice_time_ns >> 1;
+	if (unlikely(p->slice_time_ns < NS_TICK))
+		p->slice_time_ns = NS_TICK;
+	p->time_slice = NS_TO_JIFFIES(p->slice_time_ns);
 	/*
 	 * The remainder of the first timeslice might be recovered by
 	 * the parent if the child exits early enough.
 	 */
 	p->first_time_slice = 1;
-	current->time_slice >>= 1;
 	p->timestamp = sched_clock();
-	if (unlikely(!current->time_slice)) {
+	current->slice_time_ns >>= 1;
+	if (unlikely(current->slice_time_ns < NS_TICK)) {
 		/*
 		 * This case is rare, it happens when the parent has only
 		 * a single jiffy left from its timeslice. Taking the
 		 * runqueue lock is not a problem.
 		 */
-		current->time_slice = 1;
 		scheduler_tick();
 	}
 	local_irq_enable();
@@ -1686,9 +1696,9 @@ void fastcall sched_exit(task_t *p)
 	 */
 	rq = task_rq_lock(p->parent, &flags);
 	if (p->first_time_slice && task_cpu(p) == task_cpu(p->parent)) {
-		p->parent->time_slice += p->time_slice;
-		if (unlikely(p->parent->time_slice > task_timeslice(p)))
-			p->parent->time_slice = task_timeslice(p);
+		p->parent->slice_time_ns += p->slice_time_ns;
+		if (unlikely(p->parent->slice_time_ns > task_timeslice_ns(p)))
+			p->parent->slice_time_ns = task_timeslice_ns(p);
 	}
 	if (p->sleep_avg < p->parent->sleep_avg)
 		p->parent->sleep_avg = p->parent->sleep_avg /
@@ -2709,7 +2719,9 @@ static inline void update_cpu_clock(task
 				    unsigned long long now)
 {
 	unsigned long long last = max(p->timestamp, rq->timestamp_last_tick);
-	p->sched_time += now - last;
+	long run_time = now - last;
+	p->sched_time += run_time;
+	p->slice_time_ns -= run_time;
 }
 
 /*
@@ -2837,13 +2849,21 @@ void scheduler_tick(void)
 	 * priority until it either goes to sleep or uses up its
 	 * timeslice. This makes it possible for interactive tasks
 	 * to use up their timeslices at their highest priority levels.
-	 */
+	 *
+	 * We don't want to update every task at each tick, so we
+	 * update a task's time_slice according to how much cpu
+	 * time it has received since it was last ticked.
+	 */
+	if (p->slice_time_ns < NS_TICK)
+		p->time_slice = 0;
+	else p->time_slice = NS_TO_JIFFIES(p->slice_time_ns);
 	if (rt_task(p)) {
 		/*
 		 * RR tasks need a special form of timeslice management.
 		 * FIFO tasks have no timeslices.
 		 */
-		if ((p->policy == SCHED_RR) && !--p->time_slice) {
+		if ((p->policy == SCHED_RR) && !p->time_slice) {
+			p->slice_time_ns = task_timeslice_ns(p);
 			p->time_slice = task_timeslice(p);
 			p->first_time_slice = 0;
 			set_tsk_need_resched(p);
@@ -2853,11 +2873,22 @@ void scheduler_tick(void)
 		}
 		goto out_unlock;
 	}
-	if (!--p->time_slice) {
+	if (!p->time_slice) {
+		long slice_time_ns = task_timeslice_ns(p);
+		long run_time = (-1 * p->slice_time_ns) + slice_time_ns;
 		dequeue_task(p, rq->active);
 		set_tsk_need_resched(p);
-		p->prio = effective_prio(p);
+		p->slice_time_ns = slice_time_ns;
 		p->time_slice = task_timeslice(p);
+		/*
+		 * Tasks are charged proportionately less run_time at high
+		 * sleep_avg to delay them losing their interactive status
+		 */
+		run_time /= SLEEP_AVG_DIVISOR(p);
+		if (p->sleep_avg >= run_time)
+			p->sleep_avg -= run_time;
+		else p->sleep_avg = 0;
+		p->prio = effective_prio(p);
 		p->first_time_slice = 0;
 
 		if (!rq->expired_timestamp)
@@ -3122,7 +3153,6 @@ asmlinkage void __sched schedule(void)
 	prio_array_t *array;
 	struct list_head *queue;
 	unsigned long long now;
-	unsigned long run_time;
 	int cpu, idx, new_prio;
 
 	/*
@@ -3156,19 +3186,6 @@ need_resched_nonpreemptible:
 
 	schedstat_inc(rq, sched_cnt);
 	now = sched_clock();
-	if (likely((long long)(now - prev->timestamp) < NS_MAX_SLEEP_AVG)) {
-		run_time = now - prev->timestamp;
-		if (unlikely((long long)(now - prev->timestamp) < 0))
-			run_time = 0;
-	} else
-		run_time = NS_MAX_SLEEP_AVG;
-
-	/*
-	 * Tasks charged proportionately less run_time at high sleep_avg to
-	 * delay them losing their interactive status
-	 */
-	run_time /= (CURRENT_BONUS(prev) ? : 1);
-
 	spin_lock_irq(&rq->lock);
 
 	if (unlikely(prev->flags & PF_DEAD))
@@ -3242,7 +3259,6 @@ go_idle:
 		if (next->sleep_type == SLEEP_INTERACTIVE)
 			delta = delta * (ON_RUNQUEUE_WEIGHT * 128 / 100) / 128;
 
-		array = next->array;
 		new_prio = recalc_task_prio(next, next->timestamp + delta);
 
 		if (unlikely(next->prio != new_prio)) {
@@ -3262,9 +3278,6 @@ switch_tasks:
 
 	update_cpu_clock(prev, rq, now);
 
-	prev->sleep_avg -= run_time;
-	if ((long)prev->sleep_avg <= 0)
-		prev->sleep_avg = 0;
 	prev->timestamp = prev->last_ran = now;
 
 	sched_info_switch(prev, next);



^ permalink raw reply

* Re: [patch] make evtchn_upcall_pending arch-specific type
From: Keir Fraser @ 2006-04-01  9:11 UTC (permalink / raw)
  To: Jimi Xenidis; +Cc: xen-devel, Hollis Blanchard, xen-ppc-devel
In-Reply-To: <5BD25DCF-992A-4C95-B349-622F213EA4F4@watson.ibm.com>


On 1 Apr 2006, at 04:55, Jimi Xenidis wrote:

> 	unsigned long evtchn_upcall_bits;
> Then:
> 	#define EVTCHN_UPCALL_PENDING 0
> 	#define EVTCHN_UPCALL_MASK 8
>
> use the macros to define the bit arg of the bitop_*().
> I chose these values because they would be completely compatible with 
> any assembler that exist for the itty bitty byte arches. :)  As for 
> PPC the values don't matter to us, at this early stage.

We'd have to group more than just the mask and pending flags into that 
long on x86 as otherwise we change the size of a public structure.

>> That's another one where the fields to be atomically updated are at 
>> least 8-byte aligned, and where using longer types will bloat a 
>> structure that we'd prefer to pack nicely.
> The I'd rather bloat (for PPC only) then come up with some nasty 
> read/calculate-the-actual-bit-and-modify/write.

Okay, I don't think it's so bad really, except you may want to round 
the structure size up to the next power of two (potentially) and that 
may halve MAX_VIRT_CPUS for you until we support allocating extra pages 
for higher order vCPU infos.

>>
>> If this is the best way for ppc then I think atomic_bit_t would be a 
>> nicer typedef.
>
> I think a context specific typedef would be better, in most cases.

Well, I'm not too fussed. I expect atomic_bit_t would only get used in 
this one place ever anyway.

> Also,
>   - I'd like to see more use of DECLARE_BITMAP() for stuff like 
> pirq_mask
>   - more use of BITS_PER_LONG instead of (sizeof(long)*8) that occurs 
> in many places like evtchn_pending[]

Yes, for sure.

  -- Keir

^ permalink raw reply

* Re: [PATCH] - Makefiles for tools/loader/{hvmloader|vmxassist}
From: Keir Fraser @ 2006-04-01  9:03 UTC (permalink / raw)
  To: Ben Thomas; +Cc: xen-devel
In-Reply-To: <442D9E11.1040406@virtualiron.com>


On 31 Mar 2006, at 22:24, Ben Thomas wrote:

> In FC5, gcc has issues with the command lines used to build
> hvmloader and vmxassist.  Basically, the compiler doesn't
> like the combination of -m64 and -m32.  As these are 32 bit
> apps, and intended to be, take a modified approach and simply
> define XEN_TARGET_ARCH for 32 bits.  This cleans up the
> command line and builds the images correctly.
>
> We could also wait for a gcc fix, but...

No, this patch is sane. Putting both switches on the command line makes 
no sense. I wonder whether to simply put 'CFLAGS :=' *after* the 
include of Rules.mk though.

  -- Keir

^ permalink raw reply

* Re: fsck.reiser4 segfaults
From: Jake Maciejewski @ 2006-04-01  9:02 UTC (permalink / raw)
  To: Sarath Menon; +Cc: jfeise, Michael Weissenbacher, reiserfs-list
In-Reply-To: <932539950604010013w44d30453r898a0a1ed3ee3b8d@mail.gmail.com>

On Sat, 2006-04-01 at 08:13 +0000, Sarath Menon wrote:
> Me too, ;) I also found http://www.lxnaydesign.net/, useful if you
> need a browser to be around too.
> 
> Here's the dmesg output when i try to mount it.
> 
> reiser4[mount(11756)]: renew_sibling_link
> (fs/reiser4/tree_walk.c:441)[nikita-3532]:
> WARNING: Sibling nodes on the different levels: 4 != 4
> 
> reiser4[mount(11756)]: key_warning (fs/reiser4/plugin/object.c:97)[nikita-717]:
> WARNING: Error for inode 42 (-5)
> 
> The kernel version seems to be a bit old at 2.6.10-lxnay3. Should I
> try with a newer kernel, with debug args maybe?

lxnay may have backported a more recent patch, but there was a plugin
set change (see http://www.mail-archive.com/reiserfs-list@namesys.com/
msg18602.html) in 2.6.11-5 such that older kernels would be unable to
mount filesystems that had been mounted with newer kernels.

> Thanks,
> Sarath
> 
> On 4/1/06, Joachim Feise <jfeise@gmail.com> wrote:
> > Michael Weissenbacher wrote on 03/31/06 12:21:
> >
> > > Hi,
> > >> reiserfsprogs and libaal are both 1.0.5. I'll give you the dmesg
> > >> output tommorow - I need to get a livecd with reiser4 patches - its
> > >> more difficult than I initially thought ;)
> > > I'm using RIPLinux, which has reiser4 support.
> > > http://www.tux.org/pub/people/kent-robotti/looplinux/rip/
> >
> >
> > Thanks for that info. I was looking for a boot disk with reiser4 for some time.
> >
> > -Joe
> >
> 
> 
> --
> --------------------------
> I presume, when you pronounce iptables, you say that you are peeing tables
-- 
Jake Maciejewski <maciejej@msoe.edu>


^ permalink raw reply

* Re: 2.6.16 nor FC5 -xenU kernel will start under 3.0-testing
From: Keir Fraser @ 2006-04-01  9:01 UTC (permalink / raw)
  To: Matt Ayres; +Cc: xen-devel@lists.xensource.com
In-Reply-To: <442D9B7E.5080809@tektonic.net>


On 31 Mar 2006, at 22:13, Matt Ayres wrote:

> Is not the point of a 3.0 branch that kernels compiled for 3.0.x will 
> run under any version or is there new coded added to both of these 
> kernels that prevent it from running under my older version of Xen?  I 
> could see a kernel developed for Xen 3.1 not working with 3.0.x, but 
> my impression was 3.0.x were all meant to be compatible with each 
> other (forward and backward).
>
> If this is not meant to work let me know, otherwise I will open up a 
> bug .

Currently we guarantee that old Xen3 kernels will work as domU on new 
Xen3 hypervisor, but not vice versa. We understand that the converse 
will be useful to people (upgrade guest distro but keep existing Xen 
hypervisor installation) and we want to provide compatibility in both 
directions in future.

  -- Keir

^ permalink raw reply

* Re: [patch 2.6.16-mm2 5/9] sched throttle tree extract - correct idle sleep logic
From: Mike Galbraith @ 2006-04-01  8:59 UTC (permalink / raw)
  To: Ingo Molnar; +Cc: Andrew Morton, lkml, Peter Williams, Nick Piggin, Con Kolivas
In-Reply-To: <1143881494.7617.32.camel@homer>

This patch corrects the idle sleep logic to place a long sleeping task
into the runqueue at a barely interactive priority such that it can not
destroy interactivity should it immediately begin consuming massive cpu.

It further ensures that no task will cross the boundary from normal task
to interactive task without first stopping at the border before moving
on.  Note, that this in no way hinders a long sleeping task from waking
at max priority.  They stop on the way up, but are not truncated.  This
only prevents long sleeping tasks from slamming straight to max
interactive with one sleep, and causing trouble.

Signed-off-by: Mike Galbraith <efault@gmx.de>

--- linux-2.6.16-mm2/kernel/sched.c-4.remove_kthread_barrier	2006-04-01 09:01:54.000000000 +0200
+++ linux-2.6.16-mm2/kernel/sched.c	2006-04-01 09:12:51.000000000 +0200
@@ -99,6 +99,9 @@
 #define MAX_SLEEP_AVG		(DEF_TIMESLICE * MAX_BONUS)
 #define STARVATION_LIMIT	(MAX_SLEEP_AVG)
 #define NS_MAX_SLEEP_AVG	(JIFFIES_TO_NS(MAX_SLEEP_AVG))
+#define NS_MAX_SLEEP_AVG_PCNT	(NS_MAX_SLEEP_AVG / 100)
+#define PCNT_PER_DYNPRIO	(100 / MAX_BONUS)
+#define NS_PER_DYNPRIO		(PCNT_PER_DYNPRIO * NS_MAX_SLEEP_AVG_PCNT)
 
 /*
  * If a task is 'interactive' then we reinsert it in the active
@@ -153,9 +156,23 @@
 #define TASK_INTERACTIVE(p) \
 	((p)->prio <= (p)->static_prio - DELTA(p))
 
-#define INTERACTIVE_SLEEP(p) \
-	(JIFFIES_TO_NS(MAX_SLEEP_AVG * \
-		(MAX_BONUS / 2 + DELTA((p)) + 1) / MAX_BONUS - 1))
+#define INTERACTIVE_SLEEP_AVG(p) \
+	(min(JIFFIES_TO_NS(MAX_SLEEP_AVG * (MAX_BONUS / 2 + DELTA(p)) / \
+	MAX_BONUS), NS_MAX_SLEEP_AVG))
+
+/*
+ * Returns whether a task has been asleep long enough to be considered idle.
+ * The metric is whether this quantity of sleep would promote the task more
+ * than one priority beyond marginally interactive.
+ */
+static int task_interactive_idle(task_t *p, unsigned long sleep_time)
+{
+	unsigned long ceiling = (CURRENT_BONUS(p) + 2) * NS_PER_DYNPRIO;
+
+	if (p->sleep_avg + sleep_time < ceiling)
+		return 0;
+	return p->sleep_avg + sleep_time >= INTERACTIVE_SLEEP_AVG(p);
+}
 
 #define TASK_PREEMPTS_CURR(p, rq) \
 	((p)->prio < (rq)->curr->prio)
@@ -871,13 +888,25 @@ static int recalc_task_prio(task_t *p, u
 		 * active yet prevent them suddenly becoming cpu hogs and
 		 * starving other processes.
 		 */
-		if (sleep_time > INTERACTIVE_SLEEP(p)) {
-				unsigned long ceiling;
+		if (task_interactive_idle(p, sleep_time)) {
+			unsigned long ceiling = INTERACTIVE_SLEEP_AVG(p);
+
+			/*
+			 * Promote previously interactive task.
+			 */
+			if (p->sleep_avg > ceiling) {
+				ceiling = p->sleep_avg / NS_PER_DYNPRIO;
+				if (ceiling < MAX_BONUS)
+					ceiling++;
+				ceiling *= NS_PER_DYNPRIO;
+			} else {
+				ceiling += p->slice_time_ns >> 2;
+				if (ceiling > NS_MAX_SLEEP_AVG)
+					ceiling = NS_MAX_SLEEP_AVG;
+			}
 
-				ceiling = JIFFIES_TO_NS(MAX_SLEEP_AVG -
-					DEF_TIMESLICE);
-				if (p->sleep_avg < ceiling)
-					p->sleep_avg = ceiling;
+			if (p->sleep_avg < ceiling)
+				p->sleep_avg = ceiling;
 		} else {
 			/*
 			 * This code gives a bonus to interactive tasks.



^ permalink raw reply

* [ALSA - liboss 0001228]: Skype Does not work with aoss
From: bugtrack @ 2006-04-01  8:55 UTC (permalink / raw)
  To: alsa-devel


A NOTE has been added to this issue.
======================================================================
<https://bugtrack.alsa-project.org/alsa-bug/view.php?id=1228> 
======================================================================
Reported By:                hil
Assigned To:                
======================================================================
Project:                    ALSA - liboss
Issue ID:                   1228
Category:                   
Reproducibility:            always
Severity:                   minor
Priority:                   normal
Status:                     new
======================================================================
Date Submitted:             07-03-2005 09:09 CEST
Last Modified:              04-01-2006 10:55 CEST
======================================================================
Summary:                    Skype Does not work with aoss
Description: 
I downloaded alsa-oss-1.0.9rc2 and install by
# ./configure --with-aoss=yes && make && make install
as root. Virtually every program works except skype
(http://www.skype.com/) version 1.1.0.13_API. I downloaded the Fedora
version of skype from the skype official website. Skype only uses
/dev/dsp. I guess skype uses /dev/dsp as microphone input as well. I could
not hear anything and the microphone did not work as well if I run  skype
like aoss /usr/bin/skype. If I run skype without aoss, then skype works
just fine.
======================================================================
Relazioni           ID      Riassunto
----------------------------------------------------------------------
in relazione con    0001224 artsd-like style
======================================================================

----------------------------------------------------------------------
 Hetfield - 03-22-06 10:02 
----------------------------------------------------------------------
oki, but kiax still has the same problem and kiax is open, you may try to
fix that, hoping it's a similar bug

----------------------------------------------------------------------
 Hetfield - 04-01-06 10:55 
----------------------------------------------------------------------
ok i have now skype working with aoss and dmix. solution found somewhere in
the web, not only mine...

1) i have whole .11rc4
2) i have .asoundrc pasted below (yes i know i should use no more it)
3) start skype this way:

export ALSA_OSS_PCM_DEVICE="skype"
aoss /opt/skype/skype.bin --resources-path /opt/skype/

it works with dmix, i can listen mplayer and use skype audio

only a notice: whould be so nice if next alsa could implement such things
by default settings

cat .asoundrc
pcm.skype {
    type asym
    playback.pcm "skypeout"
    capture.pcm "skypein"
 }

 pcm.skypein {
    type route
    slave {
       pcm "skypedsnoop"
       format S16_LE
    }
    ttable {
       0 {0 0.5}
       1 {0 0.5}
    }
 }

 pcm.skypeout {
    type plug
    slave {
       pcm "dmix"
    }
 }

 pcm.skypedsnoop {
    type dsnoop
    ipc_key 1133
    slave {
       pcm "hw:0,0"
       period_size 256
       periods 16
       buffer_size 16384
    }
    bindings {
       0 0
    }
 }

Issue History
Date Modified  Username       Field                    Change              
======================================================================
07-03-05 09:09 hil            New Issue                                    
08-09-05 15:33 rapand         Note Added: 0005732                          
08-10-05 00:49 rlrevell       Relationship added       duplicate of 0001224
08-10-05 00:50 rlrevell       Note Added: 0005740                          
12-31-05 00:19 rlrevell       Note Added: 0007315                          
01-02-06 18:54 rlrevell       Relationship deleted     duplicate of 0001224
01-02-06 18:55 rlrevell       Relationship added       related to 0001224  
01-02-06 18:56 rlrevell       Note Added: 0007375                          
01-05-06 21:36 Hetfield       Note Added: 0007479                          
01-05-06 21:40 rlrevell       Note Added: 0007480                          
01-05-06 21:42 rlrevell       Note Added: 0007481                          
01-05-06 22:01 Hetfield       Note Added: 0007482                          
01-28-06 05:34 nono31         Note Added: 0007824                          
01-28-06 05:35 nono31         Issue Monitored: nono31                      
01-28-06 05:38 rlrevell       Note Added: 0007825                          
01-28-06 06:11 nono31         Note Added: 0007826                          
01-28-06 06:12 nono31         File Added: strace_aoss_kiax.bz2                  
 
01-28-06 06:13 nono31         Note Added: 0007827                          
03-22-06 00:28 rlrevell       Note Added: 0008761                          
03-22-06 10:02 Hetfield       Note Added: 0008849                          
04-01-06 10:55 Hetfield       Note Added: 0009054                          
======================================================================




-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language
that extends applications into web and mobile media. Attend the live webcast
and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

^ permalink raw reply


This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.