···142142static struct iosapic_intr_info {143143 struct list_head rtes; /* RTEs using this vector (empty =>144144 * not an IOSAPIC interrupt) */145145- int count; /* # of RTEs that shares this vector */145145+ int count; /* # of registered RTEs */146146 u32 low32; /* current value of low word of147147 * Redirection table entry */148148 unsigned int dest; /* destination CPU physical ID */···313313 int rte_index;314314 struct iosapic_rte_info *rte;315315316316- if (list_empty(&iosapic_intr_info[irq].rtes))316316+ if (!iosapic_intr_info[irq].count)317317 return; /* not an IOSAPIC interrupt! */318318319319 /* set only the mask bit */···331331 int rte_index;332332 struct iosapic_rte_info *rte;333333334334- if (list_empty(&iosapic_intr_info[irq].rtes))334334+ if (!iosapic_intr_info[irq].count)335335 return; /* not an IOSAPIC interrupt! */336336337337 low32 = iosapic_intr_info[irq].low32 &= ~IOSAPIC_MASK;···363363364364 dest = cpu_physical_id(first_cpu(mask));365365366366- if (list_empty(&iosapic_intr_info[irq].rtes))366366+ if (!iosapic_intr_info[irq].count)367367 return; /* not an IOSAPIC interrupt */368368369369 set_irq_affinity_info(irq, dest, redir);···542542{543543 int new_irq;544544545545- if (!list_empty(&iosapic_intr_info[irq].rtes)) {545545+ if (iosapic_intr_info[irq].count) {546546 new_irq = create_irq();547547 if (new_irq < 0)548548 panic("%s: out of interrupt vectors!\n", __FUNCTION__);···560560 }561561}562562563563-static struct iosapic_rte_info *iosapic_alloc_rte (void)563563+static struct iosapic_rte_info * __init_refok iosapic_alloc_rte (void)564564{565565 int i;566566 struct iosapic_rte_info *rte;···677677 * In case of vector shared by multiple RTEs, all RTEs that678678 * share the vector need to use the same destination CPU.679679 */680680- if (!list_empty(&iosapic_intr_info[irq].rtes))680680+ if (iosapic_intr_info[irq].count)681681 return iosapic_intr_info[irq].dest;682682683683 /*···794794 err = register_intr(gsi, irq, IOSAPIC_LOWEST_PRIORITY,795795 polarity, trigger);796796 if (err < 0) {797797+ spin_unlock(&irq_desc[irq].lock);797798 irq = err;798798- goto unlock_all;799799+ goto unlock_iosapic_lock;799800 }800801801802 /*···812811 gsi, (trigger == IOSAPIC_EDGE ? "edge" : "level"),813812 (polarity == IOSAPIC_POL_HIGH ? "high" : "low"),814813 cpu_logical_id(dest), dest, irq_to_vector(irq));815815- unlock_all:814814+816815 spin_unlock(&irq_desc[irq].lock);817816 unlock_iosapic_lock:818817 spin_unlock_irqrestore(&iosapic_lock, flags);
+6-11
arch/ia64/kernel/irq_ia64.c
···101101 return -1;102102}103103104104-static void reserve_irq(unsigned int irq)105105-{106106- unsigned long flags;107107-108108- spin_lock_irqsave(&vector_lock, flags);109109- irq_status[irq] = IRQ_RSVD;110110- spin_unlock_irqrestore(&vector_lock, flags);111111-}112112-113104static inline int find_unassigned_irq(void)114105{115106 int irq;···293302294303void destroy_and_reserve_irq(unsigned int irq)295304{305305+ unsigned long flags;306306+296307 dynamic_irq_cleanup(irq);297308298298- clear_irq_vector(irq);299299- reserve_irq(irq);309309+ spin_lock_irqsave(&vector_lock, flags);310310+ __clear_irq_vector(irq);311311+ irq_status[irq] = IRQ_RSVD;312312+ spin_unlock_irqrestore(&vector_lock, flags);300313}301314302315static int __reassign_irq_vector(int irq, int cpu)
+11-6
arch/ia64/kernel/mca.c
···17501750 strncpy(p->comm, type, sizeof(p->comm)-1);17511751}1752175217531753-/* Do per-CPU MCA-related initialization. */17531753+/* Caller prevents this from being called after init */17541754+static void * __init_refok mca_bootmem(void)17551755+{17561756+ void *p;1754175717581758+ p = alloc_bootmem(sizeof(struct ia64_mca_cpu) * NR_CPUS +17591759+ KERNEL_STACK_SIZE);17601760+ return (void *)ALIGN((unsigned long)p, KERNEL_STACK_SIZE);17611761+}17621762+17631763+/* Do per-CPU MCA-related initialization. */17551764void __cpuinit17561765ia64_mca_cpu_init(void *cpu_data)17571766{···17721763 int cpu;1773176417741765 first_time = 0;17751775- mca_data = alloc_bootmem(sizeof(struct ia64_mca_cpu)17761776- * NR_CPUS + KERNEL_STACK_SIZE);17771777- mca_data = (void *)(((unsigned long)mca_data +17781778- KERNEL_STACK_SIZE - 1) &17791779- (-KERNEL_STACK_SIZE));17661766+ mca_data = mca_bootmem();17801767 for (cpu = 0; cpu < NR_CPUS; cpu++) {17811768 format_mca_init_stack(mca_data,17821769 offsetof(struct ia64_mca_cpu, mca_stack),
···346346}347347348348/*349349- * Run a function on another CPU349349+ * Run a function on a specific CPU350350 * <func> The function to run. This must be fast and non-blocking.351351 * <info> An arbitrary pointer to pass to the function.352352 * <nonatomic> Currently unused.···366366 int me = get_cpu(); /* prevent preemption and reschedule on another processor */367367368368 if (cpuid == me) {369369- printk(KERN_INFO "%s: trying to call self\n", __FUNCTION__);369369+ local_irq_disable();370370+ func(info);371371+ local_irq_enable();370372 put_cpu();371371- return -EBUSY;373373+ return 0;372374 }373375374376 data.func = func;
+15-1
arch/ia64/kernel/time.c
···240240 if (!nojitter)241241 itc_jitter_data.itc_jitter = 1;242242#endif243243- }243243+ } else244244+ /*245245+ * ITC is drifty and we have not synchronized the ITCs in smpboot.c.246246+ * ITC values may fluctuate significantly between processors.247247+ * Clock should not be used for hrtimers. Mark itc as only248248+ * useful for boot and testing.249249+ *250250+ * Note that jitter compensation is off! There is no point of251251+ * synchronizing ITCs since they may be large differentials252252+ * that change over time.253253+ *254254+ * The only way to fix this would be to repeatedly sync the255255+ * ITCs. Until that time we have to avoid ITC.256256+ */257257+ clocksource_itc.rating = 50;244258245259 /* Setup the CPU local timer tick */246260 ia64_cpu_local_tick();
+1-1
arch/ia64/sn/kernel/io_common.c
···391391 * hubdev_init_node() - Creates the HUB data structure and link them to it's392392 * own NODE specific data area.393393 */394394-void hubdev_init_node(nodepda_t * npda, cnodeid_t node)394394+void __init hubdev_init_node(nodepda_t * npda, cnodeid_t node)395395{396396 struct hubdev_info *hubdev_info;397397 int size;
···573573 struct pci_dev *pdev = to_pci_dev(gdev);574574 int i, rc;575575576576+ /* No BAR4 allocation: No DMA */577577+ if (pci_resource_start(pdev, 4) == 0)578578+ return 0;579579+576580 /* TODO: If we get no DMA mask we should fall back to PIO */577581 rc = pci_set_dma_mask(pdev, ATA_DMA_MASK);578582 if (rc)
···475475 switch (rev) {476476 case 0x07:477477 case 0x05:478478- printk("%s: UltraDMA capable", name);478478+ printk("%s: UltraDMA capable\n", name);479479 break;480480 case 0x03:481481 default:482482- printk("%s: MultiWord DMA force limited", name);482482+ printk("%s: MultiWord DMA force limited\n", name);483483 break;484484 case 0x01:485485 printk("%s: MultiWord DMA limited, "
+1-1
drivers/ide/pci/cs5520.c
···133133static int cs5520_config_drive_xfer_rate(ide_drive_t *drive)134134{135135 /* Tune the drive for PIO modes up to PIO 4 */ 136136- cs5520_tune_drive(drive, 4);136136+ cs5520_tune_drive(drive, 255);137137138138 /* Then tell the core to use DMA operations */139139 return 0;
+18-24
drivers/ide/pci/cs5535.c
···22 * linux/drivers/ide/pci/cs5535.c33 *44 * Copyright (C) 2004-2005 Advanced Micro Devices, Inc.55+ * Copyright (C) 2007 Bartlomiej Zolnierkiewicz56 *67 * History:78 * 09/20/2005 - Jaya Kumar <jayakumar.ide@gmail.com>···84838584 /* Set the PIO timings */8685 if ((speed & XFER_MODE) == XFER_PIO) {8787- u8 pioa;8888- u8 piob;8989- u8 cmd;8686+ ide_drive_t *pair = &drive->hwif->drives[drive->dn ^ 1];8787+ u8 cmd, pioa;90889191- pioa = speed - XFER_PIO_0;9292- piob = ide_get_best_pio_mode(&(drive->hwif->drives[!unit]),9393- 255, 4);9494- cmd = pioa < piob ? pioa : piob;8989+ cmd = pioa = speed - XFER_PIO_0;9090+9191+ if (pair->present) {9292+ u8 piob = ide_get_best_pio_mode(pair, 255, 4);9393+9494+ if (piob < cmd)9595+ cmd = piob;9696+ }95979698 /* Write the speed of the current drive */9799 reg = (cs5535_pio_cmd_timings[cmd] << 16) |···120116121117 reg &= 0x80000000UL; /* Preserve the PIO format bit */122118123123- if (speed >= XFER_UDMA_0 && speed <= XFER_UDMA_7)119119+ if (speed >= XFER_UDMA_0 && speed <= XFER_UDMA_4)124120 reg |= cs5535_udma_timings[speed - XFER_UDMA_0];125121 else if (speed >= XFER_MW_DMA_0 && speed <= XFER_MW_DMA_2)126122 reg |= cs5535_mwdma_timings[speed - XFER_MW_DMA_0];···155151 *156152 * A callback from the upper layers for PIO-only tuning.157153 */158158-static void cs5535_tuneproc(ide_drive_t *drive, u8 xferspeed)154154+static void cs5535_tuneproc(ide_drive_t *drive, u8 pio)159155{160160- u8 modes[] = { XFER_PIO_0, XFER_PIO_1, XFER_PIO_2, XFER_PIO_3,161161- XFER_PIO_4 };162162-163163- /* cs5535 max pio is pio 4, best_pio will check the blacklist.164164- i think we don't need to rate_filter the incoming xferspeed165165- since we know we're only going to choose pio */166166- xferspeed = ide_get_best_pio_mode(drive, xferspeed, 4);167167- ide_config_drive_speed(drive, modes[xferspeed]);168168- cs5535_set_speed(drive, xferspeed);156156+ pio = ide_get_best_pio_mode(drive, pio, 4);157157+ ide_config_drive_speed(drive, XFER_PIO_0 + pio);158158+ cs5535_set_speed(drive, XFER_PIO_0 + pio);169159}170160171161static int cs5535_dma_check(ide_drive_t *drive)172162{173173- u8 speed;174174-175163 drive->init_speed = 0;176164177165 if (ide_tune_dma(drive))178166 return 0;179167180180- if (ide_use_fast_pio(drive)) {181181- speed = ide_get_best_pio_mode(drive, 255, 4);182182- cs5535_set_drive(drive, speed);183183- }168168+ if (ide_use_fast_pio(drive))169169+ cs5535_tuneproc(drive, 255);184170185171 return -1;186172}
+17-16
drivers/ide/pci/it8213.c
···2121 * it8213_dma_2_pio - return the PIO mode matching DMA2222 * @xfer_rate: transfer speed2323 *2424- * Returns the nearest equivalent PIO timing for the PIO or DMA2424+ * Returns the nearest equivalent PIO timing for the DMA2525 * mode requested by the controller.2626 */2727···3535 case XFER_UDMA_1:3636 case XFER_UDMA_0:3737 case XFER_MW_DMA_2:3838- case XFER_PIO_4:3938 return 4;4039 case XFER_MW_DMA_1:4141- case XFER_PIO_3:4240 return 3;4341 case XFER_SW_DMA_2:4444- case XFER_PIO_2:4542 return 2;4643 case XFER_MW_DMA_0:4744 case XFER_SW_DMA_1:4845 case XFER_SW_DMA_0:4949- case XFER_PIO_1:5050- case XFER_PIO_0:5151- case XFER_PIO_SLOW:5246 default:5347 return 0;5448 }5549}56505751/*5858- * it8213_tuneproc - tune a drive5252+ * it8213_tune_pio - tune a drive5953 * @drive: drive to tune6054 * @pio: desired PIO mode6155 *6256 * Set the interface PIO mode.6357 */64586565-static void it8213_tuneproc (ide_drive_t *drive, u8 pio)5959+static void it8213_tune_pio(ide_drive_t *drive, const u8 pio)6660{6761 ide_hwif_t *hwif = HWIF(drive);6862 struct pci_dev *dev = hwif->pci_dev;···7581 { 1, 0 },7682 { 2, 1 },7783 { 2, 3 }, };7878-7979- pio = ide_get_best_pio_mode(drive, pio, 4);80848185 spin_lock_irqsave(&tune_lock, flags);8286 pci_read_config_word(dev, master_port, &master_data);···103111 if (is_slave)104112 pci_write_config_byte(dev, slave_port, slave_data);105113 spin_unlock_irqrestore(&tune_lock, flags);114114+}115115+116116+static void it8213_tuneproc(ide_drive_t *drive, u8 pio)117117+{118118+ pio = ide_get_best_pio_mode(drive, pio, 4);119119+ it8213_tune_pio(drive, pio);120120+ ide_config_drive_speed(drive, XFER_PIO_0 + pio);106121}107122108123/**···192193 if (reg55 & w_flag)193194 pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag);194195 }195195- it8213_tuneproc(drive, it8213_dma_2_pio(speed));196196+197197+ if (speed > XFER_PIO_4)198198+ it8213_tune_pio(drive, it8213_dma_2_pio(speed));199199+ else200200+ it8213_tune_pio(drive, speed - XFER_PIO_0);201201+196202 return ide_config_drive_speed(drive, speed);197203}198204···213209214210static int it8213_config_drive_for_dma (ide_drive_t *drive)215211{216216- u8 pio;217217-218212 if (ide_tune_dma(drive))219213 return 0;220214221221- pio = ide_get_best_pio_mode(drive, 255, 4);222222- it8213_tune_chipset(drive, XFER_PIO_0 + pio);215215+ it8213_tuneproc(drive, 255);223216224217 return -1;225218}
···11/*22- * linux/drivers/ide/pci/piix.c Version 0.50 Jun 10, 200722+ * linux/drivers/ide/pci/piix.c Version 0.51 Jul 6, 200733 *44 * Copyright (C) 1998-1999 Andrzej Krzysztofowicz, Author and Maintainer55 * Copyright (C) 1998-2000 Andre Hedrick <andre@linux-ide.org>···109109 * piix_dma_2_pio - return the PIO mode matching DMA110110 * @xfer_rate: transfer speed111111 *112112- * Returns the nearest equivalent PIO timing for the PIO or DMA112112+ * Returns the nearest equivalent PIO timing for the DMA113113 * mode requested by the controller.114114 */115115···123123 case XFER_UDMA_1:124124 case XFER_UDMA_0:125125 case XFER_MW_DMA_2:126126- case XFER_PIO_4:127126 return 4;128127 case XFER_MW_DMA_1:129129- case XFER_PIO_3:130128 return 3;131129 case XFER_SW_DMA_2:132132- case XFER_PIO_2:133130 return 2;134131 case XFER_MW_DMA_0:135132 case XFER_SW_DMA_1:136133 case XFER_SW_DMA_0:137137- case XFER_PIO_1:138138- case XFER_PIO_0:139139- case XFER_PIO_SLOW:140134 default:141135 return 0;142136 }···263269 case XFER_PIO_4:264270 case XFER_PIO_3:265271 case XFER_PIO_2:272272+ case XFER_PIO_1:266273 case XFER_PIO_0: break;267274 default: return -1;268275 }···294299 pci_write_config_byte(dev, 0x55, (u8) reg55 & ~w_flag);295300 }296301297297- piix_tune_pio(drive, piix_dma_2_pio(speed));302302+ if (speed > XFER_PIO_4)303303+ piix_tune_pio(drive, piix_dma_2_pio(speed));304304+ else305305+ piix_tune_pio(drive, speed - XFER_PIO_0);306306+298307 return ide_config_drive_speed(drive, speed);299308}300309
+20-41
drivers/ide/pci/scc_pata.c
···190190}191191192192/**193193- * scc_tuneproc - tune a drive PIO mode193193+ * scc_tune_pio - tune a drive PIO mode194194 * @drive: drive to tune195195 * @mode_wanted: the target operating mode196196 *···198198 * controller.199199 */200200201201-static void scc_tuneproc(ide_drive_t *drive, byte mode_wanted)201201+static void scc_tune_pio(ide_drive_t *drive, const u8 pio)202202{203203 ide_hwif_t *hwif = HWIF(drive);204204 struct scc_ports *ports = ide_get_hwifdata(hwif);···207207 unsigned long piosht_port = ctl_base + 0x000;208208 unsigned long pioct_port = ctl_base + 0x004;209209 unsigned long reg;210210- unsigned char speed = XFER_PIO_0;211210 int offset;212212-213213- mode_wanted = ide_get_best_pio_mode(drive, mode_wanted, 4);214214- switch (mode_wanted) {215215- case 4:216216- speed = XFER_PIO_4;217217- break;218218- case 3:219219- speed = XFER_PIO_3;220220- break;221221- case 2:222222- speed = XFER_PIO_2;223223- break;224224- case 1:225225- speed = XFER_PIO_1;226226- break;227227- case 0:228228- default:229229- speed = XFER_PIO_0;230230- break;231231- }232211233212 reg = in_be32((void __iomem *)cckctrl_port);234213 if (reg & CCKCTRL_ATACLKOEN) {···215236 } else {216237 offset = 0; /* 100MHz */217238 }218218- reg = JCHSTtbl[offset][mode_wanted] << 16 | JCHHTtbl[offset][mode_wanted];239239+ reg = JCHSTtbl[offset][pio] << 16 | JCHHTtbl[offset][pio];219240 out_be32((void __iomem *)piosht_port, reg);220220- reg = JCHCTtbl[offset][mode_wanted];241241+ reg = JCHCTtbl[offset][pio];221242 out_be32((void __iomem *)pioct_port, reg);243243+}222244223223- ide_config_drive_speed(drive, speed);245245+static void scc_tuneproc(ide_drive_t *drive, u8 pio)246246+{247247+ pio = ide_get_best_pio_mode(drive, pio, 4);248248+ scc_tune_pio(drive, pio);249249+ ide_config_drive_speed(drive, XFER_PIO_0 + pio);224250}225251226252/**···264280265281 switch (speed) {266282 case XFER_UDMA_6:267267- idx = 6;268268- break;269283 case XFER_UDMA_5:270270- idx = 5;271271- break;272284 case XFER_UDMA_4:273273- idx = 4;274274- break;275285 case XFER_UDMA_3:276276- idx = 3;277277- break;278286 case XFER_UDMA_2:279279- idx = 2;280280- break;281287 case XFER_UDMA_1:282282- idx = 1;283283- break;284288 case XFER_UDMA_0:285285- idx = 0;289289+ idx = speed - XFER_UDMA_0;286290 break;291291+ case XFER_PIO_4:292292+ case XFER_PIO_3:293293+ case XFER_PIO_2:294294+ case XFER_PIO_1:295295+ case XFER_PIO_0:296296+ scc_tune_pio(drive, speed - XFER_PIO_0);297297+ return ide_config_drive_speed(drive, speed);287298 default:288299 return 1;289300 }···308329 * required.309330 * If the drive isn't suitable for DMA or we hit other problems310331 * then we will drop down to PIO and set up PIO appropriately.311311- * (return 1)332332+ * (return -1)312333 */313334314335static int scc_config_drive_for_dma(ide_drive_t *drive)···317338 return 0;318339319340 if (ide_use_fast_pio(drive))320320- scc_tuneproc(drive, 4);341341+ scc_tuneproc(drive, 255);321342322343 return -1;323344}
···11/*22- * linux/drivers/ide/pci/slc90e66.c Version 0.14 February 8, 200722+ * linux/drivers/ide/pci/slc90e66.c Version 0.15 Jul 6, 200733 *44 * Copyright (C) 2000-2002 Andre Hedrick <andre@linux-ide.org>55 * Copyright (C) 2006-2007 MontaVista Software, Inc. <source@mvista.com>···2929 case XFER_UDMA_1:3030 case XFER_UDMA_0:3131 case XFER_MW_DMA_2:3232- case XFER_PIO_4:3332 return 4;3433 case XFER_MW_DMA_1:3535- case XFER_PIO_3:3634 return 3;3735 case XFER_SW_DMA_2:3838- case XFER_PIO_2:3936 return 2;4037 case XFER_MW_DMA_0:4138 case XFER_SW_DMA_1:4239 case XFER_SW_DMA_0:4343- case XFER_PIO_1:4444- case XFER_PIO_0:4545- case XFER_PIO_SLOW:4640 default:4741 return 0;4842 }···130136 case XFER_PIO_4:131137 case XFER_PIO_3:132138 case XFER_PIO_2:139139+ case XFER_PIO_1:133140 case XFER_PIO_0: break;134141 default: return -1;135142 }···151156 pci_write_config_word(dev, 0x4a, reg4a & ~a_speed);152157 }153158154154- slc90e66_tune_pio(drive, slc90e66_dma_2_pio(speed));159159+ if (speed > XFER_PIO_4)160160+ slc90e66_tune_pio(drive, slc90e66_dma_2_pio(speed));161161+ else162162+ slc90e66_tune_pio(drive, speed - XFER_PIO_0);163163+155164 return ide_config_drive_speed(drive, speed);156165}157166
+1-1
drivers/pci/pci-driver.c
···310310 /* restore the PCI config space */311311 pci_restore_state(pci_dev);312312 /* if the device was enabled before suspend, reenable */313313- retval = __pci_reenable_device(pci_dev);313313+ retval = pci_reenable_device(pci_dev);314314 /* if the device was busmaster before the suspend, make it busmaster again */315315 if (pci_dev->is_busmaster)316316 pci_set_master(pci_dev);
+3-4
drivers/pci/pci.c
···695695}696696697697/**698698- * __pci_reenable_device - Resume abandoned device698698+ * pci_reenable_device - Resume abandoned device699699 * @dev: PCI device to be resumed700700 *701701 * Note this function is a backend of pci_default_resume and is not supposed702702 * to be called by normal code, write proper resume handler and use it instead.703703 */704704-int705705-__pci_reenable_device(struct pci_dev *dev)704704+int pci_reenable_device(struct pci_dev *dev)706705{707706 if (atomic_read(&dev->enable_cnt))708707 return do_pci_enable_device(dev, (1 << PCI_NUM_RESOURCES) - 1);···16031604device_initcall(pci_init);1604160516051606EXPORT_SYMBOL_GPL(pci_restore_bars);16061606-EXPORT_SYMBOL(__pci_reenable_device);16071607+EXPORT_SYMBOL(pci_reenable_device);16071608EXPORT_SYMBOL(pci_enable_device_bars);16081609EXPORT_SYMBOL(pci_enable_device);16091610EXPORT_SYMBOL(pcim_enable_device);
+4-6
drivers/scsi/ide-scsi.c
···328328 u8 *buf;329329330330 /* stuff a sense request in front of our current request */331331- pc = kmalloc (sizeof (idescsi_pc_t), GFP_ATOMIC);332332- rq = kmalloc (sizeof (struct request), GFP_ATOMIC);333333- buf = kmalloc(SCSI_SENSE_BUFFERSIZE, GFP_ATOMIC);334334- if (pc == NULL || rq == NULL || buf == NULL) {331331+ pc = kzalloc(sizeof(idescsi_pc_t), GFP_ATOMIC);332332+ rq = kmalloc(sizeof(struct request), GFP_ATOMIC);333333+ buf = kzalloc(SCSI_SENSE_BUFFERSIZE, GFP_ATOMIC);334334+ if (!pc || !rq || !buf) {335335 kfree(buf);336336 kfree(rq);337337 kfree(pc);338338 return -ENOMEM;339339 }340340- memset (pc, 0, sizeof (idescsi_pc_t));341341- memset (buf, 0, SCSI_SENSE_BUFFERSIZE);342340 ide_init_drive_cmd(rq);343341 rq->special = (char *) pc;344342 pc->rq = rq;
···6262 */6363 desc->chip->enable(irq);64646565+ /*6666+ * Temporary hack to figure out more about the problem, which6767+ * is causing the ancient network cards to die.6868+ */6969+ if (desc->handle_irq != handle_edge_irq) {7070+ WARN_ON_ONCE(1);7171+ return;7272+ }7373+6574 if ((status & (IRQ_PENDING | IRQ_REPLAY)) == IRQ_PENDING) {6675 desc->status = (status & ~IRQ_PENDING) | IRQ_REPLAY;6776
+96-99
kernel/sched.c
···637637638638#define WMULT_SHIFT 32639639640640-static inline unsigned long640640+static unsigned long641641calc_delta_mine(unsigned long delta_exec, unsigned long weight,642642 struct load_weight *lw)643643{···657657 tmp = (tmp * lw->inv_weight) >> WMULT_SHIFT;658658 }659659660660- return (unsigned long)min(tmp, (u64)sysctl_sched_runtime_limit);660660+ return (unsigned long)min(tmp, (u64)(unsigned long)LONG_MAX);661661}662662663663static inline unsigned long···678678 lw->inv_weight = 0;679679}680680681681-static void __update_curr_load(struct rq *rq, struct load_stat *ls)682682-{683683- if (rq->curr != rq->idle && ls->load.weight) {684684- ls->delta_exec += ls->delta_stat;685685- ls->delta_fair += calc_delta_fair(ls->delta_stat, &ls->load);686686- ls->delta_stat = 0;687687- }688688-}689689-690690-/*691691- * Update delta_exec, delta_fair fields for rq.692692- *693693- * delta_fair clock advances at a rate inversely proportional to694694- * total load (rq->ls.load.weight) on the runqueue, while695695- * delta_exec advances at the same rate as wall-clock (provided696696- * cpu is not idle).697697- *698698- * delta_exec / delta_fair is a measure of the (smoothened) load on this699699- * runqueue over any given interval. This (smoothened) load is used700700- * during load balance.701701- *702702- * This function is called /before/ updating rq->ls.load703703- * and when switching tasks.704704- */705705-static void update_curr_load(struct rq *rq, u64 now)706706-{707707- struct load_stat *ls = &rq->ls;708708- u64 start;709709-710710- start = ls->load_update_start;711711- ls->load_update_start = now;712712- ls->delta_stat += now - start;713713- /*714714- * Stagger updates to ls->delta_fair. Very frequent updates715715- * can be expensive.716716- */717717- if (ls->delta_stat >= sysctl_sched_stat_granularity)718718- __update_curr_load(rq, ls);719719-}720720-721681/*722682 * To aid in avoiding the subversion of "niceness" due to uneven distribution723683 * of tasks with abnormal "nice" values across CPUs the contribution that···686726 * scaled version of the new time slice allocation that they receive on time687727 * slice expiry etc.688728 */689689-690690-/*691691- * Assume: static_prio_timeslice(NICE_TO_PRIO(0)) == DEF_TIMESLICE692692- * If static_prio_timeslice() is ever changed to break this assumption then693693- * this code will need modification694694- */695695-#define TIME_SLICE_NICE_ZERO DEF_TIMESLICE696696-#define load_weight(lp) \697697- (((lp) * SCHED_LOAD_SCALE) / TIME_SLICE_NICE_ZERO)698698-#define PRIO_TO_LOAD_WEIGHT(prio) \699699- load_weight(static_prio_timeslice(prio))700700-#define RTPRIO_TO_LOAD_WEIGHT(rp) \701701- (PRIO_TO_LOAD_WEIGHT(MAX_RT_PRIO) + load_weight(rp))702729703730#define WEIGHT_IDLEPRIO 2704731#define WMULT_IDLEPRIO (1 << 31)···728781/* 15 */ 119304647, 148102320, 186737708, 238609294, 286331153,729782};730783731731-static inline void732732-inc_load(struct rq *rq, const struct task_struct *p, u64 now)733733-{734734- update_curr_load(rq, now);735735- update_load_add(&rq->ls.load, p->se.load.weight);736736-}737737-738738-static inline void739739-dec_load(struct rq *rq, const struct task_struct *p, u64 now)740740-{741741- update_curr_load(rq, now);742742- update_load_sub(&rq->ls.load, p->se.load.weight);743743-}744744-745745-static inline void inc_nr_running(struct task_struct *p, struct rq *rq, u64 now)746746-{747747- rq->nr_running++;748748- inc_load(rq, p, now);749749-}750750-751751-static inline void dec_nr_running(struct task_struct *p, struct rq *rq, u64 now)752752-{753753- rq->nr_running--;754754- dec_load(rq, p, now);755755-}756756-757784static void activate_task(struct rq *rq, struct task_struct *p, int wakeup);758785759786/*···757836#endif758837759838#define sched_class_highest (&rt_sched_class)839839+840840+static void __update_curr_load(struct rq *rq, struct load_stat *ls)841841+{842842+ if (rq->curr != rq->idle && ls->load.weight) {843843+ ls->delta_exec += ls->delta_stat;844844+ ls->delta_fair += calc_delta_fair(ls->delta_stat, &ls->load);845845+ ls->delta_stat = 0;846846+ }847847+}848848+849849+/*850850+ * Update delta_exec, delta_fair fields for rq.851851+ *852852+ * delta_fair clock advances at a rate inversely proportional to853853+ * total load (rq->ls.load.weight) on the runqueue, while854854+ * delta_exec advances at the same rate as wall-clock (provided855855+ * cpu is not idle).856856+ *857857+ * delta_exec / delta_fair is a measure of the (smoothened) load on this858858+ * runqueue over any given interval. This (smoothened) load is used859859+ * during load balance.860860+ *861861+ * This function is called /before/ updating rq->ls.load862862+ * and when switching tasks.863863+ */864864+static void update_curr_load(struct rq *rq, u64 now)865865+{866866+ struct load_stat *ls = &rq->ls;867867+ u64 start;868868+869869+ start = ls->load_update_start;870870+ ls->load_update_start = now;871871+ ls->delta_stat += now - start;872872+ /*873873+ * Stagger updates to ls->delta_fair. Very frequent updates874874+ * can be expensive.875875+ */876876+ if (ls->delta_stat >= sysctl_sched_stat_granularity)877877+ __update_curr_load(rq, ls);878878+}879879+880880+static inline void881881+inc_load(struct rq *rq, const struct task_struct *p, u64 now)882882+{883883+ update_curr_load(rq, now);884884+ update_load_add(&rq->ls.load, p->se.load.weight);885885+}886886+887887+static inline void888888+dec_load(struct rq *rq, const struct task_struct *p, u64 now)889889+{890890+ update_curr_load(rq, now);891891+ update_load_sub(&rq->ls.load, p->se.load.weight);892892+}893893+894894+static void inc_nr_running(struct task_struct *p, struct rq *rq, u64 now)895895+{896896+ rq->nr_running++;897897+ inc_load(rq, p, now);898898+}899899+900900+static void dec_nr_running(struct task_struct *p, struct rq *rq, u64 now)901901+{902902+ rq->nr_running--;903903+ dec_load(rq, p, now);904904+}760905761906static void set_load_weight(struct task_struct *p)762907{···983996 u64 clock_offset, fair_clock_offset;984997985998 clock_offset = old_rq->clock - new_rq->clock;986986- fair_clock_offset = old_rq->cfs.fair_clock -987987- new_rq->cfs.fair_clock;988988- if (p->se.wait_start)989989- p->se.wait_start -= clock_offset;999999+ fair_clock_offset = old_rq->cfs.fair_clock - new_rq->cfs.fair_clock;10001000+9901001 if (p->se.wait_start_fair)9911002 p->se.wait_start_fair -= fair_clock_offset;10031003+ if (p->se.sleep_start_fair)10041004+ p->se.sleep_start_fair -= fair_clock_offset;10051005+10061006+#ifdef CONFIG_SCHEDSTATS10071007+ if (p->se.wait_start)10081008+ p->se.wait_start -= clock_offset;9921009 if (p->se.sleep_start)9931010 p->se.sleep_start -= clock_offset;9941011 if (p->se.block_start)9951012 p->se.block_start -= clock_offset;996996- if (p->se.sleep_start_fair)997997- p->se.sleep_start_fair -= fair_clock_offset;10131013+#endif99810149991015 __set_task_cpu(p, new_cpu);10001016}···15581568static void __sched_fork(struct task_struct *p)15591569{15601570 p->se.wait_start_fair = 0;15611561- p->se.wait_start = 0;15621571 p->se.exec_start = 0;15631572 p->se.sum_exec_runtime = 0;15641573 p->se.delta_exec = 0;15651574 p->se.delta_fair_run = 0;15661575 p->se.delta_fair_sleep = 0;15671576 p->se.wait_runtime = 0;15771577+ p->se.sleep_start_fair = 0;15781578+15791579+#ifdef CONFIG_SCHEDSTATS15801580+ p->se.wait_start = 0;15681581 p->se.sum_wait_runtime = 0;15691582 p->se.sum_sleep_runtime = 0;15701583 p->se.sleep_start = 0;15711571- p->se.sleep_start_fair = 0;15721584 p->se.block_start = 0;15731585 p->se.sleep_max = 0;15741586 p->se.block_max = 0;···15781586 p->se.wait_max = 0;15791587 p->se.wait_runtime_overruns = 0;15801588 p->se.wait_runtime_underruns = 0;15891589+#endif1581159015821591 INIT_LIST_HEAD(&p->run_list);15831592 p->se.on_rq = 0;···16471654 unsigned long flags;16481655 struct rq *rq;16491656 int this_cpu;16571657+ u64 now;1650165816511659 rq = task_rq_lock(p, &flags);16521660 BUG_ON(p->state != TASK_RUNNING);16531661 this_cpu = smp_processor_id(); /* parent's CPU */16621662+ now = rq_clock(rq);1654166316551664 p->prio = effective_prio(p);1656166516571657- if (!sysctl_sched_child_runs_first || (clone_flags & CLONE_VM) ||16581658- task_cpu(p) != this_cpu || !current->se.on_rq) {16661666+ if (!p->sched_class->task_new || !sysctl_sched_child_runs_first ||16671667+ (clone_flags & CLONE_VM) || task_cpu(p) != this_cpu ||16681668+ !current->se.on_rq) {16691669+16591670 activate_task(rq, p, 0);16601671 } else {16611672 /*16621673 * Let the scheduling class do new task startup16631674 * management (if any):16641675 */16651665- p->sched_class->task_new(rq, p);16761676+ p->sched_class->task_new(rq, p, now);16771677+ inc_nr_running(p, rq, now);16661678 }16671679 check_preempt_curr(rq, p);16681680 task_rq_unlock(rq, &flags);···29062908 schedstat_inc(sd, alb_cnt);2907290929082910 if (move_tasks(target_rq, target_cpu, busiest_rq, 1,29092909- RTPRIO_TO_LOAD_WEIGHT(100), sd, CPU_IDLE,29102910- NULL))29112911+ ULONG_MAX, sd, CPU_IDLE, NULL))29112912 schedstat_inc(sd, alb_pushed);29122913 else29132914 schedstat_inc(sd, alb_failed);···52665269 sizeof(int), 0644, proc_dointvec_minmax);52675270 set_table_entry(&table[8], 9, "imbalance_pct", &sd->imbalance_pct,52685271 sizeof(int), 0644, proc_dointvec_minmax);52695269- set_table_entry(&table[9], 10, "cache_hot_time", &sd->cache_hot_time,52705270- sizeof(long long), 0644, proc_doulongvec_minmax);52715272 set_table_entry(&table[10], 11, "cache_nice_tries",52725273 &sd->cache_nice_tries,52735274 sizeof(int), 0644, proc_dointvec_minmax);···65856590 do_each_thread(g, p) {65866591 p->se.fair_key = 0;65876592 p->se.wait_runtime = 0;65886588- p->se.wait_start_fair = 0;65896589- p->se.wait_start = 0;65906593 p->se.exec_start = 0;65916591- p->se.sleep_start = 0;65946594+ p->se.wait_start_fair = 0;65926595 p->se.sleep_start_fair = 0;65966596+#ifdef CONFIG_SCHEDSTATS65976597+ p->se.wait_start = 0;65986598+ p->se.sleep_start = 0;65936599 p->se.block_start = 0;66006600+#endif65946601 task_rq(p)->cfs.fair_clock = 0;65956602 task_rq(p)->clock = 0;65966603
···116116}117117# define schedstat_inc(rq, field) do { (rq)->field++; } while (0)118118# define schedstat_add(rq, field, amt) do { (rq)->field += (amt); } while (0)119119+# define schedstat_set(var, val) do { var = (val); } while (0)119120#else /* !CONFIG_SCHEDSTATS */120121static inline void121122rq_sched_info_arrive(struct rq *rq, unsigned long long delta)···126125{}127126# define schedstat_inc(rq, field) do { } while (0)128127# define schedstat_add(rq, field, amt) do { } while (0)128128+# define schedstat_set(var, val) do { } while (0)129129#endif130130131131#if defined(CONFIG_SCHEDSTATS) || defined(CONFIG_TASK_DELAY_ACCT)