Received: by 2002:a25:824b:0:0:0:0:0 with SMTP id d11csp730412ybn; Wed, 25 Sep 2019 06:57:18 -0700 (PDT) X-Google-Smtp-Source: APXvYqxz2bz8vsmmhBBRzEkGwLF4KvYBSY4QInuyGxoc6HgKoLbcCt4UJpXOmJrf67WX8DvrJ1S6 X-Received: by 2002:a17:906:6d1:: with SMTP id v17mr4111761ejb.74.1569419838472; Wed, 25 Sep 2019 06:57:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1569419838; cv=none; d=google.com; s=arc-20160816; b=HMjG38/l2x/vXr59LoxSdAK7EzwE8BxrnMHhhs/SsTq3kxVsycUHhP3K996xNeycEO mPi9yyO445qZIqOR0XSzd6DjLI+WXYznySawfDOwTWCEVy8GScz6x01k0/d2POJiLj8L qNJFfrjEWeDsRAZ82m2s7ZF6N1qeBOp/5Oijaq9pT8JOVcanwaAlKB3Gg0fXv97N06HI +4F+UCYwIP0FGLiTjiedZzucydv1162B765mk0LxHKxcj1uJPVuqJe4cYc3MfN93mqbp Xdod1vaYSZlSHrNZTyc5HW4qX2wWeXcmD4ZtSxy6nqKFoMbNA99rXX2frq46lj7zC0OW dRfA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:organization:from:references:cc:to:subject:reply-to; bh=3PwMn2YEjlUJRkfotbTy+c3Hn5hUOXwAI3NJinXbsks=; b=zblM5815m0zQ6l0jREGJH5jiW84dmO/ETYdVnoWQ9p7wdkfU82qOWn/DZrR62ecPjp yPCrh6u/X57HsxyqikAmsigr386g+XcTqVccnn/SOVycCDvaN6CgTaGHJJfUNw98uDq/ bZn/cuOW0sDYnfp+vR/YZje4b+R2VQJ4YFbk8/LcLBi3/l1rf4o01jxB0k2/ozDrIyQQ xESuDHQ45fuBghK3lhiQdEh9pOOkhDWlS9WYGWtWDdWgieIM+58vCx0nE2BtTFZ9qqFY nZuWqFxE4Z2f5vSsV2T2pJyPGVc3dWQfHRhsEZHIk+H2jyChZsKU9hFG6ZU24AVc43zN hv7w== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id fy7si2654947ejb.13.2019.09.25.06.56.54; Wed, 25 Sep 2019 06:57:18 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2407623AbfIWNYO (ORCPT + 99 others); Mon, 23 Sep 2019 09:24:14 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57638 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2407081AbfIWNYO (ORCPT ); Mon, 23 Sep 2019 09:24:14 -0400 Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id B2A8F81DEC for ; Mon, 23 Sep 2019 13:24:13 +0000 (UTC) Received: by mail-pf1-f198.google.com with SMTP id s139so10046104pfc.21 for ; Mon, 23 Sep 2019 06:24:13 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:reply-to:subject:to:cc:references:from :organization:message-id:date:user-agent:mime-version:in-reply-to :content-language:content-transfer-encoding; bh=3PwMn2YEjlUJRkfotbTy+c3Hn5hUOXwAI3NJinXbsks=; b=HDHXJVcN64XssKQy+Zgkubi/Q8DA/FSBKqCSIXI3BnbBspOBfkSmETgTrJv4wWZPPy PqLUcW2GVbxHqHjXJdsNE86FxJ1bLcVpyKrx6lDmgvhQW3Yxg/Z+OCMMK4NbnKjC4WtG bP6ll7KuP09MaErrSX9wkbxq/rwhw3eqcCX+9hGfpSL1L1eBwvZnXesLsZ4b6x+K9HKz n+sf9/KvEFpuB/KLNuKymTOt9W7bHvqPRknW5vgXF2xTVCRq/2HyA+hewdrKYGHJ5JTG 1J1XDvjLJNn4uFfIb3pgljoxsMi6B+M+DvAjLYgAWfSnOLKBCcUYylxsFVf3PEuqUVzu bG8w== X-Gm-Message-State: APjAAAUddgZj39nzPydQxEaXvXx4plRBN8q8xqLJqwQg8Yd2UtJzNRAr peY5aV8ne3p3Wi+pnWj8oz9rMytqOhOEZCHHRh5NOpVQn//SJMnYAExPHnn9qDvH59LY+Gr6MZv DpzlojDWYH/ZWpzlOW2+Lkq16 X-Received: by 2002:aa7:9aaa:: with SMTP id x10mr32448750pfi.173.1569245052735; Mon, 23 Sep 2019 06:24:12 -0700 (PDT) X-Received: by 2002:aa7:9aaa:: with SMTP id x10mr32448727pfi.173.1569245052477; Mon, 23 Sep 2019 06:24:12 -0700 (PDT) Received: from [10.76.0.39] ([125.16.200.50]) by smtp.gmail.com with ESMTPSA id g202sm15824616pfb.155.2019.09.23.06.24.10 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 23 Sep 2019 06:24:11 -0700 (PDT) Reply-To: mgandhi@redhat.com Subject: Re: [PATCH] scsi: core: Log SCSI command age with errors To: Laurence Oberman , linux-kernel@vger.kernel.org, linux-scsi@vger.kernel.org Cc: jejb@linux.ibm.com, martin.petersen@oracle.com References: <20190923060122.GA9603@machine1> <8e9c537b7eaabd611968d22ec31f7cfb90e72efe.camel@redhat.com> From: "Milan P. Gandhi" Organization: Red Hat Message-ID: Date: Mon, 23 Sep 2019 18:54:08 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.6.1 MIME-Version: 1.0 In-Reply-To: <8e9c537b7eaabd611968d22ec31f7cfb90e72efe.camel@redhat.com> Content-Type: text/plain; charset=utf-8 Content-Language: en-US Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/23/19 6:32 PM, Laurence Oberman wrote: > On Mon, 2019-09-23 at 11:31 +0530, Milan P. Gandhi wrote: >> Couple of users had requested to print the SCSI command age along >> with command failure errors. This is a small change, but allows >> users to get more important information about the command that was >> failed, it would help the users in debugging the command failures: >> >> Signed-off-by: Milan P. Gandhi >> --- >> diff --git a/drivers/scsi/scsi_logging.c >> b/drivers/scsi/scsi_logging.c >> index ecc5918e372a..ca2182bc53c6 100644 >> --- a/drivers/scsi/scsi_logging.c >> +++ b/drivers/scsi/scsi_logging.c >> @@ -437,6 +437,7 @@ void scsi_print_result(const struct scsi_cmnd >> *cmd, const char *msg, >> const char *mlret_string = scsi_mlreturn_string(disposition); >> const char *hb_string = scsi_hostbyte_string(cmd->result); >> const char *db_string = scsi_driverbyte_string(cmd->result); >> + unsigned long cmd_age = (jiffies - cmd->jiffies_at_alloc) / HZ; >> >> logbuf = scsi_log_reserve_buffer(&logbuf_len); >> if (!logbuf) >> @@ -478,10 +479,15 @@ void scsi_print_result(const struct scsi_cmnd >> *cmd, const char *msg, >> >> if (db_string) >> off += scnprintf(logbuf + off, logbuf_len - off, >> - "driverbyte=%s", db_string); >> + "driverbyte=%s ", db_string); >> else >> off += scnprintf(logbuf + off, logbuf_len - off, >> - "driverbyte=0x%02x", driver_byte(cmd- >>> result)); >> + "driverbyte=0x%02x ", >> + driver_byte(cmd->result)); >> + >> + off += scnprintf(logbuf + off, logbuf_len - off, >> + "cmd-age=%lus", cmd_age); >> + >> out_printk: >> dev_printk(KERN_INFO, &cmd->device->sdev_gendev, "%s", logbuf); >> scsi_log_release_buffer(logbuf); >> > > This looks to be a useful debug addition to me, and the code looks > correct. > I believe this has also been tested by Milan in our lab. > > Reviewed-by: Laurence Oberman > Yes, the patch was tested locally using scsi_debug as well as in real storage issues caused by bad disks in customer environment. Thanks, Milan.