Received: by 10.213.65.68 with SMTP id h4csp1917133imn; Sun, 1 Apr 2018 19:12:03 -0700 (PDT) X-Google-Smtp-Source: AIpwx49jo50asunp9QTQ4uLr2CBKKvh3L1PzJ/Nvh8R37kl07zl+o07RSnr1pdZqs6RyvwR3AGYU X-Received: by 10.98.189.24 with SMTP id a24mr6039456pff.125.1522635123505; Sun, 01 Apr 2018 19:12:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1522635123; cv=none; d=google.com; s=arc-20160816; b=QdhvyafurhITUk0s5G/b5xczkm3DUzQHfkiLsV/Fa9Bs6nQEHuZN9Prw2Rs22EMvk0 CZFayEl8eunhc8OsxMGJzKojcdzvDSuFLLXx/ZpWvew/qsNR1L3Qb3OTs+jVGF3r9WsH GDcCcQXmRi8m662OsAJD6upZhhfKoFs84fkXoLNEefPe+rtIyYfwQkhdQKldtZHuV/cB xpXKHr725d8pFm3U2z137E3LnnylounQZjVF+pj/iR038FvCuiRbpmFHbAp+YaeqQX+8 Lv+pPbmFI5mZ6soKx20urIeF2QFcyuBJbpkns09DhGO+xSPQiNwigPnp/vuN2Kap1+SJ SvFQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature:arc-authentication-results; bh=tBGXV881QwGExM06v+CsqPzfAeSS0p910RZzg4tfZro=; b=EZF+a/jzipTZRNA4WryPNitM3HGaPJktjxz8CcRuyi4jw57InqGZYr/22KHUirVPBz hJt2XZDZmzCDn0djd3M1A5A9TX6WETW8KzoEc2iQBI46KtS25d/FK9Ik61ihSvuEDVwx kHGsZzxpguADMCoNcrKlaBbLZw2/HIp6YlDaFrvpxkBcdoIzWyvGOmx8qCMjJXCHU6By bqyZBvxw/vqzoynNOfSRjent4xn6w7E6HzSnPpHlLABNggDE7MXwVSFeaYh3x/N4vMWx YiebwAlZ1+dLT71Vd+F2Q6ov/3YLkCbIjotDhkkOm9nxipg4yMeIracrPtowauDf6gM6 gcLg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=daB4CAGN; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h2si9067736pgc.177.2018.04.01.19.11.47; Sun, 01 Apr 2018 19:12:03 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=daB4CAGN; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754080AbeDBCKi (ORCPT + 99 others); Sun, 1 Apr 2018 22:10:38 -0400 Received: from mail-pl0-f67.google.com ([209.85.160.67]:46166 "EHLO mail-pl0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754036AbeDBCKh (ORCPT ); Sun, 1 Apr 2018 22:10:37 -0400 Received: by mail-pl0-f67.google.com with SMTP id 59-v6so568000plc.13; Sun, 01 Apr 2018 19:10:36 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=tBGXV881QwGExM06v+CsqPzfAeSS0p910RZzg4tfZro=; b=daB4CAGN35lHLPD3a+TikiHGCPkw65CbtcoAd8zZxw70JJBVW+j5ZTU+5ivtNbz96R inteL0UOWhFQB0a8UWKT+qVZQG5s7Xgws9EZwUWG9D5+gYmMzkgIH+5+6k3zEruFa2zu GSkk1LJbZGbY/9wvqTg9+YY0a02loyZZh4i8GD44KvWxAaDtZADV2fGFP9JMBxCb+KAx nEUcg/nKbOHf53Y4jmBMhkyfmC5wjGllcWGUvsBE8ZGPJZp92SgkwEibulaDOuWDn4tr bK2MAhBD7ZeAfQLZI6PpqZfOAr5Yn0gOGY1gNcVNMlSU3tXTtnOQs/HgzDW0blO+JsuX l6Zw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=tBGXV881QwGExM06v+CsqPzfAeSS0p910RZzg4tfZro=; b=g+QWQTa136dDLL/4YlgC/A6a13UR4D/v7EVs2ATu+W4eUCqOZeAI3jGS4HB0PdHn89 fmyBkT5FbbQE5izynrnxJTIwh2TteV9JcGm8XSvqv61SA2Cp1pux1zdCyet9UXjLl6bG UlAAwNl1g6uRVp31iNYnvac/1VQD41tELTCNwoNHsBD8ogfy7C0geWXCRklLJsvnCyyP ocngEAKkjHuBbpV8GZfnr0/iaBVsFq3u/6gM8CK0VjCFQW3fFe4erSKsAI0JVxztqmJF WTOj/tQQ6O2f/mao9L58lAayH2tg9YRPU0maUpe/clsbrqnZmgDuJ7InZId8BE0OewBC PZzQ== X-Gm-Message-State: AElRT7FZ4GcpnYUSb+wFEMZM3M3hE/V4bH0orpY9yphsbjT0DjkrnG4y CEXBF0Fpi4qt4X9SIStqtnk= X-Received: by 2002:a17:902:8646:: with SMTP id y6-v6mr8206698plt.182.1522635036670; Sun, 01 Apr 2018 19:10:36 -0700 (PDT) Received: from localhost ([175.223.19.139]) by smtp.gmail.com with ESMTPSA id e21sm24269506pfi.68.2018.04.01.19.10.34 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sun, 01 Apr 2018 19:10:35 -0700 (PDT) Date: Mon, 2 Apr 2018 11:10:32 +0900 From: Sergey Senozhatsky To: Wen Yang Cc: jejb@linux.vnet.ibm.com, martin.petersen@oracle.com, linux-scsi@vger.kernel.org, linux-kernel@vger.kernel.org, Bart.VanAssche@wdc.com, pmladek@suse.com, sergey.senozhatsky.work@gmail.com, tj@kernel.org, jiang.biao2@zte.com.cn, zhong.weidong@zte.com.cn, Tan Hu Subject: Re: [PATCH v2] scsi: Introduce sdev_printk_ratelimited to throttle frequent printk Message-ID: <20180402021032.GE3795@jagdpanzerIV> References: <1522634332-151328-1-git-send-email-wen.yang99@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1522634332-151328-1-git-send-email-wen.yang99@zte.com.cn> User-Agent: Mutt/1.9.4 (2018-02-28) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, On (04/02/18 09: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. Did you test the patch? Rate limiting does not completely remove printk calls. printk is still there, in a loop under spin_lock. A big enough I/O request queue can cause the same lockup problems. -ss