From patchwork Wed Apr 11 13:21:29 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jinpu Wang X-Patchwork-Id: 10335447 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 871816053B for ; Wed, 11 Apr 2018 13:21:46 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7C206288AA for ; Wed, 11 Apr 2018 13:21:46 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 70F5C288D1; Wed, 11 Apr 2018 13:21:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 267D7288AA for ; Wed, 11 Apr 2018 13:21:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753184AbeDKNVd (ORCPT ); Wed, 11 Apr 2018 09:21:33 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:53702 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752937AbeDKNVc (ORCPT ); Wed, 11 Apr 2018 09:21:32 -0400 Received: by mail-wm0-f66.google.com with SMTP id 66so4115556wmd.3 for ; Wed, 11 Apr 2018 06:21:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=profitbricks-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id; bh=w63PE+GanIzdstZzSxnDj4u4AkPCM4ERaCGFb7/rl+s=; b=PEC8BaaJiW/7kkWec7aEaA3bNNnEsF0xgzovH6+abMXU1J1gNAZ96JB78xfh5n9mv/ v82FVb8ufIIC9UVq9o1jxGGR1jErtE1ARDadvcA7NYX/on6zx8guqwOgjBQSlBWwDFUg r6fPksAprFxRppIeaNpqtupSar/vwTocAkvDUqVfSIvWK5rls0VPrB56+3bWF5pQBRWb 0JmkQ8C4/8dFxifDB/uZ3Zl5UEca/JlvMqsAYo5AfdClHpMMm0nf83MM36oVyewfru+T 2x4jNl7DAjBdf6UUlXdDnbGtl1sGvoF5Y/aM5vpUUyGbw7bk2MU1VoirJ1QL639T7CMp Ydog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=w63PE+GanIzdstZzSxnDj4u4AkPCM4ERaCGFb7/rl+s=; b=aQqMn4hFLU7EuQh4rCjs31XKbJCNH8nd52UmZ+AhbD1krsOppYqrpyAC98nOnzbU1l rGTXZ7cRoP9ZOGkzV8qrzmtuQWPnqJS39OgwFs5hZPvlV+xocLKT7BV0H7Bwt9QYZOHG chIXsEMwsy2wSMOlI+hicBEZPIO5BzwYhJuy8mFmMQKNXhQUfGG/NjTE9/ncaCMDi3LM UJ1htdiuH9H5bH1jdLt/yFta4ZD3e0NphU8yTARtduH2PDDyEyg4eQU2Gz0FTx9kyCPx CQa96Kec/FsjJ+URYAHsMCqaH3tjgtpsNfsamjdhPnfwz0OUurQxlA+vTg1cxrAb1J4k zBWA== X-Gm-Message-State: ALQs6tC05q+AfeuD9+2mrpRXuWvrDI35uJ+VXb3lK5CbFRCuUoM0SSnx TLR6YMcuvgeiGLwq8eEhf8k2jQ== X-Google-Smtp-Source: AIpwx4+FnZWoWLPc08QG3yC62n7aIrsoHJjZfN/nyVMBYIUTkCE1Lly+vlxbcTAA1ZF7w+Uahwsi6g== X-Received: by 10.28.16.18 with SMTP id 18mr2550838wmq.81.1523452891168; Wed, 11 Apr 2018 06:21:31 -0700 (PDT) Received: from jinpu-GA-870A-USB3.pb.local ([62.217.45.26]) by smtp.gmail.com with ESMTPSA id p14sm2331519wrc.30.2018.04.11.06.21.30 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 11 Apr 2018 06:21:30 -0700 (PDT) From: Jack Wang X-Google-Original-From: Jack Wang To: axboe@kernel.dk Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Jack Wang Subject: [PATCH] block: ratelimite pr_err on IO path Date: Wed, 11 Apr 2018 15:21:29 +0200 Message-Id: <1523452889-16331-1-git-send-email-jinpu.wangl@profitbricks.com> X-Mailer: git-send-email 2.7.4 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Jack Wang This avoid soft lockup below: [ 2328.328429] Call Trace: [ 2328.328433] vprintk_emit+0x229/0x2e0 [ 2328.328436] ? t10_pi_type3_verify_ip+0x20/0x20 [ 2328.328437] printk+0x52/0x6e [ 2328.328439] t10_pi_verify+0x9e/0xf0 [ 2328.328441] bio_integrity_process+0x12e/0x220 [ 2328.328442] ? t10_pi_type1_verify_crc+0x20/0x20 [ 2328.328443] bio_integrity_verify_fn+0xde/0x140 [ 2328.328447] process_one_work+0x13f/0x370 [ 2328.328449] worker_thread+0x62/0x3d0 [ 2328.328450] ? rescuer_thread+0x2f0/0x2f0 [ 2328.328452] kthread+0x116/0x150 [ 2328.328454] ? __kthread_parkme+0x70/0x70 [ 2328.328457] ret_from_fork+0x35/0x40 Signed-off-by: Jack Wang --- block/t10-pi.c | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/block/t10-pi.c b/block/t10-pi.c index a98db38..35967d5 100644 --- a/block/t10-pi.c +++ b/block/t10-pi.c @@ -84,10 +84,12 @@ static blk_status_t t10_pi_verify(struct blk_integrity_iter *iter, if (be32_to_cpu(pi->ref_tag) != lower_32_bits(iter->seed)) { - pr_err("%s: ref tag error at location %llu " \ - "(rcvd %u)\n", iter->disk_name, - (unsigned long long) - iter->seed, be32_to_cpu(pi->ref_tag)); + pr_err_ratelimited("%s: ref tag error at " + "location %llu (rcvd %u)\n", + iter->disk_name, + (unsigned long long) + iter->seed, + be32_to_cpu(pi->ref_tag)); return BLK_STS_PROTECTION; } break; @@ -101,10 +103,12 @@ static blk_status_t t10_pi_verify(struct blk_integrity_iter *iter, csum = fn(iter->data_buf, iter->interval); if (pi->guard_tag != csum) { - pr_err("%s: guard tag error at sector %llu " \ - "(rcvd %04x, want %04x)\n", iter->disk_name, - (unsigned long long)iter->seed, - be16_to_cpu(pi->guard_tag), be16_to_cpu(csum)); + pr_err_ratelimited("%s: guard tag error at sector %llu " + "(rcvd %04x, want %04x)\n", + iter->disk_name, + (unsigned long long)iter->seed, + be16_to_cpu(pi->guard_tag), + be16_to_cpu(csum)); return BLK_STS_PROTECTION; }