linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: linux-kernel@vger.kernel.org, stable@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	alan@lxorguk.ukuu.org.uk, Eric Dumazet <edumazet@google.com>,
	"Paul E. McKenney" <paulmck@linux.vnet.ibm.com>
Subject: [ 26/27] rcu: Fix batch-limit size problem
Date: Fri, 14 Dec 2012 15:01:39 -0800	[thread overview]
Message-ID: <20121214222256.742122943@linuxfoundation.org> (raw)
In-Reply-To: <20121214222251.229078963@linuxfoundation.org>

3.7-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Eric Dumazet <edumazet@google.com>

commit 878d7439d0f45a95869e417576774673d1fa243f upstream.

Commit 29c00b4a1d9e27 (rcu: Add event-tracing for RCU callback
invocation) added a regression in rcu_do_batch()

Under stress, RCU is supposed to allow to process all items in queue,
instead of a batch of 10 items (blimit), but an integer overflow makes
the effective limit being 1.  So, unless there is frequent idle periods
(during which RCU ignores batch limits), RCU can be forced into a
state where it cannot keep up with the callback-generation rate,
eventually resulting in OOM.

This commit therefore converts a few variables in rcu_do_batch() from
int to long to fix this problem, along with the module parameters
controlling the batch limits.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: Paul E. McKenney <paulmck@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

---
 kernel/rcutree.c |   17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

--- a/kernel/rcutree.c
+++ b/kernel/rcutree.c
@@ -212,13 +212,13 @@ DEFINE_PER_CPU(struct rcu_dynticks, rcu_
 #endif
 };
 
-static int blimit = 10;		/* Maximum callbacks per rcu_do_batch. */
-static int qhimark = 10000;	/* If this many pending, ignore blimit. */
-static int qlowmark = 100;	/* Once only this many pending, use blimit. */
-
-module_param(blimit, int, 0444);
-module_param(qhimark, int, 0444);
-module_param(qlowmark, int, 0444);
+static long blimit = 10;	/* Maximum callbacks per rcu_do_batch. */
+static long qhimark = 10000;	/* If this many pending, ignore blimit. */
+static long qlowmark = 100;	/* Once only this many pending, use blimit. */
+
+module_param(blimit, long, 0444);
+module_param(qhimark, long, 0444);
+module_param(qlowmark, long, 0444);
 
 int rcu_cpu_stall_suppress __read_mostly; /* 1 = suppress stall warnings. */
 int rcu_cpu_stall_timeout __read_mostly = CONFIG_RCU_CPU_STALL_TIMEOUT;
@@ -1769,7 +1769,8 @@ static void rcu_do_batch(struct rcu_stat
 {
 	unsigned long flags;
 	struct rcu_head *next, *list, **tail;
-	int bl, count, count_lazy, i;
+	long bl, count, count_lazy;
+	int i;
 
 	/* If no callbacks are ready, just return.*/
 	if (!cpu_has_callbacks_ready_to_invoke(rdp)) {



  parent reply	other threads:[~2012-12-14 23:06 UTC|newest]

Thread overview: 35+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-12-14 23:01 [ 00/27] 3.7.1-stable review Greg Kroah-Hartman
2012-12-14 23:01 ` [ 01/27] mm: dmapool: use provided gfp flags for all dma_alloc_coherent() calls Greg Kroah-Hartman
2012-12-14 23:01 ` [ 02/27] clk: ux500: fix bit error Greg Kroah-Hartman
2012-12-14 23:01 ` [ 03/27] x86,AMD: Power driver support for AMDs family 16h processors Greg Kroah-Hartman
2012-12-14 23:01 ` [ 04/27] telephony: ijx: buffer overflow in ixj_write_cid() Greg Kroah-Hartman
2012-12-14 23:01 ` [ 05/27] ezusb: add dependency to USB Greg Kroah-Hartman
2012-12-14 23:01 ` [ 06/27] x86: hpet: Fix masking of MSI interrupts Greg Kroah-Hartman
2012-12-14 23:01 ` [ 07/27] USB: add new zte 3g-dongles pid to option.c Greg Kroah-Hartman
2012-12-14 23:01 ` [ 08/27] USB: option: blacklist network interface on Huawei E173 Greg Kroah-Hartman
2012-12-14 23:01 ` [ 09/27] USB: ftdi_sio: Add support for Newport AGILIS motor drivers Greg Kroah-Hartman
2012-12-14 23:01 ` [ 10/27] usb: ftdi_sio: fixup BeagleBone A5+ quirk Greg Kroah-Hartman
2012-12-14 23:01 ` [ 11/27] USB: cp210x: add Virtenio Preon32 device id Greg Kroah-Hartman
2012-12-14 23:01 ` [ 12/27] USB: mark uas driver as BROKEN Greg Kroah-Hartman
2012-12-14 23:01 ` [ 13/27] ACPI / battery: Correct battery capacity values on Thinkpads Greg Kroah-Hartman
2012-12-14 23:01 ` [ 14/27] ACPI / PM: Add Sony Vaio VPCEB1S1E to nonvs blacklist Greg Kroah-Hartman
2012-12-14 23:01 ` [ 15/27] ACPI / PNP: Do not crash due to stale pointer use during system resume Greg Kroah-Hartman
2012-12-14 23:01 ` [ 16/27] ACPI / video: ignore BIOS initial backlight value for HP Folio 13-2000 Greg Kroah-Hartman
2012-12-14 23:01 ` [ 17/27] ACPI / video: Add "Asus UL30VT" to ACPI video detect blacklist Greg Kroah-Hartman
2012-12-14 23:01 ` [ 18/27] USB: OHCI: workaround for hardware bug: retired TDs not added to the Done Queue Greg Kroah-Hartman
2012-12-14 23:01 ` [ 19/27] xhci: Extend Fresco Logic MSI quirk Greg Kroah-Hartman
2012-12-14 23:01 ` [ 20/27] ftrace: Clear bits properly in reset_iter_read() Greg Kroah-Hartman
2012-12-14 23:01 ` [ 21/27] ring-buffer: Fix NULL pointer if rb_set_head_page() fails Greg Kroah-Hartman
2012-12-14 23:01 ` [ 22/27] ring-buffer: Fix race between integrity check and readers Greg Kroah-Hartman
2012-12-14 23:01 ` [ 23/27] cdc-acm: implement TIOCSSERIAL to avoid blocking close(2) Greg Kroah-Hartman
2012-12-14 23:01 ` [ 24/27] perf test: fix a build error on builtin-test Greg Kroah-Hartman
2012-12-14 23:01 ` [ 25/27] USB: EHCI: bugfix: urb->hcpriv should not be NULL Greg Kroah-Hartman
2012-12-14 23:01 ` Greg Kroah-Hartman [this message]
2012-12-14 23:01 ` [ 27/27] Staging: bcm: Add two products and remove an existing product Greg Kroah-Hartman
2012-12-15 14:22 ` [ 00/27] 3.7.1-stable review Shuah Khan
2012-12-15 20:47   ` Shuah Khan
2012-12-15 14:53 ` Satoru Takeuchi
2012-12-16 19:52 ` Nikola Ciprich
2012-12-17 22:07 ` Mariusz Kozlowski
2012-12-17 22:14   ` Greg Kroah-Hartman
2012-12-17 22:38     ` Mariusz Kozlowski

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20121214222256.742122943@linuxfoundation.org \
    --to=gregkh@linuxfoundation.org \
    --cc=alan@lxorguk.ukuu.org.uk \
    --cc=edumazet@google.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=paulmck@linux.vnet.ibm.com \
    --cc=stable@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).