This is a note to let you know that I've just added the patch titled

    sparc: Size mondo queues more sanely.

to the 3.0-stable tree which can be found at:
    
http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     sparc-size-mondo-queues-more-sanely.patch
and it can be found in the queue-3.0 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <sta...@kernel.org> know about it.


>From d28c07bef1fdcd4c3ecd825ff3a1c1d8b40c0245 Mon Sep 17 00:00:00 2001
From: "David S. Miller" <da...@davemloft.net>
Date: Fri, 5 Aug 2011 02:38:27 -0700
Subject: sparc: Size mondo queues more sanely.


From: "David S. Miller" <da...@davemloft.net>

[ Upstream commit 961f65fc41cdc1f9099a6075258816c0db98e390 ]

There is currently no upper limit on the mondo queue sizes we'll use,
which guarentees that we'll eventually his page allocation limits, and
thus allocation failures, due to MAX_ORDER.

Cap the sizes sanely, current limits are:

CPU  MONDO      2 * max_possible_cpus
DEV  MONDO      256 (basically NR_IRQS)
RES  MONDO      128
NRES MONDO      4

Signed-off-by: David S. Miller <da...@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gre...@suse.de>
---
 arch/sparc/kernel/mdesc.c |   30 +++++++++++++++++++++++-------
 1 file changed, 23 insertions(+), 7 deletions(-)

--- a/arch/sparc/kernel/mdesc.c
+++ b/arch/sparc/kernel/mdesc.c
@@ -508,6 +508,8 @@ const char *mdesc_node_name(struct mdesc
 }
 EXPORT_SYMBOL(mdesc_node_name);
 
+static u64 max_cpus = 64;
+
 static void __init report_platform_properties(void)
 {
        struct mdesc_handle *hp = mdesc_grab();
@@ -543,8 +545,10 @@ static void __init report_platform_prope
        if (v)
                printk("PLATFORM: watchdog-max-timeout [%llu ms]\n", *v);
        v = mdesc_get_property(hp, pn, "max-cpus", NULL);
-       if (v)
-               printk("PLATFORM: max-cpus [%llu]\n", *v);
+       if (v) {
+               max_cpus = *v;
+               printk("PLATFORM: max-cpus [%llu]\n", max_cpus);
+       }
 
 #ifdef CONFIG_SMP
        {
@@ -715,7 +719,7 @@ static void __cpuinit set_proc_ids(struc
 }
 
 static void __cpuinit get_one_mondo_bits(const u64 *p, unsigned int *mask,
-                                        unsigned char def)
+                                        unsigned long def, unsigned long max)
 {
        u64 val;
 
@@ -726,6 +730,9 @@ static void __cpuinit get_one_mondo_bits
        if (!val || val >= 64)
                goto use_default;
 
+       if (val > max)
+               val = max;
+
        *mask = ((1U << val) * 64U) - 1U;
        return;
 
@@ -736,19 +743,28 @@ use_default:
 static void __cpuinit get_mondo_data(struct mdesc_handle *hp, u64 mp,
                                     struct trap_per_cpu *tb)
 {
+       static int printed;
        const u64 *val;
 
        val = mdesc_get_property(hp, mp, "q-cpu-mondo-#bits", NULL);
-       get_one_mondo_bits(val, &tb->cpu_mondo_qmask, 7);
+       get_one_mondo_bits(val, &tb->cpu_mondo_qmask, 7, ilog2(max_cpus * 2));
 
        val = mdesc_get_property(hp, mp, "q-dev-mondo-#bits", NULL);
-       get_one_mondo_bits(val, &tb->dev_mondo_qmask, 7);
+       get_one_mondo_bits(val, &tb->dev_mondo_qmask, 7, 8);
 
        val = mdesc_get_property(hp, mp, "q-resumable-#bits", NULL);
-       get_one_mondo_bits(val, &tb->resum_qmask, 6);
+       get_one_mondo_bits(val, &tb->resum_qmask, 6, 7);
 
        val = mdesc_get_property(hp, mp, "q-nonresumable-#bits", NULL);
-       get_one_mondo_bits(val, &tb->nonresum_qmask, 2);
+       get_one_mondo_bits(val, &tb->nonresum_qmask, 2, 2);
+       if (!printed++) {
+               pr_info("SUN4V: Mondo queue sizes "
+                       "[cpu(%u) dev(%u) r(%u) nr(%u)]\n",
+                       tb->cpu_mondo_qmask + 1,
+                       tb->dev_mondo_qmask + 1,
+                       tb->resum_qmask + 1,
+                       tb->nonresum_qmask + 1);
+       }
 }
 
 static void * __cpuinit mdesc_iterate_over_cpus(void *(*func)(struct 
mdesc_handle *, u64, int, void *), void *arg, cpumask_t *mask)


Patches currently in stable-queue which might be from da...@davemloft.net are

queue-3.0/ipv4-send-gratuitous-arp-for-secondary-ip-addresses-also.patch
queue-3.0/ipv4-constrain-ufo-fragment-sizes-to-multiples-of-8-bytes.patch
queue-3.0/sparc-detect-and-handle-ultrasparc-t3-cpu-types.patch
queue-3.0/bonding-fix-string-comparison-errors.patch
queue-3.0/sparc-use-popc-if-possible-for-hweight-routines.patch
queue-3.0/drivers-net-niu.c-adjust-array-index.patch
queue-3.0/sparc-set-reboot-cmd-using-reboot-data-hypervisor-call-if-available.patch
queue-3.0/net-audit-drivers-to-identify-those-needing-iff_tx_skb_sharing-cleared.patch
queue-3.0/sparc-size-mondo-queues-more-sanely.patch
queue-3.0/sparc-don-t-leave-sparc_pmu_type-null-on-sun4v.patch
queue-3.0/ipv4-use-rt_tos-after-some-rt_tos-conversions.patch
queue-3.0/net-cap-number-of-elements-for-sendmmsg.patch
queue-3.0/sch_sfq-fix-sfq_enqueue.patch
queue-3.0/sparc-sanitize-cpu-feature-detection-and-reporting.patch
queue-3.0/sparc-use-popc-when-possible-for-ffs-__ffs-ffz.patch
queue-3.0/sparc-add-t3-sun4v-cpu-type-and-hypervisor-group-defines.patch
queue-3.0/net-fix-security_socket_sendmsg-bypass-problem.patch
queue-3.0/sparc-use-hweight64-in-popc-emulation.patch
queue-3.0/0002-net-Compute-protocol-sequence-numbers-and-fragment-I.patch
queue-3.0/sparc-add-some-missing-hypervisor-api-groups.patch
queue-3.0/fix-cdc-phonet-build.patch
queue-3.0/sparc-minor-tweaks-to-niagara-page-copy-clear.patch
queue-3.0/ipv4-fix-the-reusing-of-routing-cache-entries.patch
queue-3.0/ipv6-make-fragment-identifications-less-predictable.patch
queue-3.0/sis190-rx-filter-init-is-needed-for-mac-address-change.patch
queue-3.0/net-adjust-array-index.patch
queue-3.0/sparc-access-kernel-tsb-using-physical-addressing-when-possible.patch
queue-3.0/net-allow-netif_carrier-to-be-called-safely-from-irq.patch
queue-3.0/sparc-fix-build-with-debug_pagealloc-enabled.patch
queue-3.0/icmp-fix-regression-in-nexthop-resolution-during-replies.patch
queue-3.0/xfrm-fix-key-lengths-for-rfc3686-ctr-aes.patch
queue-3.0/0001-crypto-Move-md5_transform-to-lib-md5.c.patch
queue-3.0/gre-fix-improper-error-handling.patch
queue-3.0/net-add-iff_skb_tx_shared-flag-to-priv_flags.patch
queue-3.0/r8169-add-support-for-d-link-530t-rev-c1-kernel-bug-38862.patch
queue-3.0/sparc-don-t-do-expensive-hypervisor-pcr-write-unless-necessary.patch
queue-3.0/net-sendmmsg-should-only-return-an-error-if-no-messages-were-sent.patch
queue-3.0/mpt2sas-fixed-big-indian-issues-on-32-bit-ppc.patch

_______________________________________________
stable mailing list
stable@linux.kernel.org
http://linux.kernel.org/mailman/listinfo/stable

Reply via email to