Received: by 10.213.65.68 with SMTP id h4csp1931434imn; Sun, 1 Apr 2018 19:39:12 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/hTLDDNYRPSq7sNCMWOU3jadIPJxZlYpBUe9+wZdxkcVWy7OJz7buoaAOkh3bNQ9tLZrZ4 X-Received: by 10.98.13.151 with SMTP id 23mr6080832pfn.120.1522636752667; Sun, 01 Apr 2018 19:39:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522636752; cv=none; d=google.com; s=arc-20160816; b=GSJVdHOY0GyiZVCin/pm5EDSce+EYMmIG7gDljrPkIIAsVs9l/O+gmD94CvfF8pPpq zYkcB0qv5rqP05K+ySYBAX+hrxK34Ictshz6uiXsxxikultgOAAragEhaGG7gjY/gNRr 3aDLo2W4rZtAnjVSMVBWuYbzsppeC0n92KVbk3KY4uwo+6uzVV4dLJR7Kh63TQkk8MCe hTNIeqSP7mgsgo455QYA0J9EBgSW5+xq84LpqSwnKInSZv+GLPNyPx6dQ2uYgYpGHtqU Eo8KAHA+n7rhM/lB9NzbEFHAh8U8sWpejV0U3Bm97T1QTlqAdWIjwpD8HHI/8clptC+R FQUw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject:arc-authentication-results; bh=a5JipsL8jVeAGy7Ih8loirKu3BYQjBrH07vhscXMp34=; b=muDm3BS5qmYmA3RbWj2vgiDFoUqDMirg4thK/TPQu/kYYV17N2pp/n+quHXR9NG+WS TwymbfGT6b5YrkaE/8PNpWHMUPPz+TQitprK9JRuAD1E6MWHeOvWaHyOvfgzWI2KX8hv DRy3aR8W87PcM/1uaAlxc4hdidipPjwlb7s3Yy/gmu+sUH8+91u/9qNTYE344NcOogD0 n9tJlC7cC130aQIeSgrVGSvhby1m54MVQnAQFKZZfHzGY39neRiLqaFDTpWxSMmrh25H wh9Oa/pgiozc01ce3vI4YevDjx2OYkw/NcLtWmxwh/8oPFmg34K9vKLZ40l1m0+e03B8 hybA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m124si242877pga.621.2018.04.01.19.38.58; Sun, 01 Apr 2018 19:39:12 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754114AbeDBChw (ORCPT + 99 others); Sun, 1 Apr 2018 22:37:52 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:7143 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753992AbeDBChu (ORCPT ); Sun, 1 Apr 2018 22:37:50 -0400 Received: from DGGEMS404-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 581145FE3535E; Mon, 2 Apr 2018 10:37:36 +0800 (CST) Received: from [127.0.0.1] (10.177.96.203) by DGGEMS404-HUB.china.huawei.com (10.3.19.204) with Microsoft SMTP Server id 14.3.361.1; Mon, 2 Apr 2018 10:37:35 +0800 Subject: Re: [PATCH v2] scsi: Introduce sdev_printk_ratelimited to throttle frequent printk To: Wen Yang , , References: <1522634332-151328-1-git-send-email-wen.yang99@zte.com.cn> CC: , , , , , , , , Tan Hu From: Jason Yan Message-ID: <5AC1976F.1040801@huawei.com> Date: Mon, 2 Apr 2018 10:37:35 +0800 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: <1522634332-151328-1-git-send-email-wen.yang99@zte.com.cn> Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.177.96.203] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi, Yang, On 2018/4/2 9:58, Wen Yang wrote: > There would be so many same lines printed by frequent printk if one > disk went wrong, like, > [ 546.185242] sd 0:1:0:0: rejecting I/O to offline device > [ 546.185258] sd 0:1:0:0: rejecting I/O to offline device > [ 546.185280] sd 0:1:0:0: rejecting I/O to offline device > [ 546.185307] sd 0:1:0:0: rejecting I/O to offline device > [ 546.185334] sd 0:1:0:0: rejecting I/O to offline device > [ 546.185364] sd 0:1:0:0: rejecting I/O to offline device > [ 546.185390] sd 0:1:0:0: rejecting I/O to offline device > [ 546.185410] sd 0:1:0:0: rejecting I/O to offline device > For slow serial console, the frequent printk may be blocked for a > long time, and if any spin_lock has been acquired before the printk > like in scsi_request_fn, watchdog could be triggered. > > Related disscussion can be found here, > https://bugzilla.kernel.org/show_bug.cgi?id=199003 > And Petr brought the idea to throttle the frequent printk, it's > useless to print the same lines frequently after all. > It's true that this print for the same device is useless. But it's useful for different devices. Is it possible to limit the print only for the same device? Thanks, Jason > >