Received: by 2002:a05:6a10:af89:0:0:0:0 with SMTP id iu9csp5539387pxb; Wed, 26 Jan 2022 14:30:54 -0800 (PST) X-Google-Smtp-Source: ABdhPJw5nIDmqYKNzPtZfiK/v4P3+RWex0PNxzofVvrQRY78yDnAquoLvSrr3Eue51GZQIRjResy X-Received: by 2002:a17:906:9491:: with SMTP id t17mr631557ejx.339.1643236254482; Wed, 26 Jan 2022 14:30:54 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1643236254; cv=none; d=google.com; s=arc-20160816; b=DA0vi2FXUr9OYEqRY8PxAWH/oLH+JQIikZWHLNaMUydsLrgL5672U/SMaLkHGkXjSU 6l+owiFDyLhoDtZ7AveetNfnfMg+uDd2ahn4NAcK5W0ote+QyCswCvWZpl2o+vpJ7OFD Xyz3NaXhbpW+kyt0/F5TTeU8ZjaIHHeHEaAg9bh3WkzOFj0S6vToSTUb9VChXLqBydVl F08+eKkJlq5Cj0b7JjqB9iMYVq93VdXOsvvlcD6HWT3wHUjj05YkrQabExrFmHKHKkVR E+M6YZFxEa0DynEqYXzzUlurGs7zNOKr5nGlT5dHjgB8WGd7FMXmnlj/UndxwvhXtqmF uDjw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=yIv2lBySDQKuLdPHpVEfN5DTmOKpNIBBtz27Np5pjBs=; b=ZvT5cskmE34+8QU8iXOO+2koJ1zColKPOdYrkxMgGgNgX3JFgVlpaaENucHxp6qH1g RlGXtBrubKXuDOS1M+Ym693muZUvo11AY6Xh5xueit+g1vdT/21p7mhxBXpriq41BkHa xSYFyj2L5h4FcdrWjqmO+rAFi9AmWKvzH+5it+AwMWsuG1X+tYcaUGvESbQpFk477S+x uMAzBt5EeEjjxeyPV0n6c6WSmEB2Sd7+KnTMNHndiiAXtvuawt/DuFT5sEK+ZI91HOhM o0m7XbIsZj01qBZcKizu3ip/Gl9ugUiqWhfcnEl+6sUWu7T0+iAfk2CElouiXqBLGpmV 4O3w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YEIlpKJ9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id h3si309496ejt.402.2022.01.26.14.30.29; Wed, 26 Jan 2022 14:30:54 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=YEIlpKJ9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S244186AbiAZSgN (ORCPT + 99 others); Wed, 26 Jan 2022 13:36:13 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230424AbiAZSgM (ORCPT ); Wed, 26 Jan 2022 13:36:12 -0500 Received: from mail-ed1-x533.google.com (mail-ed1-x533.google.com [IPv6:2a00:1450:4864:20::533]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7CDDBC06161C; Wed, 26 Jan 2022 10:36:12 -0800 (PST) Received: by mail-ed1-x533.google.com with SMTP id a18so415861edj.7; Wed, 26 Jan 2022 10:36:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=yIv2lBySDQKuLdPHpVEfN5DTmOKpNIBBtz27Np5pjBs=; b=YEIlpKJ98MWEUJYL4CbgZhaiOFeTWJ3MJeooSJ4MIVj4L7eOFGHB2ukyAiGsaz47FX z7UvaoDQgwl0jkr/w9d+Lj5TNCHiAovaQWvH5hs0t4iYxygwLdbhT4vuug94xEvdsldk y+gJzkGt9Fz6yN1e1wkgNc9ZSbwkYuafvifedVVjwOSpK5fczlexTSrQjDSGWVC20gGM RmWk/2DXB+1Q3ygO+YoO2U/MuBiLG9bIBMfcmiv91702xVr4q9oI2rFZB4eTB6ZsWN7L 0O5EEBiqYqnqdIc4N94/I+uoo32WKwicF9xKG5xxxwmwpTuhqwiwGE7paSAeFy2oOpxG JJeg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=yIv2lBySDQKuLdPHpVEfN5DTmOKpNIBBtz27Np5pjBs=; b=NyqOefL8DN1kCbs/y75sY+SYql0FT0tkwDOip9rgaHxOD08gqq9mVpG+HFMCe8nibL VfJ3noNdICuPKuPg4ga0kPX37PVkYKe4rPKPr4zemxbQgrjp5z+41O/x2nw0B06AwffV SS137cTayFsNSby9FUnOtv5x3kI9778gXslmubjsX/CI3I1egNrf0GfTi1tiLI7JsbKJ cJuGVmGRoP+B8y1GfuXy+Q2ZJfVZQQEj29wPjXDvdLEmpMetSQFn2p/GlBcOivWaGpF7 0+KEv0Hp1BQI7A+Ehzq7zIz6meLqHKbFSFYa8S38YbBv9dgTnhkT+TF9silh/YTlNhBg wS+g== X-Gm-Message-State: AOAM533tY67ED7OkBaO29CN6HpTuUQWalNOIbbYe0zc/EpBbUqeyzosL OeUkmZ6qbbJTKmWlvRHV/qvHzIJr6vqQWqJjowVpsHg2 X-Received: by 2002:a05:6402:12cf:: with SMTP id k15mr260420edx.299.1643222170905; Wed, 26 Jan 2022 10:36:10 -0800 (PST) MIME-Version: 1.0 References: <20220125203548.352278-1-shy828301@gmail.com> In-Reply-To: From: Yang Shi Date: Wed, 26 Jan 2022 10:35:59 -0800 Message-ID: Subject: Re: [v4 PATCH] block: introduce block_rq_error tracepoint To: Christoph Hellwig Cc: Jens Axboe , Steven Rostedt , Cong Wang , linux-block@vger.kernel.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 26, 2022 at 12:21 AM Christoph Hellwig wrote: > > On Tue, Jan 25, 2022 at 12:35:48PM -0800, Yang Shi wrote: > > Currently, rasdaemon uses the existing tracepoint block_rq_complete > > and filters out non-error cases in order to capture block disk errors. > > > > But there are a few problems with this approach: > > > > 1. Even kernel trace filter could do the filtering work, there is > > still some overhead after we enable this tracepoint. > > > > 2. The filter is merely based on errno, which does not align with kernel > > logic to check the errors for print_req_error(). > > > > 3. block_rq_complete only provides dev major and minor to identify > > the block device, it is not convenient to use in user-space. > > > > So introduce a new tracepoint block_rq_error just for the error case > > and provides the device name for convenience too. With this patch, > > rasdaemon could switch to block_rq_error. > > > > Cc: Jens Axboe > > Reviewed-by: Steven Rostedt > > Signed-off-by: Cong Wang > > Signed-off-by: Yang Shi > > --- > > The v3 patch was submitted in Feb 2020, and Steven reviewed the patch, but > > it was not merged to upstream. See > > https://lore.kernel.org/lkml/20200203053650.8923-1-xiyou.wangcong@gmail.com/. > > > > The problems fixed by that patch still exist and we do need it to make > > disk error handling in rasdaemon easier. So this resurrected it and > > continued the version number. > > > > v3 --> v4: > > * Rebased to v5.17-rc1. > > * Collected reviewed-by tag from Steven. > > > > block/blk-mq.c | 4 +++- > > include/trace/events/block.h | 41 ++++++++++++++++++++++++++++++++++++ > > 2 files changed, 44 insertions(+), 1 deletion(-) > > > > diff --git a/block/blk-mq.c b/block/blk-mq.c > > index f3bf3358a3bb..bb0593f93675 100644 > > --- a/block/blk-mq.c > > +++ b/block/blk-mq.c > > @@ -789,8 +789,10 @@ bool blk_update_request(struct request *req, blk_status_t error, > > #endif > > > > if (unlikely(error && !blk_rq_is_passthrough(req) && > > - !(req->rq_flags & RQF_QUIET))) > > + !(req->rq_flags & RQF_QUIET))) { > > + trace_block_rq_error(req, blk_status_to_errno(error), nr_bytes); > > Please report the atual block layer status code instead of the errno > mapping here. Sure, thanks.