From patchwork Thu Feb 27 21:09:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Simmons X-Patchwork-Id: 11409883 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E085314BC for ; Thu, 27 Feb 2020 21:24:50 +0000 (UTC) Received: from pdx1-mailman02.dreamhost.com (pdx1-mailman02.dreamhost.com [64.90.62.194]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C80C1246A0 for ; Thu, 27 Feb 2020 21:24:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C80C1246A0 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lustre-devel-bounces@lists.lustre.org Received: from pdx1-mailman02.dreamhost.com (localhost [IPv6:::1]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 9587134888F; Thu, 27 Feb 2020 13:22:28 -0800 (PST) X-Original-To: lustre-devel@lists.lustre.org Delivered-To: lustre-devel-lustre.org@pdx1-mailman02.dreamhost.com Received: from smtp3.ccs.ornl.gov (smtp3.ccs.ornl.gov [160.91.203.39]) by pdx1-mailman02.dreamhost.com (Postfix) with ESMTP id 774EB21FB61 for ; Thu, 27 Feb 2020 13:18:53 -0800 (PST) Received: from star.ccs.ornl.gov (star.ccs.ornl.gov [160.91.202.134]) by smtp3.ccs.ornl.gov (Postfix) with ESMTP id A56081041; Thu, 27 Feb 2020 16:18:14 -0500 (EST) Received: by star.ccs.ornl.gov (Postfix, from userid 2004) id A43F4468; Thu, 27 Feb 2020 16:18:14 -0500 (EST) From: James Simmons To: Andreas Dilger , Oleg Drokin , NeilBrown Date: Thu, 27 Feb 2020 16:09:48 -0500 Message-Id: <1582838290-17243-121-git-send-email-jsimmons@infradead.org> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> References: <1582838290-17243-1-git-send-email-jsimmons@infradead.org> Subject: [lustre-devel] [PATCH 120/622] lnet: libcfs: fix wrong check in libcfs_debug_vmsg2() X-BeenThere: lustre-devel@lists.lustre.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: "For discussing Lustre software development." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Wang Shilong , Lustre Development List MIME-Version: 1.0 Errors-To: lustre-devel-bounces@lists.lustre.org Sender: "lustre-devel" From: Wang Shilong Logic here is we skip output if time is before @cdls_next reach and increase @cdls_count. however we did it in the opposite way: 1)libcfs_debug_vmsg2() is called for a long time, that means current check succeed, we skip print messages and return, we will skip all messages later too.. 2)libcfs_debug_vmsg2() is called frequently, current check fail every time, message will be bumped out always. the worst case is we never skip any messages. Also fix test case to cover this later which is from Andreas: The test_60a() llog test is being run on the MGS, while the check in test_60b() to confirm that CDEBUG_LIMIT() works properly is being run on the client. There has been a breakage in CDEBUG_LIMIT() that this test failed to catch, now we need to track it down. Change test_60b to dump the dmesg logs on the MGS. Fixes: b49946b2e ("staging: lustre: libcfs: discard cfs_time_after()") WC-bug-id: https://jira.whamcloud.com/browse/LU-11373 Lustre-commit: 4037c1462730 ("LU-11373 libcfs: fix wrong check in libcfs_debug_vmsg2()") Signed-off-by: Andreas Dilger Signed-off-by: Wang Shilong Reviewed-on: https://review.whamcloud.com/33154 Reviewed-by: James Simmons Signed-off-by: James Simmons --- net/lnet/libcfs/tracefile.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/lnet/libcfs/tracefile.c b/net/lnet/libcfs/tracefile.c index 6e4cc31..bda3523 100644 --- a/net/lnet/libcfs/tracefile.c +++ b/net/lnet/libcfs/tracefile.c @@ -544,7 +544,7 @@ int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata, if (cdls) { if (libcfs_console_ratelimit && cdls->cdls_next && /* not first time ever */ - !time_after(jiffies, cdls->cdls_next)) { + time_before(jiffies, cdls->cdls_next)) { /* skipping a console message */ cdls->cdls_count++; if (tcd)