diff -Nurp linux-2.6.11-ck9/arch/x86_64/kernel/apic.c linux-2.6.11-ck10/arch/x86_64/kernel/apic.c --- linux-2.6.11-ck9/arch/x86_64/kernel/apic.c 2005-03-02 19:30:25.000000000 +1100 +++ linux-2.6.11-ck10/arch/x86_64/kernel/apic.c 2005-06-12 21:16:05.000000000 +1000 @@ -775,9 +775,7 @@ void __init setup_boot_APIC_clock (void) void __init setup_secondary_APIC_clock(void) { - local_irq_disable(); /* FIXME: Do we need this? --RR */ setup_APIC_timer(calibration_result); - local_irq_enable(); } void __init disable_APIC_timer(void) diff -Nurp linux-2.6.11-ck9/arch/x86_64/kernel/ptrace.c linux-2.6.11-ck10/arch/x86_64/kernel/ptrace.c --- linux-2.6.11-ck9/arch/x86_64/kernel/ptrace.c 2005-05-28 20:00:01.000000000 +1000 +++ linux-2.6.11-ck10/arch/x86_64/kernel/ptrace.c 2005-06-12 21:16:05.000000000 +1000 @@ -252,7 +252,7 @@ asmlinkage long sys_ptrace(long request, break; switch (addr) { - case 0 ... sizeof(struct user_regs_struct): + case 0 ... sizeof(struct user_regs_struct) - sizeof(long): tmp = getreg(child, addr); break; case offsetof(struct user, u_debugreg[0]): @@ -297,7 +297,7 @@ asmlinkage long sys_ptrace(long request, break; switch (addr) { - case 0 ... sizeof(struct user_regs_struct): + case 0 ... sizeof(struct user_regs_struct) - sizeof(long): ret = putreg(child, addr, data); break; /* Disallows to set a breakpoint into the vsyscall */ diff -Nurp linux-2.6.11-ck9/arch/x86_64/kernel/smpboot.c linux-2.6.11-ck10/arch/x86_64/kernel/smpboot.c --- linux-2.6.11-ck9/arch/x86_64/kernel/smpboot.c 2005-03-02 19:30:25.000000000 +1100 +++ linux-2.6.11-ck10/arch/x86_64/kernel/smpboot.c 2005-06-12 21:16:05.000000000 +1000 @@ -309,8 +309,6 @@ void __init smp_callin(void) Dprintk("CALLIN, before setup_local_APIC().\n"); setup_local_APIC(); - local_irq_enable(); - /* * Get our bogomips. */ @@ -324,8 +322,6 @@ void __init smp_callin(void) */ smp_store_cpu_info(cpuid); - local_irq_disable(); - /* * Allow the master to continue. */ diff -Nurp linux-2.6.11-ck9/drivers/media/video/bttv-cards.c linux-2.6.11-ck10/drivers/media/video/bttv-cards.c --- linux-2.6.11-ck9/drivers/media/video/bttv-cards.c 2005-05-28 20:00:01.000000000 +1000 +++ linux-2.6.11-ck10/drivers/media/video/bttv-cards.c 2005-06-12 21:16:05.000000000 +1000 @@ -1939,7 +1939,6 @@ struct tvcard bttv_tvcards[] = { .no_tda9875 = 1, .no_tda7432 = 1, .tuner_type = TUNER_ABSENT, - .no_video = 1, .pll = PLL_28, },{ .name = "Teppro TEV-560/InterVision IV-560", diff -Nurp linux-2.6.11-ck9/fs/hfs/mdb.c linux-2.6.11-ck10/fs/hfs/mdb.c --- linux-2.6.11-ck9/fs/hfs/mdb.c 2004-12-25 10:14:50.000000000 +1100 +++ linux-2.6.11-ck10/fs/hfs/mdb.c 2005-06-12 21:16:05.000000000 +1000 @@ -333,6 +333,8 @@ void hfs_mdb_close(struct super_block *s * Release the resources associated with the in-core MDB. */ void hfs_mdb_put(struct super_block *sb) { + if (!HFS_SB(sb)) + return; /* free the B-trees */ hfs_btree_close(HFS_SB(sb)->ext_tree); hfs_btree_close(HFS_SB(sb)->cat_tree); @@ -340,4 +342,7 @@ void hfs_mdb_put(struct super_block *sb) /* free the buffers holding the primary and alternate MDBs */ brelse(HFS_SB(sb)->mdb_bh); brelse(HFS_SB(sb)->alt_mdb_bh); + + kfree(HFS_SB(sb)); + sb->s_fs_info = NULL; } diff -Nurp linux-2.6.11-ck9/fs/hfs/super.c linux-2.6.11-ck10/fs/hfs/super.c --- linux-2.6.11-ck9/fs/hfs/super.c 2004-12-25 10:14:50.000000000 +1100 +++ linux-2.6.11-ck10/fs/hfs/super.c 2005-06-12 21:16:05.000000000 +1000 @@ -263,7 +263,7 @@ static int hfs_fill_super(struct super_b res = -EINVAL; if (!parse_options((char *)data, sbi)) { hfs_warn("hfs_fs: unable to parse mount options.\n"); - goto bail3; + goto bail; } sb->s_op = &hfs_super_operations; @@ -276,7 +276,7 @@ static int hfs_fill_super(struct super_b hfs_warn("VFS: Can't find a HFS filesystem on dev %s.\n", hfs_mdb_name(sb)); res = -EINVAL; - goto bail2; + goto bail; } /* try to get the root inode */ @@ -306,10 +306,8 @@ bail_iput: iput(root_inode); bail_no_root: hfs_warn("hfs_fs: get root inode failed.\n"); +bail: hfs_mdb_put(sb); -bail2: -bail3: - kfree(sbi); return res; } diff -Nurp linux-2.6.11-ck9/fs/hfsplus/super.c linux-2.6.11-ck10/fs/hfsplus/super.c --- linux-2.6.11-ck9/fs/hfsplus/super.c 2004-12-25 10:14:50.000000000 +1100 +++ linux-2.6.11-ck10/fs/hfsplus/super.c 2005-06-12 21:16:05.000000000 +1000 @@ -207,7 +207,9 @@ static void hfsplus_write_super(struct s static void hfsplus_put_super(struct super_block *sb) { dprint(DBG_SUPER, "hfsplus_put_super\n"); - if (!(sb->s_flags & MS_RDONLY)) { + if (!sb->s_fs_info) + return; + if (!(sb->s_flags & MS_RDONLY) && HFSPLUS_SB(sb).s_vhdr) { struct hfsplus_vh *vhdr = HFSPLUS_SB(sb).s_vhdr; vhdr->modify_date = hfsp_now2mt(); @@ -223,6 +225,8 @@ static void hfsplus_put_super(struct sup iput(HFSPLUS_SB(sb).alloc_file); iput(HFSPLUS_SB(sb).hidden_dir); brelse(HFSPLUS_SB(sb).s_vhbh); + kfree(sb->s_fs_info); + sb->s_fs_info = NULL; } static int hfsplus_statfs(struct super_block *sb, struct kstatfs *buf) diff -Nurp linux-2.6.11-ck9/fs/jbd/checkpoint.c linux-2.6.11-ck10/fs/jbd/checkpoint.c --- linux-2.6.11-ck9/fs/jbd/checkpoint.c 2005-03-02 19:30:28.000000000 +1100 +++ linux-2.6.11-ck10/fs/jbd/checkpoint.c 2005-06-12 21:16:05.000000000 +1000 @@ -339,8 +339,10 @@ int log_do_checkpoint(journal_t *journal } } while (jh != last_jh && !retry); - if (batch_count) + if (batch_count) { __flush_batch(journal, bhs, &batch_count); + retry = 1; + } /* * If someone cleaned up this transaction while we slept, we're diff -Nurp linux-2.6.11-ck9/fs/pipe.c linux-2.6.11-ck10/fs/pipe.c --- linux-2.6.11-ck9/fs/pipe.c 2005-03-02 19:30:29.000000000 +1100 +++ linux-2.6.11-ck10/fs/pipe.c 2005-06-12 21:16:05.000000000 +1000 @@ -39,7 +39,11 @@ void pipe_wait(struct inode * inode) { DEFINE_WAIT(wait); - prepare_to_wait(PIPE_WAIT(*inode), &wait, TASK_INTERRUPTIBLE); + /* + * Pipes are system-local resources, so sleeping on them + * is considered a noninteractive wait: + */ + prepare_to_wait(PIPE_WAIT(*inode), &wait, TASK_INTERRUPTIBLE|TASK_NONINTERACTIVE); up(PIPE_SEM(*inode)); schedule(); finish_wait(PIPE_WAIT(*inode), &wait); diff -Nurp linux-2.6.11-ck9/include/linux/sched.h linux-2.6.11-ck10/include/linux/sched.h --- linux-2.6.11-ck9/include/linux/sched.h 2005-05-28 20:00:01.000000000 +1000 +++ linux-2.6.11-ck10/include/linux/sched.h 2005-06-12 21:16:05.000000000 +1000 @@ -110,6 +110,7 @@ extern unsigned long nr_iowait(void); #define TASK_TRACED 8 #define EXIT_ZOMBIE 16 #define EXIT_DEAD 32 +#define TASK_NONINTERACTIVE 64 #define __set_task_state(tsk, state_value) \ do { (tsk)->state = (state_value); } while (0) @@ -749,9 +750,8 @@ do { if (atomic_dec_and_test(&(tsk)->usa #define PF_LESS_THROTTLE 0x00100000 /* Throttle me less: I clean memory */ #define PF_SYNCWRITE 0x00200000 /* I am doing a sync write */ #define PF_BORROWED_MM 0x00400000 /* I am a kthread doing use_mm */ -#define PF_FORKED 0x00800000 /* I have just forked */ +#define PF_NONSLEEP 0x00800000 /* Waiting on in kernel activity */ #define PF_YIELDED 0x01000000 /* I have just yielded */ -#define PF_UISLEEP 0x02000000 /* Uninterruptible sleep */ /* * Only the _current_ task can read/write to tsk->flags, but other diff -Nurp linux-2.6.11-ck9/kernel/power/process.c linux-2.6.11-ck10/kernel/power/process.c --- linux-2.6.11-ck9/kernel/power/process.c 2005-05-28 20:00:01.000000000 +1000 +++ linux-2.6.11-ck10/kernel/power/process.c 2005-06-12 21:16:05.000000000 +1000 @@ -69,7 +69,7 @@ int freeze_processes(void) do_each_thread(g, p) { unsigned long flags; if (batch_task(p)) - p->flags |= PF_UISLEEP; + p->flags |= PF_NONSLEEP; /* * This will make batch tasks scheduler as * SCHED_NORMAL to allow them to be frozen. diff -Nurp linux-2.6.11-ck9/kernel/sched.c linux-2.6.11-ck10/kernel/sched.c --- linux-2.6.11-ck9/kernel/sched.c 2005-05-28 20:00:01.000000000 +1000 +++ linux-2.6.11-ck10/kernel/sched.c 2005-06-12 21:16:05.000000000 +1000 @@ -16,9 +16,9 @@ * by Davide Libenzi, preemptible kernel bits by Robert Love. * 2003-09-03 Interactivity tuning by Con Kolivas. * 2004-04-02 Scheduler domains code by Nick Piggin - * 2005-04-20 New staircase scheduling policy by Con Kolivas with help + * 2005-06-07 New staircase scheduling policy by Con Kolivas with help * from William Lee Irwin III, Zwane Mwaikambo & Peter Williams. - * Staircase v11.2 + * Staircase v11.3 */ #include @@ -123,7 +123,6 @@ struct runqueue { * it on another CPU. Always updated under the runqueue lock: */ unsigned long nr_uninterruptible; - unsigned long systime_centile; unsigned long long timestamp_last_tick; unsigned int cache_ticks, preempted; @@ -662,7 +661,7 @@ static int effective_prio(task_t *p) if (rt_task(p)) return p->prio; if (batch_task(p)) { - if (unlikely(p->flags & PF_UISLEEP)) { + if (unlikely(p->flags & PF_NONSLEEP)) { /* * If batch is waking up from uninterruptible sleep * reschedule at a normal priority to begin with. @@ -714,30 +713,28 @@ static void continue_slice(task_t *p) * slice instead of starting a new one at high priority. */ static inline void recalc_task_prio(task_t *p, unsigned long long now, - unsigned long rq_systime, unsigned long rq_running) + unsigned long rq_running) { unsigned long sleep_time = ns_diff(now, p->timestamp); /* * Priority is elevated back to best by amount of sleep_time. - * sleep_time is scaled down by in-kernel system time and by - * number of tasks currently running. + * sleep_time is scaled down by number of tasks currently running. */ - sleep_time /= rq_running + 1; - if (rq_systime) - sleep_time = sleep_time / 200 * (100 - rq_systime); + if (rq_running > 1) + sleep_time /= rq_running; p->totalrun += p->runtime; if (NS_TO_JIFFIES(p->totalrun) >= p->slice && NS_TO_JIFFIES(sleep_time) < p->slice) { - p->flags &= ~PF_FORKED; + p->flags &= ~PF_NONSLEEP; dec_burst(p); goto new_slice; } - if (p->flags & PF_FORKED) { + if (p->flags & PF_NONSLEEP) { continue_slice(p); - p->flags &= ~PF_FORKED; + p->flags &= ~PF_NONSLEEP; goto out; } @@ -747,7 +744,7 @@ static inline void recalc_task_prio(task } if (sleep_time >= p->totalrun) { - if (!(p->flags & PF_UISLEEP)) + if (!(p->flags & PF_NONSLEEP)) inc_burst(p); goto new_slice; } @@ -780,8 +777,8 @@ static void activate_task(task_t *p, run #endif p->slice = slice(p); p->time_slice = rr_interval(p); - recalc_task_prio(p, now, rq->systime_centile / 100, rq->nr_running); - p->flags &= ~PF_UISLEEP; + recalc_task_prio(p, now, rq->nr_running); + p->flags &= ~PF_NONSLEEP; p->prio = effective_prio(p); p->timestamp = now; __activate_task(p, rq); @@ -947,7 +944,7 @@ static inline unsigned long __source_loa source_load = min(cpu_load, load_now); - if (idle == NOT_IDLE || rq->nr_running > 1) + if (rq->nr_running > 1 || (idle == NOT_IDLE && rq->nr_running)) /* * If we are busy rebalancing the load is biased by * priority to create 'nice' support across cpus. When @@ -956,7 +953,7 @@ static inline unsigned long __source_loa * prevent idle rebalance from trying to pull tasks from a * queue with only one running task. */ - source_load *= rq->prio_bias; + source_load = source_load * rq->prio_bias / rq->nr_running; return source_load; } @@ -977,8 +974,8 @@ static inline unsigned long __target_loa target_load = max(cpu_load, load_now); - if (idle == NOT_IDLE || rq->nr_running > 1) - target_load *= rq->prio_bias; + if (rq->nr_running > 1 || (idle == NOT_IDLE && rq->nr_running)) + target_load = target_load * rq->prio_bias / rq->nr_running; return target_load; } @@ -1171,6 +1168,13 @@ out_activate: rq->nr_uninterruptible--; /* + * Tasks that have marked their sleep as noninteractive get + * woken up without their sleep counting. + */ + if (old_state & TASK_NONINTERACTIVE) + p->flags |= PF_NONSLEEP; + + /* * Sync wakeups (i.e. those types of wakeups where the waker * has indicated that it will leave the CPU in short order) * don't trigger a preemption, if the woken up task will run on @@ -1265,7 +1269,7 @@ void fastcall wake_up_new_task(task_t * p->burst = 0; if (likely(cpu == this_cpu)) { - current->flags |= PF_FORKED; + current->flags |= PF_NONSLEEP; activate_task(p, rq, 1); if (!(clone_flags & CLONE_VM)) /* @@ -1300,7 +1304,7 @@ void fastcall wake_up_new_task(task_t * */ task_rq_unlock(rq, &flags); this_rq = task_rq_lock(current, &flags); - current->flags |= PF_FORKED; + current->flags |= PF_NONSLEEP; } task_rq_unlock(this_rq, &flags); } @@ -2332,9 +2336,6 @@ void account_system_time(struct task_str cpustat->iowait = cputime64_add(cpustat->iowait, tmp); else cpustat->idle = cputime64_add(cpustat->idle, tmp); - - /* For calculating rolling percentage of sys time per runqueue */ - rq->systime_centile += cputime * 100; } /* @@ -2380,9 +2381,6 @@ void scheduler_tick(void) rq->timestamp_last_tick = sched_clock(); - /* Rolling percentage systime per runqueue */ - rq->systime_centile = rq->systime_centile * 99 / 100; - if (p == rq->idle) { if (wake_priority_sleeper(rq)) goto out; @@ -2657,7 +2655,7 @@ need_resched_nonpreemptible: prev->state = TASK_RUNNING; else { if (prev->state == TASK_UNINTERRUPTIBLE) { - prev->flags |= PF_UISLEEP; + prev->flags |= PF_NONSLEEP; rq->nr_uninterruptible++; } deactivate_task(prev, rq); diff -Nurp linux-2.6.11-ck9/Makefile linux-2.6.11-ck10/Makefile --- linux-2.6.11-ck9/Makefile 2005-05-28 20:00:01.000000000 +1000 +++ linux-2.6.11-ck10/Makefile 2005-06-12 21:16:05.000000000 +1000 @@ -1,7 +1,7 @@ VERSION = 2 PATCHLEVEL = 6 SUBLEVEL = 11 -EXTRAVERSION = -ck9 +EXTRAVERSION = -ck10 NAME=Cognac Woozy Numbat # *DOCUMENTATION* diff -Nurp linux-2.6.11-ck9/mm/rmap.c linux-2.6.11-ck10/mm/rmap.c --- linux-2.6.11-ck9/mm/rmap.c 2005-03-02 19:30:30.000000000 +1100 +++ linux-2.6.11-ck10/mm/rmap.c 2005-06-12 21:16:05.000000000 +1000 @@ -641,7 +641,7 @@ static void try_to_unmap_cluster(unsigne pgd_t *pgd; pud_t *pud; pmd_t *pmd; - pte_t *pte; + pte_t *pte, *original_pte; pte_t pteval; struct page *page; unsigned long address; @@ -673,7 +673,7 @@ static void try_to_unmap_cluster(unsigne if (!pmd_present(*pmd)) goto out_unlock; - for (pte = pte_offset_map(pmd, address); + for (original_pte = pte = pte_offset_map(pmd, address); address < end; pte++, address += PAGE_SIZE) { if (!pte_present(*pte)) @@ -710,7 +710,7 @@ static void try_to_unmap_cluster(unsigne (*mapcount)--; } - pte_unmap(pte); + pte_unmap(original_pte); out_unlock: spin_unlock(&mm->page_table_lock); diff -Nurp linux-2.6.11-ck9/net/bridge/br_input.c linux-2.6.11-ck10/net/bridge/br_input.c --- linux-2.6.11-ck9/net/bridge/br_input.c 2004-10-19 08:57:12.000000000 +1000 +++ linux-2.6.11-ck10/net/bridge/br_input.c 2005-06-12 21:16:05.000000000 +1000 @@ -54,6 +54,9 @@ int br_handle_frame_finish(struct sk_buf struct net_bridge_fdb_entry *dst; int passedup = 0; + /* insert into forwarding database after filtering to avoid spoofing */ + br_fdb_insert(p->br, p, eth_hdr(skb)->h_source, 0); + if (br->dev->flags & IFF_PROMISC) { struct sk_buff *skb2; @@ -108,8 +111,7 @@ int br_handle_frame(struct net_bridge_po if (eth_hdr(skb)->h_source[0] & 1) goto err; - if (p->state == BR_STATE_LEARNING || - p->state == BR_STATE_FORWARDING) + if (p->state == BR_STATE_LEARNING) br_fdb_insert(p->br, p, eth_hdr(skb)->h_source, 0); if (p->br->stp_enabled && diff -Nurp linux-2.6.11-ck9/net/bridge/br_stp_bpdu.c linux-2.6.11-ck10/net/bridge/br_stp_bpdu.c --- linux-2.6.11-ck9/net/bridge/br_stp_bpdu.c 2004-05-23 12:54:59.000000000 +1000 +++ linux-2.6.11-ck10/net/bridge/br_stp_bpdu.c 2005-06-12 21:16:05.000000000 +1000 @@ -140,6 +140,9 @@ int br_stp_handle_bpdu(struct sk_buff *s struct net_bridge *br = p->br; unsigned char *buf; + /* insert into forwarding database after filtering to avoid spoofing */ + br_fdb_insert(p->br, p, eth_hdr(skb)->h_source, 0); + /* need at least the 802 and STP headers */ if (!pskb_may_pull(skb, sizeof(header)+1) || memcmp(skb->data, header, sizeof(header))) diff -Nurp linux-2.6.11-ck9/net/ipv4/netfilter/ip_queue.c linux-2.6.11-ck10/net/ipv4/netfilter/ip_queue.c --- linux-2.6.11-ck9/net/ipv4/netfilter/ip_queue.c 2005-03-02 19:30:30.000000000 +1100 +++ linux-2.6.11-ck10/net/ipv4/netfilter/ip_queue.c 2005-06-12 21:16:05.000000000 +1000 @@ -3,6 +3,7 @@ * communicating with userspace via netlink. * * (C) 2000-2002 James Morris + * (C) 2003-2005 Netfilter Core Team * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 as @@ -14,6 +15,7 @@ * Zander). * 2000-08-01: Added Nick Williams' MAC support. * 2002-06-25: Code cleanup. + * 2005-05-26: local_bh_{disable,enable} around nf_reinject (Harald Welte) * */ #include @@ -66,7 +68,15 @@ static DECLARE_MUTEX(ipqnl_sem); static void ipq_issue_verdict(struct ipq_queue_entry *entry, int verdict) { + /* TCP input path (and probably other bits) assume to be called + * from softirq context, not from syscall, like ipq_issue_verdict is + * called. TCP input path deadlocks with locks taken from timer + * softirq, e.g. We therefore emulate this by local_bh_disable() */ + + local_bh_disable(); nf_reinject(entry->skb, entry->info, verdict); + local_bh_enable(); + kfree(entry); } diff -Nurp linux-2.6.11-ck9/net/sched/sch_netem.c linux-2.6.11-ck10/net/sched/sch_netem.c --- linux-2.6.11-ck9/net/sched/sch_netem.c 2005-03-02 19:30:30.000000000 +1100 +++ linux-2.6.11-ck10/net/sched/sch_netem.c 2005-06-12 21:16:05.000000000 +1000 @@ -184,10 +184,15 @@ static int netem_enqueue(struct sk_buff /* Random duplication */ if (q->duplicate && q->duplicate >= get_crandom(&q->dup_cor)) { struct sk_buff *skb2 = skb_clone(skb, GFP_ATOMIC); - - pr_debug("netem_enqueue: dup %p\n", skb2); - if (skb2) - delay_skb(sch, skb2); + if (skb2) { + struct Qdisc *rootq = sch->dev->qdisc; + u32 dupsave = q->duplicate; + + /* prevent duplicating a dup... */ + q->duplicate = 0; + rootq->enqueue(skb2, rootq); + q->duplicate = dupsave; + } } /* If doing simple delay then gap == 0 so all packets