From: Greg Kroah-Hartman Date: Thu, 29 Jul 2010 00:16:29 +0000 (-0700) Subject: .33 patches X-Git-Tag: v2.6.27.49~14 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=f4574455b7c797ddbd4a255b9ee50f9e27a4c04f;p=thirdparty%2Fkernel%2Fstable-queue.git .33 patches --- diff --git a/queue-2.6.33/acpi-skip-checking-bm_sts-if-the-bios-doesn-t-ask-for-it.patch b/queue-2.6.33/acpi-skip-checking-bm_sts-if-the-bios-doesn-t-ask-for-it.patch new file mode 100644 index 00000000000..36f674604c8 --- /dev/null +++ b/queue-2.6.33/acpi-skip-checking-bm_sts-if-the-bios-doesn-t-ask-for-it.patch @@ -0,0 +1,82 @@ +From 718be4aaf3613cf7c2d097f925abc3d3553c0605 Mon Sep 17 00:00:00 2001 +From: Len Brown +Date: Thu, 22 Jul 2010 16:54:27 -0400 +Subject: ACPI: skip checking BM_STS if the BIOS doesn't ask for it + +From: Len Brown + +commit 718be4aaf3613cf7c2d097f925abc3d3553c0605 upstream. + +It turns out that there is a bit in the _CST for Intel FFH C3 +that tells the OS if we should be checking BM_STS or not. + +Linux has been unconditionally checking BM_STS. +If the chip-set is configured to enable BM_STS, +it can retard or completely prevent entry into +deep C-states -- as illustrated by turbostat: + +http://userweb.kernel.org/~lenb/acpi/utils/pmtools/turbostat/ + +ref: Intel Processor Vendor-Specific ACPI Interface Specification +table 4 "_CST FFH GAS Field Encoding" +Bit 1: Set to 1 if OSPM should use Bus Master avoidance for this C-state + +https://bugzilla.kernel.org/show_bug.cgi?id=15886 + +Signed-off-by: Len Brown +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/acpi/cstate.c | 9 +++++++++ + drivers/acpi/processor_idle.c | 2 +- + include/acpi/processor.h | 3 ++- + 3 files changed, 12 insertions(+), 2 deletions(-) + +--- a/arch/x86/kernel/acpi/cstate.c ++++ b/arch/x86/kernel/acpi/cstate.c +@@ -145,6 +145,15 @@ int acpi_processor_ffh_cstate_probe(unsi + percpu_entry->states[cx->index].eax = cx->address; + percpu_entry->states[cx->index].ecx = MWAIT_ECX_INTERRUPT_BREAK; + } ++ ++ /* ++ * For _CST FFH on Intel, if GAS.access_size bit 1 is cleared, ++ * then we should skip checking BM_STS for this C-state. ++ * ref: "Intel Processor Vendor-Specific ACPI Interface Specification" ++ */ ++ if ((c->x86_vendor == X86_VENDOR_INTEL) && !(reg->access_size & 0x2)) ++ cx->bm_sts_skip = 1; ++ + return retval; + } + EXPORT_SYMBOL_GPL(acpi_processor_ffh_cstate_probe); +--- a/drivers/acpi/processor_idle.c ++++ b/drivers/acpi/processor_idle.c +@@ -954,7 +954,7 @@ static int acpi_idle_enter_bm(struct cpu + if (acpi_idle_suspend) + return(acpi_idle_enter_c1(dev, state)); + +- if (acpi_idle_bm_check()) { ++ if (!cx->bm_sts_skip && acpi_idle_bm_check()) { + if (dev->safe_state) { + dev->last_state = dev->safe_state; + return dev->safe_state->enter(dev, dev->safe_state); +--- a/include/acpi/processor.h ++++ b/include/acpi/processor.h +@@ -48,7 +48,7 @@ struct acpi_power_register { + u8 space_id; + u8 bit_width; + u8 bit_offset; +- u8 reserved; ++ u8 access_size; + u64 address; + } __attribute__ ((packed)); + +@@ -74,6 +74,7 @@ struct acpi_processor_cx { + u32 power; + u32 usage; + u64 time; ++ u8 bm_sts_skip; + struct acpi_processor_cx_policy promotion; + struct acpi_processor_cx_policy demotion; + char desc[ACPI_CX_DESC_LEN]; diff --git a/queue-2.6.33/acpi-unconditionally-set-sci_en-on-resume.patch b/queue-2.6.33/acpi-unconditionally-set-sci_en-on-resume.patch new file mode 100644 index 00000000000..73f8c089f4f --- /dev/null +++ b/queue-2.6.33/acpi-unconditionally-set-sci_en-on-resume.patch @@ -0,0 +1,252 @@ +From b6dacf63e9fb2e7a1369843d6cef332f76fca6a3 Mon Sep 17 00:00:00 2001 +From: Matthew Garrett +Date: Tue, 11 May 2010 13:49:25 -0400 +Subject: ACPI: Unconditionally set SCI_EN on resume + +From: Matthew Garrett + +commit b6dacf63e9fb2e7a1369843d6cef332f76fca6a3 upstream. + +The ACPI spec tells us that the firmware will reenable SCI_EN on resume. +Reality disagrees in some cases. The ACPI spec tells us that the only way +to set SCI_EN is via an SMM call. +https://bugzilla.kernel.org/show_bug.cgi?id=13745 shows us that doing so +may break machines. Tracing the ACPI calls made by Windows shows that it +unconditionally sets SCI_EN on resume with a direct register write, and +therefore the overwhelming probability is that everything is fine with +this behaviour. + +Signed-off-by: Matthew Garrett +Tested-by: Rafael J. Wysocki +Signed-off-by: Len Brown +Cc: Kamal Mostafa +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/kernel/acpi/sleep.c | 2 + drivers/acpi/sleep.c | 157 ------------------------------------------- + include/linux/acpi.h | 1 + 3 files changed, 2 insertions(+), 158 deletions(-) + +--- a/arch/x86/kernel/acpi/sleep.c ++++ b/arch/x86/kernel/acpi/sleep.c +@@ -162,8 +162,6 @@ static int __init acpi_sleep_setup(char + #endif + if (strncmp(str, "old_ordering", 12) == 0) + acpi_old_suspend_ordering(); +- if (strncmp(str, "sci_force_enable", 16) == 0) +- acpi_set_sci_en_on_resume(); + str = strchr(str, ','); + if (str != NULL) + str += strspn(str, ", \t"); +--- a/drivers/acpi/sleep.c ++++ b/drivers/acpi/sleep.c +@@ -80,22 +80,6 @@ static int acpi_sleep_prepare(u32 acpi_s + + #ifdef CONFIG_ACPI_SLEEP + static u32 acpi_target_sleep_state = ACPI_STATE_S0; +-/* +- * According to the ACPI specification the BIOS should make sure that ACPI is +- * enabled and SCI_EN bit is set on wake-up from S1 - S3 sleep states. Still, +- * some BIOSes don't do that and therefore we use acpi_enable() to enable ACPI +- * on such systems during resume. Unfortunately that doesn't help in +- * particularly pathological cases in which SCI_EN has to be set directly on +- * resume, although the specification states very clearly that this flag is +- * owned by the hardware. The set_sci_en_on_resume variable will be set in such +- * cases. +- */ +-static bool set_sci_en_on_resume; +- +-void __init acpi_set_sci_en_on_resume(void) +-{ +- set_sci_en_on_resume = true; +-} + + /* + * ACPI 1.0 wants us to execute _PTS before suspending devices, so we allow the +@@ -253,11 +237,8 @@ static int acpi_suspend_enter(suspend_st + break; + } + +- /* If ACPI is not enabled by the BIOS, we need to enable it here. */ +- if (set_sci_en_on_resume) +- acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1); +- else +- acpi_enable(); ++ /* This violates the spec but is required for bug compatibility. */ ++ acpi_write_bit_register(ACPI_BITREG_SCI_ENABLE, 1); + + /* Reprogram control registers and execute _BFS */ + acpi_leave_sleep_state_prep(acpi_state); +@@ -346,12 +327,6 @@ static int __init init_old_suspend_order + return 0; + } + +-static int __init init_set_sci_en_on_resume(const struct dmi_system_id *d) +-{ +- set_sci_en_on_resume = true; +- return 0; +-} +- + static struct dmi_system_id __initdata acpisleep_dmi_table[] = { + { + .callback = init_old_suspend_ordering, +@@ -370,22 +345,6 @@ static struct dmi_system_id __initdata a + }, + }, + { +- .callback = init_set_sci_en_on_resume, +- .ident = "Apple MacBook 1,1", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."), +- DMI_MATCH(DMI_PRODUCT_NAME, "MacBook1,1"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Apple MacMini 1,1", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Apple Computer, Inc."), +- DMI_MATCH(DMI_PRODUCT_NAME, "Macmini1,1"), +- }, +- }, +- { + .callback = init_old_suspend_ordering, + .ident = "Asus Pundit P1-AH2 (M2N8L motherboard)", + .matches = { +@@ -394,94 +353,6 @@ static struct dmi_system_id __initdata a + }, + }, + { +- .callback = init_set_sci_en_on_resume, +- .ident = "Toshiba Satellite L300", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "TOSHIBA"), +- DMI_MATCH(DMI_PRODUCT_NAME, "Satellite L300"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Hewlett-Packard HP G7000 Notebook PC", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), +- DMI_MATCH(DMI_PRODUCT_NAME, "HP G7000 Notebook PC"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Hewlett-Packard HP Pavilion dv3 Notebook PC", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), +- DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv3 Notebook PC"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Hewlett-Packard Pavilion dv4", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), +- DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv4"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Hewlett-Packard Pavilion dv7", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), +- DMI_MATCH(DMI_PRODUCT_NAME, "HP Pavilion dv7"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Hewlett-Packard Compaq Presario C700 Notebook PC", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), +- DMI_MATCH(DMI_PRODUCT_NAME, "Compaq Presario C700 Notebook PC"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Hewlett-Packard Compaq Presario CQ40 Notebook PC", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Hewlett-Packard"), +- DMI_MATCH(DMI_PRODUCT_NAME, "Compaq Presario CQ40 Notebook PC"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Lenovo ThinkPad T410", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +- DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T410"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Lenovo ThinkPad T510", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +- DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad T510"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Lenovo ThinkPad W510", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +- DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad W510"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Lenovo ThinkPad X201[s]", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "LENOVO"), +- DMI_MATCH(DMI_PRODUCT_VERSION, "ThinkPad X201"), +- }, +- }, +- { + .callback = init_old_suspend_ordering, + .ident = "Panasonic CF51-2L", + .matches = { +@@ -490,30 +361,6 @@ static struct dmi_system_id __initdata a + DMI_MATCH(DMI_BOARD_NAME, "CF51-2L"), + }, + }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Dell Studio 1558", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), +- DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1558"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Dell Studio 1557", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), +- DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1557"), +- }, +- }, +- { +- .callback = init_set_sci_en_on_resume, +- .ident = "Dell Studio 1555", +- .matches = { +- DMI_MATCH(DMI_SYS_VENDOR, "Dell Inc."), +- DMI_MATCH(DMI_PRODUCT_NAME, "Studio 1555"), +- }, +- }, + {}, + }; + #endif /* CONFIG_SUSPEND */ +--- a/include/linux/acpi.h ++++ b/include/linux/acpi.h +@@ -251,7 +251,6 @@ int acpi_check_mem_region(resource_size_ + void __init acpi_no_s4_hw_signature(void); + void __init acpi_old_suspend_ordering(void); + void __init acpi_s4_no_nvs(void); +-void __init acpi_set_sci_en_on_resume(void); + #endif /* CONFIG_PM_SLEEP */ + + struct acpi_osc_context { diff --git a/queue-2.6.33/futex-futex_find_get_task-remove-credentails-check.patch b/queue-2.6.33/futex-futex_find_get_task-remove-credentails-check.patch new file mode 100644 index 00000000000..89d8f552c30 --- /dev/null +++ b/queue-2.6.33/futex-futex_find_get_task-remove-credentails-check.patch @@ -0,0 +1,82 @@ +From 7a0ea09ad5352efce8fe79ed853150449903b9f5 Mon Sep 17 00:00:00 2001 +From: Michal Hocko +Date: Wed, 30 Jun 2010 09:51:19 +0200 +Subject: futex: futex_find_get_task remove credentails check + +From: Michal Hocko + +commit 7a0ea09ad5352efce8fe79ed853150449903b9f5 upstream. + +futex_find_get_task is currently used (through lookup_pi_state) from two +contexts, futex_requeue and futex_lock_pi_atomic. None of the paths +looks it needs the credentials check, though. Different (e)uids +shouldn't matter at all because the only thing that is important for +shared futex is the accessibility of the shared memory. + +The credentail check results in glibc assert failure or process hang (if +glibc is compiled without assert support) for shared robust pthread +mutex with priority inheritance if a process tries to lock already held +lock owned by a process with a different euid: + +pthread_mutex_lock.c:312: __pthread_mutex_lock_full: Assertion `(-(e)) != 3 || !robust' failed. + +The problem is that futex_lock_pi_atomic which is called when we try to +lock already held lock checks the current holder (tid is stored in the +futex value) to get the PI state. It uses lookup_pi_state which in turn +gets task struct from futex_find_get_task. ESRCH is returned either +when the task is not found or if credentials check fails. + +futex_lock_pi_atomic simply returns if it gets ESRCH. glibc code, +however, doesn't expect that robust lock returns with ESRCH because it +should get either success or owner died. + +Signed-off-by: Michal Hocko +Acked-by: Darren Hart +Cc: Ingo Molnar +Cc: Thomas Gleixner +Cc: Nick Piggin +Cc: Alexey Kuznetsov +Cc: Peter Zijlstra +Signed-off-by: Linus Torvalds +Signed-off-by: Greg Kroah-Hartman + +--- + kernel/futex.c | 17 ++++------------- + 1 file changed, 4 insertions(+), 13 deletions(-) + +--- a/kernel/futex.c ++++ b/kernel/futex.c +@@ -429,20 +429,11 @@ static void free_pi_state(struct futex_p + static struct task_struct * futex_find_get_task(pid_t pid) + { + struct task_struct *p; +- const struct cred *cred = current_cred(), *pcred; + + rcu_read_lock(); + p = find_task_by_vpid(pid); +- if (!p) { +- p = ERR_PTR(-ESRCH); +- } else { +- pcred = __task_cred(p); +- if (cred->euid != pcred->euid && +- cred->euid != pcred->uid) +- p = ERR_PTR(-ESRCH); +- else +- get_task_struct(p); +- } ++ if (p) ++ get_task_struct(p); + + rcu_read_unlock(); + +@@ -564,8 +555,8 @@ lookup_pi_state(u32 uval, struct futex_h + if (!pid) + return -ESRCH; + p = futex_find_get_task(pid); +- if (IS_ERR(p)) +- return PTR_ERR(p); ++ if (!p) ++ return -ESRCH; + + /* + * We need to look at the task state flags to figure out, diff --git a/queue-2.6.33/pm-x86-save-restore-misc_enable-register.patch b/queue-2.6.33/pm-x86-save-restore-misc_enable-register.patch new file mode 100644 index 00000000000..d17e929745d --- /dev/null +++ b/queue-2.6.33/pm-x86-save-restore-misc_enable-register.patch @@ -0,0 +1,69 @@ +From 85a0e7539781dad4bfcffd98e72fa9f130f4e40d Mon Sep 17 00:00:00 2001 +From: Ondrej Zary +Date: Tue, 8 Jun 2010 00:32:49 +0200 +Subject: PM / x86: Save/restore MISC_ENABLE register + +From: Ondrej Zary + +commit 85a0e7539781dad4bfcffd98e72fa9f130f4e40d upstream. + +Save/restore MISC_ENABLE register on suspend/resume. +This fixes OOPS (invalid opcode) on resume from STR on Asus P4P800-VM, +which wakes up with MWAIT disabled. + +Fixes https://bugzilla.kernel.org/show_bug.cgi?id=15385 + +Signed-off-by: Ondrej Zary +Tested-by: Alan Stern +Acked-by: H. Peter Anvin +Signed-off-by: Rafael J. Wysocki +Signed-off-by: Greg Kroah-Hartman + +--- + arch/x86/include/asm/suspend_32.h | 2 ++ + arch/x86/include/asm/suspend_64.h | 2 ++ + arch/x86/power/cpu.c | 4 ++++ + 3 files changed, 8 insertions(+) + +--- a/arch/x86/include/asm/suspend_32.h ++++ b/arch/x86/include/asm/suspend_32.h +@@ -15,6 +15,8 @@ static inline int arch_prepare_suspend(v + struct saved_context { + u16 es, fs, gs, ss; + unsigned long cr0, cr2, cr3, cr4; ++ u64 misc_enable; ++ bool misc_enable_saved; + struct desc_ptr gdt; + struct desc_ptr idt; + u16 ldt; +--- a/arch/x86/include/asm/suspend_64.h ++++ b/arch/x86/include/asm/suspend_64.h +@@ -27,6 +27,8 @@ struct saved_context { + u16 ds, es, fs, gs, ss; + unsigned long gs_base, gs_kernel_base, fs_base; + unsigned long cr0, cr2, cr3, cr4, cr8; ++ u64 misc_enable; ++ bool misc_enable_saved; + unsigned long efer; + u16 gdt_pad; + u16 gdt_limit; +--- a/arch/x86/power/cpu.c ++++ b/arch/x86/power/cpu.c +@@ -105,6 +105,8 @@ static void __save_processor_state(struc + ctxt->cr4 = read_cr4(); + ctxt->cr8 = read_cr8(); + #endif ++ ctxt->misc_enable_saved = !rdmsrl_safe(MSR_IA32_MISC_ENABLE, ++ &ctxt->misc_enable); + } + + /* Needed by apm.c */ +@@ -152,6 +154,8 @@ static void fix_processor_context(void) + */ + static void __restore_processor_state(struct saved_context *ctxt) + { ++ if (ctxt->misc_enable_saved) ++ wrmsrl(MSR_IA32_MISC_ENABLE, ctxt->misc_enable); + /* + * control registers + */ diff --git a/queue-2.6.33/series b/queue-2.6.33/series index c9db64c6d58..c85b40b254b 100644 --- a/queue-2.6.33/series +++ b/queue-2.6.33/series @@ -110,3 +110,8 @@ ethtool-fix-potential-user-buffer-overflow-for-ethtool_-g-s-rxfh.patch 0003-KVM-SVM-Implement-workaround-for-Erratum-383.patch 0004-KVM-MMU-invalidate-and-flush-on-spte-small-large-pag.patch 0005-KVM-read-apic-irr-with-ioapic-lock-held.patch +writeback-remove-writeback_inodes_wbc.patch +futex-futex_find_get_task-remove-credentails-check.patch +pm-x86-save-restore-misc_enable-register.patch +acpi-skip-checking-bm_sts-if-the-bios-doesn-t-ask-for-it.patch +acpi-unconditionally-set-sci_en-on-resume.patch diff --git a/queue-2.6.33/writeback-remove-writeback_inodes_wbc.patch b/queue-2.6.33/writeback-remove-writeback_inodes_wbc.patch new file mode 100644 index 00000000000..2ea5ef58c8d --- /dev/null +++ b/queue-2.6.33/writeback-remove-writeback_inodes_wbc.patch @@ -0,0 +1,147 @@ +From 9c3a8ee8a1d72c5c0d7fbdf426d80e270ddfa54c Mon Sep 17 00:00:00 2001 +From: Christoph Hellwig +Date: Thu, 10 Jun 2010 12:07:27 +0200 +Subject: writeback: remove writeback_inodes_wbc + +From: Christoph Hellwig + +commit 9c3a8ee8a1d72c5c0d7fbdf426d80e270ddfa54c upstream. + +This was just an odd wrapper around writeback_inodes_wb. Removing this +also allows to get rid of the bdi member of struct writeback_control +which was rather out of place there. + +Signed-off-by: Christoph Hellwig +Signed-off-by: Jens Axboe +Signed-off-by: Greg Kroah-Hartman + +--- + fs/afs/write.c | 1 - + fs/btrfs/extent_io.c | 2 -- + fs/fs-writeback.c | 12 ++---------- + include/linux/writeback.h | 5 ++--- + mm/backing-dev.c | 3 +-- + mm/page-writeback.c | 3 +-- + 6 files changed, 6 insertions(+), 20 deletions(-) + +--- a/fs/afs/write.c ++++ b/fs/afs/write.c +@@ -701,7 +701,6 @@ int afs_writeback_all(struct afs_vnode * + { + struct address_space *mapping = vnode->vfs_inode.i_mapping; + struct writeback_control wbc = { +- .bdi = mapping->backing_dev_info, + .sync_mode = WB_SYNC_ALL, + .nr_to_write = LONG_MAX, + .range_cyclic = 1, +--- a/fs/btrfs/extent_io.c ++++ b/fs/btrfs/extent_io.c +@@ -2574,7 +2574,6 @@ int extent_write_full_page(struct extent + .sync_io = wbc->sync_mode == WB_SYNC_ALL, + }; + struct writeback_control wbc_writepages = { +- .bdi = wbc->bdi, + .sync_mode = wbc->sync_mode, + .older_than_this = NULL, + .nr_to_write = 64, +@@ -2608,7 +2607,6 @@ int extent_write_locked_range(struct ext + .sync_io = mode == WB_SYNC_ALL, + }; + struct writeback_control wbc_writepages = { +- .bdi = inode->i_mapping->backing_dev_info, + .sync_mode = mode, + .older_than_this = NULL, + .nr_to_write = nr_pages * 2, +--- a/fs/fs-writeback.c ++++ b/fs/fs-writeback.c +@@ -611,8 +611,8 @@ pinned: + return 0; + } + +-static void writeback_inodes_wb(struct bdi_writeback *wb, +- struct writeback_control *wbc) ++void writeback_inodes_wb(struct bdi_writeback *wb, ++ struct writeback_control *wbc) + { + struct super_block *sb = wbc->sb, *pin_sb = NULL; + const unsigned long start = jiffies; /* livelock avoidance */ +@@ -681,13 +681,6 @@ static void writeback_inodes_wb(struct b + /* Leave any unwritten inodes on b_io */ + } + +-void writeback_inodes_wbc(struct writeback_control *wbc) +-{ +- struct backing_dev_info *bdi = wbc->bdi; +- +- writeback_inodes_wb(&bdi->wb, wbc); +-} +- + /* + * The maximum number of pages to writeout in a single bdi flush/kupdate + * operation. We do this so we don't hold I_SYNC against an inode for +@@ -726,7 +719,6 @@ static long wb_writeback(struct bdi_writ + struct wb_writeback_args *args) + { + struct writeback_control wbc = { +- .bdi = wb->bdi, + .sb = args->sb, + .sync_mode = args->sync_mode, + .older_than_this = NULL, +--- a/include/linux/writeback.h ++++ b/include/linux/writeback.h +@@ -27,8 +27,6 @@ enum writeback_sync_modes { + * in a manner such that unspecified fields are set to zero. + */ + struct writeback_control { +- struct backing_dev_info *bdi; /* If !NULL, only write back this +- queue */ + struct super_block *sb; /* if !NULL, only write inodes from + this super_block */ + enum writeback_sync_modes sync_mode; +@@ -72,7 +70,8 @@ int inode_wait(void *); + void writeback_inodes_sb(struct super_block *); + int writeback_inodes_sb_if_idle(struct super_block *); + void sync_inodes_sb(struct super_block *); +-void writeback_inodes_wbc(struct writeback_control *wbc); ++void writeback_inodes_wb(struct bdi_writeback *wb, ++ struct writeback_control *wbc); + long wb_do_writeback(struct bdi_writeback *wb, int force_wait); + void wakeup_flusher_threads(long nr_pages); + +--- a/mm/backing-dev.c ++++ b/mm/backing-dev.c +@@ -331,14 +331,13 @@ int bdi_has_dirty_io(struct backing_dev_ + static void bdi_flush_io(struct backing_dev_info *bdi) + { + struct writeback_control wbc = { +- .bdi = bdi, + .sync_mode = WB_SYNC_NONE, + .older_than_this = NULL, + .range_cyclic = 1, + .nr_to_write = 1024, + }; + +- writeback_inodes_wbc(&wbc); ++ writeback_inodes_wb(&bdi->wb, &wbc); + } + + /* +--- a/mm/page-writeback.c ++++ b/mm/page-writeback.c +@@ -495,7 +495,6 @@ static void balance_dirty_pages(struct a + + for (;;) { + struct writeback_control wbc = { +- .bdi = bdi, + .sync_mode = WB_SYNC_NONE, + .older_than_this = NULL, + .nr_to_write = write_chunk, +@@ -537,7 +536,7 @@ static void balance_dirty_pages(struct a + * up. + */ + if (bdi_nr_reclaimable > bdi_thresh) { +- writeback_inodes_wbc(&wbc); ++ writeback_inodes_wb(&bdi->wb, &wbc); + pages_written += write_chunk - wbc.nr_to_write; + get_dirty_limits(&background_thresh, &dirty_thresh, + &bdi_thresh, bdi);