Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=cde46035161d677617983177e877c87d89fbb5e1
Commit:     cde46035161d677617983177e877c87d89fbb5e1
Parent:     d0a34f98d1da66a5b4e02171854e6c04c9916016
Author:     Frank Blaschka <[EMAIL PROTECTED]>
AuthorDate: Wed Aug 29 11:26:53 2007 +0200
Committer:  Jeff Garzik <[EMAIL PROTECTED]>
CommitDate: Fri Aug 31 06:52:57 2007 -0400

    qeth: enforce a rate limit for inbound scatter gather messages
    
    under memory pressure scatter gather mode switching messages must be
    rate limited.
    
    Signed-off-by: Frank Blaschka <[EMAIL PROTECTED]>
    Signed-off-by: Ursula Braun <[EMAIL PROTECTED]>
    Signed-off-by: Jeff Garzik <[EMAIL PROTECTED]>
---
 drivers/s390/net/qeth_main.c |   13 ++++++++-----
 1 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/drivers/s390/net/qeth_main.c b/drivers/s390/net/qeth_main.c
index ba10d42..610d27c 100644
--- a/drivers/s390/net/qeth_main.c
+++ b/drivers/s390/net/qeth_main.c
@@ -2803,13 +2803,16 @@ qeth_queue_input_buffer(struct qeth_card *card, int 
index)
                if (newcount < count) {
                        /* we are in memory shortage so we switch back to
                           traditional skb allocation and drop packages */
-                       if (atomic_cmpxchg(&card->force_alloc_skb, 0, 1))
-                               printk(KERN_WARNING
-                                       "qeth: switch to alloc skb\n");
+                       if (!atomic_read(&card->force_alloc_skb) &&
+                           net_ratelimit())
+                               PRINT_WARN("Switch to alloc skb\n");
+                       atomic_set(&card->force_alloc_skb, 3);
                        count = newcount;
                } else {
-                       if (atomic_cmpxchg(&card->force_alloc_skb, 1, 0))
-                               printk(KERN_WARNING "qeth: switch to sg\n");
+                       if ((atomic_read(&card->force_alloc_skb) == 1) &&
+                           net_ratelimit())
+                               PRINT_WARN("Switch to sg\n");
+                       atomic_add_unless(&card->force_alloc_skb, -1, 0);
                }
 
                /*
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to