From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754779Ab0JDKMV (ORCPT ); Mon, 4 Oct 2010 06:12:21 -0400 Received: from mail-pz0-f46.google.com ([209.85.210.46]:36175 "EHLO mail-pz0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754580Ab0JDKMT (ORCPT ); Mon, 4 Oct 2010 06:12:19 -0400 DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=from:to:cc:subject:date:message-id:x-mailer:in-reply-to:references; b=Dilg7+at4Eca4eQdVcWj2/R5dmLBYDaV2aht/bO70Or6b3OvV4/z//RNMZv7IljOO5 LNCKmrgCiovbQnsbIG36l46doQ3gy6F546epfGesMNQq1yhQw1F9y6xfvHDz/k5+b/i3 XhxyCtzNQ1vKWC5jfaQV3q1s0wr/QgdhKNWyQ= From: Namhyung Kim To: Jan Kara Cc: Andrew Morton , linux-ext4@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH UPDATED] jbd: Use printk_ratelimited() in journal_alloc_journal_head() Date: Mon, 4 Oct 2010 19:12:13 +0900 Message-Id: <1286187133-12475-1-git-send-email-namhyung@gmail.com> X-Mailer: git-send-email 1.7.0.4 In-Reply-To: <20101004094331.GC3589@quack.suse.cz> References: <20101004094331.GC3589@quack.suse.cz> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Use printk_ratelimited() instead of doing it manually. Signed-off-by: Namhyung Kim --- fs/jbd/journal.c | 9 +++------ 1 files changed, 3 insertions(+), 6 deletions(-) diff --git a/fs/jbd/journal.c b/fs/jbd/journal.c index 6f20a75..f79767d 100644 --- a/fs/jbd/journal.c +++ b/fs/jbd/journal.c @@ -1718,7 +1718,6 @@ static void journal_destroy_journal_head_cache(void) static struct journal_head *journal_alloc_journal_head(void) { struct journal_head *ret; - static unsigned long last_warning; #ifdef CONFIG_JBD_DEBUG atomic_inc(&nr_journal_heads); @@ -1726,11 +1725,9 @@ static struct journal_head *journal_alloc_journal_head(void) ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS); if (ret == NULL) { jbd_debug(1, "out of memory for journal_head\n"); - if (time_after(jiffies, last_warning + 5*HZ)) { - printk(KERN_NOTICE "ENOMEM in %s, retrying.\n", - __func__); - last_warning = jiffies; - } + printk_ratelimited(KERN_NOTICE "ENOMEM in %s, retrying.\n", + __func__); + while (ret == NULL) { yield(); ret = kmem_cache_alloc(journal_head_cache, GFP_NOFS); -- 1.7.0.4