Linux 3.3.5

- Add patch to rate limit NFSv4 message (rhbz 732748)
This commit is contained in:
Josh Boyer 2012-05-07 13:27:47 -04:00
parent 269237b49f
commit eee168ca53
8 changed files with 51 additions and 3165 deletions

View File

@ -0,0 +1,37 @@
From 34d91cfbc163c6e2a136a27c96918fc35de06341 Mon Sep 17 00:00:00 2001
From: William Dauchy <wdauchy@gmail.com>
Date: Wed, 14 Mar 2012 12:32:04 +0100
Subject: [PATCH] NFSv4: Rate limit the state manager for lock reclaim warning
messages
Adding rate limit on `Lock reclaim failed` messages since it could fill
up system logs
Signed-off-by: William Dauchy <wdauchy@gmail.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Conflicts:
fs/nfs/nfs4state.c
---
fs/nfs/nfs4state.c | 5 +++--
1 files changed, 3 insertions(+), 2 deletions(-)
diff --git a/fs/nfs/nfs4state.c b/fs/nfs/nfs4state.c
index bacb271..3676b5c 100644
--- a/fs/nfs/nfs4state.c
+++ b/fs/nfs/nfs4state.c
@@ -1247,8 +1247,9 @@ restart:
spin_lock(&state->state_lock);
list_for_each_entry(lock, &state->lock_states, ls_locks) {
if (!(lock->ls_flags & NFS_LOCK_INITIALIZED))
- printk("%s: Lock reclaim failed!\n",
- __func__);
+ pr_warn_ratelimited("NFS: "
+ "%s: Lock reclaim "
+ "failed!\n", __func__);
}
spin_unlock(&state->state_lock);
nfs4_put_open_state(state);
--
1.7.7.6

View File

@ -190,6 +190,11 @@ CONFIG_LSM_MMAP_MIN_ADDR=32768
# CONFIG_MACH_EUKREA_CPUIMX35SD is not set
CONFIG_ARM_ERRATA_720789=y
CONFIG_ARM_ERRATA_751472=y
<<<<<<< HEAD
=======
CONFIG_ARM_ERRATA_326103=y
CONFIG_OMAP4_ERRATA_I688=y
>>>>>>> 99667a9... Linux 3.3.5
# CONFIG_FB_MX3 is not set
# CONFIG_MX3_IPU is not set
# CONFIG_MX3_IPU_IRQS is not set

View File

@ -1,198 +0,0 @@
Hi Rafael,
One more version. Heeding Per's suggestion to optimise when
CONFIG_HIGHMEM is not configured.
---------------------------------------
Hibernation/thaw fixes/improvements:
1. Calculate the number of required free pages based on non-high memory
pages only, because that is where the buffers will come from.
2. Do not allocate memory for buffers from emergency pools, unless
absolutely required. Do not warn about and do not retry non-essential
failed allocations.
3. Do not check the amount of free pages left on every single page
write, but wait until one map is completely populated and then check.
4. Set maximum number of pages for read buffering consistently, instead
of inadvertently depending on the size of the sector type.
5. Fix copyright line, which I missed when I submitted the hibernation
threading patch.
6. Dispense with bit shifting arithmetic to improve readability.
Signed-off-by: Bojan Smojver <bojan@rexursive.com>
Signed-off-by: Per Olofsson <pelle@debian.org>
---
kernel/power/swap.c | 76 +++++++++++++++++++++++++++++++++++++++------------
1 files changed, 58 insertions(+), 18 deletions(-)
diff --git a/kernel/power/swap.c b/kernel/power/swap.c
index 8742fd0..8a1c293 100644
--- a/kernel/power/swap.c
+++ b/kernel/power/swap.c
@@ -6,7 +6,7 @@
*
* Copyright (C) 1998,2001-2005 Pavel Machek <pavel@ucw.cz>
* Copyright (C) 2006 Rafael J. Wysocki <rjw@sisk.pl>
- * Copyright (C) 2010 Bojan Smojver <bojan@rexursive.com>
+ * Copyright (C) 2010-2012 Bojan Smojver <bojan@rexursive.com>
*
* This file is released under the GPLv2.
*
@@ -51,6 +51,36 @@
#define MAP_PAGE_ENTRIES (PAGE_SIZE / sizeof(sector_t) - 1)
+/*
+ * Number of free pages that are not high.
+ */
+#ifdef CONFIG_HIGHMEM
+static unsigned long low_free_pages(void)
+{
+ struct zone *zone;
+ unsigned long free = 0;
+
+ for_each_populated_zone(zone)
+ if (!is_highmem(zone))
+ free += zone_page_state(zone, NR_FREE_PAGES);
+ return free;
+}
+#else
+static inline unsigned long low_free_pages(void)
+{
+ return nr_free_pages();
+}
+#endif
+
+/*
+ * Number of pages required to be kept free while writing the image. Always
+ * half of all available low pages before the writing starts.
+ */
+static inline unsigned long reqd_free_pages(void)
+{
+ return low_free_pages() / 2;
+}
+
struct swap_map_page {
sector_t entries[MAP_PAGE_ENTRIES];
sector_t next_swap;
@@ -72,7 +102,7 @@ struct swap_map_handle {
sector_t cur_swap;
sector_t first_sector;
unsigned int k;
- unsigned long nr_free_pages, written;
+ unsigned long reqd_free_pages;
u32 crc32;
};
@@ -265,14 +295,17 @@ static int write_page(void *buf, sector_t offset, struct bio **bio_chain)
return -ENOSPC;
if (bio_chain) {
- src = (void *)__get_free_page(__GFP_WAIT | __GFP_HIGH);
+ src = (void *)__get_free_page(__GFP_WAIT | __GFP_NOWARN |
+ __GFP_NORETRY);
if (src) {
copy_page(src, buf);
} else {
ret = hib_wait_on_bio_chain(bio_chain); /* Free pages */
if (ret)
return ret;
- src = (void *)__get_free_page(__GFP_WAIT | __GFP_HIGH);
+ src = (void *)__get_free_page(__GFP_WAIT |
+ __GFP_NOWARN |
+ __GFP_NORETRY);
if (src) {
copy_page(src, buf);
} else {
@@ -316,8 +349,7 @@ static int get_swap_writer(struct swap_map_handle *handle)
goto err_rel;
}
handle->k = 0;
- handle->nr_free_pages = nr_free_pages() >> 1;
- handle->written = 0;
+ handle->reqd_free_pages = reqd_free_pages();
handle->first_sector = handle->cur_swap;
return 0;
err_rel:
@@ -351,12 +383,17 @@ static int swap_write_page(struct swap_map_handle *handle, void *buf,
clear_page(handle->cur);
handle->cur_swap = offset;
handle->k = 0;
- }
- if (bio_chain && ++handle->written > handle->nr_free_pages) {
- error = hib_wait_on_bio_chain(bio_chain);
- if (error)
- goto out;
- handle->written = 0;
+
+ if (bio_chain && low_free_pages() <= handle->reqd_free_pages) {
+ error = hib_wait_on_bio_chain(bio_chain);
+ if (error)
+ goto out;
+ /*
+ * Recalculate the number of required free pages, to
+ * make sure we never take more than half.
+ */
+ handle->reqd_free_pages = reqd_free_pages();
+ }
}
out:
return error;
@@ -404,7 +441,7 @@ static int swap_writer_finish(struct swap_map_handle *handle,
#define LZO_THREADS 3
/* Maximum number of pages for read buffering. */
-#define LZO_READ_PAGES (MAP_PAGE_ENTRIES * 8)
+#define LZO_READ_PAGES 8192
/**
@@ -615,10 +652,10 @@ static int save_image_lzo(struct swap_map_handle *handle,
}
/*
- * Adjust number of free pages after all allocations have been done.
- * We don't want to run out of pages when writing.
+ * Adjust the number of required free pages after all allocations have
+ * been done. We don't want to run out of pages when writing.
*/
- handle->nr_free_pages = nr_free_pages() >> 1;
+ handle->reqd_free_pages = reqd_free_pages();
/*
* Start the CRC32 thread.
@@ -1129,14 +1166,17 @@ static int load_image_lzo(struct swap_map_handle *handle,
/*
* Adjust number of pages for read buffering, in case we are short.
+ * Never take more than half of all available low pages.
*/
- read_pages = (nr_free_pages() - snapshot_get_image_size()) >> 1;
+ read_pages = (low_free_pages() - snapshot_get_image_size()) / 2;
read_pages = clamp_val(read_pages, LZO_CMP_PAGES, LZO_READ_PAGES);
for (i = 0; i < read_pages; i++) {
page[i] = (void *)__get_free_page(i < LZO_CMP_PAGES ?
__GFP_WAIT | __GFP_HIGH :
- __GFP_WAIT);
+ __GFP_WAIT | __GFP_NOWARN |
+ __GFP_NORETRY);
+
if (!page[i]) {
if (i < LZO_CMP_PAGES) {
ring_size = i;
---------------------------------------
--
Bojan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

View File

@ -1,69 +0,0 @@
Driver incorrectly validates command completion: instead of waiting
for a command to be acknowledged it continues execution. Most of the
time driver gets acknowledge of the command completion in a tasklet
before it executes the next one. But sometimes it sends the next
command before it gets acknowledge for the previous one. In such a
case one of the following error messages appear in the log:
Failed to send SYSTEM_CONFIG: Already sending a command.
Failed to send ASSOCIATE: Already sending a command.
Failed to send TX_POWER: Already sending a command.
After that you need to reload the driver to get it working again.
This bug occurs during roammaping (reported by Sam Varshavchik)
https://bugzilla.redhat.com/show_bug.cgi?id=738508
and machine booting (reported by Tom Gundersen and Mads Kiilerich)
https://bugs.archlinux.org/task/28097
https://bugzilla.redhat.com/show_bug.cgi?id=802106
This patch doesn't fix the delay issue during firmware load.
But at least device now works as usual after boot.
Cc: stable@kernel.org
Signed-off-by: Stanislav Yakovlev <stas.yakovlev@gmail.com>
---
drivers/net/wireless/ipw2x00/ipw2200.c | 13 ++++++++++++-
1 files changed, 12 insertions(+), 1 deletions(-)
diff --git a/drivers/net/wireless/ipw2x00/ipw2200.c b/drivers/net/wireless/ipw2x00/ipw2200.c
index 4130802..8cbafa5 100644
--- a/drivers/net/wireless/ipw2x00/ipw2200.c
+++ b/drivers/net/wireless/ipw2x00/ipw2200.c
@@ -2192,6 +2192,7 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
{
int rc = 0;
unsigned long flags;
+ unsigned long now, end;
spin_lock_irqsave(&priv->lock, flags);
if (priv->status & STATUS_HCMD_ACTIVE) {
@@ -2233,10 +2234,20 @@ static int __ipw_send_cmd(struct ipw_priv *priv, struct host_cmd *cmd)
}
spin_unlock_irqrestore(&priv->lock, flags);
+ now = jiffies;
+ end = now + HOST_COMPLETE_TIMEOUT;
+again:
rc = wait_event_interruptible_timeout(priv->wait_command_queue,
!(priv->
status & STATUS_HCMD_ACTIVE),
- HOST_COMPLETE_TIMEOUT);
+ end - now);
+ if (rc < 0) {
+ now = jiffies;
+ if (time_before(now, end))
+ goto again;
+ rc = 0;
+ }
+
if (rc == 0) {
spin_lock_irqsave(&priv->lock, flags);
if (priv->status & STATUS_HCMD_ACTIVE) {
--
1.7.2.5
--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

View File

@ -1,66 +0,0 @@
ctx->vif is dereferenced in different part of iwlwifi code, so do not
nullify it.
This should address at least one of the possible reasons of WARNING at
iwlagn_mac_remove_interface, and perhaps some random crashes when
firmware reset is performed.
Cc: stable@vger.kernel.org
Signed-off-by: Stanislaw Gruszka <sgruszka@redhat.com>
---
drivers/net/wireless/iwlwifi/iwl-agn.c | 3 ---
drivers/net/wireless/iwlwifi/iwl-mac80211.c | 10 +++++++++-
2 files changed, 9 insertions(+), 4 deletions(-)
--- linux-3.3.noarch.orig/drivers/net/wireless/iwlwifi/iwl-agn.c
+++ linux-3.3.noarch/drivers/net/wireless/iwlwifi/iwl-agn.c
@@ -1403,7 +1403,6 @@ static void iwl_bg_run_time_calib_work(s
void iwlagn_prepare_restart(struct iwl_priv *priv)
{
- struct iwl_rxon_context *ctx;
bool bt_full_concurrent;
u8 bt_ci_compliance;
u8 bt_load;
@@ -1412,8 +1411,6 @@ void iwlagn_prepare_restart(struct iwl_p
lockdep_assert_held(&priv->shrd->mutex);
- for_each_context(priv, ctx)
- ctx->vif = NULL;
priv->is_open = 0;
/*
--- linux-3.3.noarch.orig/drivers/net/wireless/iwlwifi/iwl-mac80211.c
+++ linux-3.3.noarch/drivers/net/wireless/iwlwifi/iwl-mac80211.c
@@ -1226,6 +1226,7 @@ static int iwlagn_mac_add_interface(stru
struct iwl_rxon_context *tmp, *ctx = NULL;
int err;
enum nl80211_iftype viftype = ieee80211_vif_type_p2p(vif);
+ bool reset = false;
IWL_DEBUG_MAC80211(priv, "enter: type %d, addr %pM\n",
viftype, vif->addr);
@@ -1247,6 +1248,13 @@ static int iwlagn_mac_add_interface(stru
tmp->interface_modes | tmp->exclusive_interface_modes;
if (tmp->vif) {
+ /* On reset we need to add the same interface again */
+ if (tmp->vif == vif) {
+ reset = true;
+ ctx = tmp;
+ break;
+ }
+
/* check if this busy context is exclusive */
if (tmp->exclusive_interface_modes &
BIT(tmp->vif->type)) {
@@ -1273,7 +1281,7 @@ static int iwlagn_mac_add_interface(stru
ctx->vif = vif;
err = iwl_setup_interface(priv, ctx);
- if (!err)
+ if (!err || reset)
goto out;
ctx->vif = NULL;

View File

@ -54,7 +54,7 @@ Summary: The Linux kernel
# For non-released -rc kernels, this will be appended after the rcX and
# gitX tags, so a 3 here would become part of release "0.rcX.gitX.3"
#
%global baserelease 4
%global baserelease 1
%global fedora_build %{baserelease}
# base_sublevel is the kernel version we're starting with and patching
@ -66,7 +66,7 @@ Summary: The Linux kernel
%if 0%{?released_kernel}
# Do we have a -stable update to apply?
%define stable_update 4
%define stable_update 5
# Is it a -stable RC?
%define stable_rc 0
# Set rpm version accordingly
@ -724,6 +724,7 @@ Patch4107: NFSv4-Minor-cleanups-for-nfs4_handle_exception-and-n.patch
# NFS Client Patch set from Upstream
Patch4113: NFS-optimise-away-unnecessary-setattrs-for-open-O_TRUNC.patch
Patch4114: NFSv4-fix-open-O_TRUNC-and-ftruncate-error-handling.patch
Patch4115: NFSv4-Rate-limit-the-state-manager-for-lock-reclaim-.patch
# patches headed upstream
@ -733,9 +734,6 @@ Patch12303: dmar-disable-when-ricoh-multifunction.patch
Patch13003: efi-dont-map-boot-services-on-32bit.patch
Patch14000: hibernate-freeze-filesystems.patch
Patch14001: hibernate-watermark.patch
Patch14010: lis3-improve-handling-of-null-rate.patch
Patch15000: bluetooth-use-after-free.patch
@ -777,9 +775,6 @@ Patch21351: x86-add-io_apic_ops-to-allow-interception.patch
Patch21352: x86-apic_ops-Replace-apic_ops-with-x86_apic_ops.patch
Patch21353: xen-x86-Implement-x86_apic_ops.patch
#rhbz 770476
Patch21371: iwlwifi-do-not-nulify-ctx-vif-on-reset.patch
#rhbz 807632
Patch21385: libata-forbid-port-runtime-pm-by-default.patch
@ -799,15 +794,9 @@ Patch30010: debug-808990.patch
#rhbz 814278 814289 CVE-2012-2119
Patch22007: macvtap-zerocopy-validate-vector-length.patch
#rhbz 783708
Patch22012: ipw2200-Fix-race-condition-in-the-command-completion-acknowledge.patch
#rhbz 817298
Patch22013: ipw2x00-add-supported-cipher-suites-to-wiphy-initialization.patch
#Lots of fixes from 3.3.5 stable queue
Patch22015: stable-queue-3.3.5-0502.patch
#rhbz 818820
Patch22016: dl2k-Clean-up-rio_ioctl.patch
@ -1348,6 +1337,7 @@ ApplyPatch NFSv4-Minor-cleanups-for-nfs4_handle_exception-and-n.patch
# NFS Client Patch set from Upstream
ApplyPatch NFS-optimise-away-unnecessary-setattrs-for-open-O_TRUNC.patch
ApplyPatch NFSv4-fix-open-O_TRUNC-and-ftruncate-error-handling.patch
ApplyPatch NFSv4-Rate-limit-the-state-manager-for-lock-reclaim-.patch
# USB
@ -1442,10 +1432,6 @@ ApplyPatch dmar-disable-when-ricoh-multifunction.patch
ApplyPatch efi-dont-map-boot-services-on-32bit.patch
# FIXME
#ApplyPatch hibernate-freeze-filesystems.patch
ApplyPatch hibernate-watermark.patch
ApplyPatch lis3-improve-handling-of-null-rate.patch
ApplyPatch bluetooth-use-after-free.patch
@ -1485,9 +1471,6 @@ ApplyPatch x86-add-io_apic_ops-to-allow-interception.patch
ApplyPatch x86-apic_ops-Replace-apic_ops-with-x86_apic_ops.patch
ApplyPatch xen-x86-Implement-x86_apic_ops.patch
#rhbz 770476
ApplyPatch iwlwifi-do-not-nulify-ctx-vif-on-reset.patch
#rhbz 808207 CVE-2012-1601
ApplyPatch KVM-Ensure-all-vcpus-are-consistent-with-in-kernel-i.patch
@ -1500,15 +1483,9 @@ ApplyPatch disable-hid-battery.patch
#rhbz 814278 814289 CVE-2012-2119
ApplyPatch macvtap-zerocopy-validate-vector-length.patch
#rhbz 783708
ApplyPatch ipw2200-Fix-race-condition-in-the-command-completion-acknowledge.patch
#rhbz 817298
ApplyPatch ipw2x00-add-supported-cipher-suites-to-wiphy-initialization.patch
#Lots of fixes from 3.3.5 stable queue
ApplyPatch stable-queue-3.3.5-0502.patch
#rhbz 818820
ApplyPatch dl2k-Clean-up-rio_ioctl.patch
@ -2250,6 +2227,10 @@ fi
# and build.
%changelog
* Mon May 07 2012 Josh Boyer <jwboyer@redat.com> 3.3.5-1
- Linux 3.3.5
- Add patch to rate limit NFSv4 message (rhbz 732748)
* Fri May 04 2012 Josh Boyer <jwboyer@redhat.com>
- unfiltered netdev rio_ioctl access by users (rhbz 818820)

View File

@ -1,2 +1,2 @@
7133f5a2086a7d7ef97abac610c094f5 linux-3.3.tar.xz
9c4cc16f10b645fbb90f6c05ad388883 patch-3.3.4.xz
d346edca5d3de7052f49996b01cef401 patch-3.3.5.xz

File diff suppressed because it is too large Load Diff