Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp2401856imm; Tue, 4 Sep 2018 03:59:17 -0700 (PDT) X-Google-Smtp-Source: ANB0VdaWkqhWDQMZvN3jnX9R03Y9GCNSt5dt8tuybekM1IPqRm7ByIqSfU9dyanTa0WrfJtz20+B X-Received: by 2002:a17:902:e20b:: with SMTP id ce11-v6mr33464034plb.136.1536058757099; Tue, 04 Sep 2018 03:59:17 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536058757; cv=none; d=google.com; s=arc-20160816; b=bfqz1MLjmSMCX2rH9z+FGHUR+9qS6PzXqbj7wuOAdUXc5V+9KKmg5cR0Db7kp4yK2Z a0XzxDdkOSDIgsloieENIC0XYqGyf1QYOdOs2xdY3avBCkolnhF4syH4VMAWwGDNbiE7 2sySqmnYSknzC+i8RUdVRrdeYcoUV0Q/UZEAsh6YCY5R0FVXv6aT/+SIFPULDnR2sva3 frEvfnGlatrsZPDmGqAya91lywxYepAJiTyYtPO+HUI+ynWK2FoR1XzdjcxTrFLOzTBV K5SjWxoLMFxnm71A3nXGmuvtUgLqjlotFR1jzUUqjfJNDLpYrl2GIkgGqWS1D/A4O2fe IH7w== 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:from:references:cc:to:subject:dkim-signature :arc-authentication-results; bh=/tBmxR8wU32IhszEJXa8aMo6L0IWseZRyICM24Wp3Q8=; b=d//sncNAIs1Rh9AMqDeYMk6+zqwcMXqnuuLlS+4eaOhDwX0i3geApuYk9Nx8kTKkoF oLHF9PetrtJ5QiaKQdmAMANq8uyrN1P3XSmyHDzula43u14e7R7BgbzyVDysi9IXK3Ed +c/h0S8GQOrJJVYqZCeW73mFkAAzb8cMq0SMExAEOo16nOKVY57aSqQ4tDLh6LPvl6/j uX/1AoDCp/+c4whmYTdc1OFCycOZ6bZaUVkDutsuOVWpYD+5vHieVJODB3Uk4cQfUX5n eXtHISVuxntpETaqyI8UQ1EFXoawaqW+EF9MYhcu+WL50c31W7i2NRFbV8xdVI5Yft7W DboQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=lGZeKg6D; 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 r9-v6si19954054pgh.500.2018.09.04.03.59.01; Tue, 04 Sep 2018 03:59:17 -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=@lightnvm-io.20150623.gappssmtp.com header.s=20150623 header.b=lGZeKg6D; 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 S1727582AbeIDPV6 (ORCPT + 99 others); Tue, 4 Sep 2018 11:21:58 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:37464 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727335AbeIDPV5 (ORCPT ); Tue, 4 Sep 2018 11:21:57 -0400 Received: by mail-lf1-f66.google.com with SMTP id j8-v6so2573271lfb.4 for ; Tue, 04 Sep 2018 03:57:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=lightnvm-io.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=/tBmxR8wU32IhszEJXa8aMo6L0IWseZRyICM24Wp3Q8=; b=lGZeKg6DtENbRntllUWqYYRfiKBDQxC5CDpW4XBk7diNtINPKfD9oQIE7EwlWUAVea BJjnX4IOLrCIvavzCYbhpu/tFupEQbPQgivjFbdw5ClRVewRgotKeNdd9g0lLuP1X0Qu pWXrPk7G9quljzsk5PvuzFOyZfz4LiFkMZ3qEZSKWYHa1qs7sbVNOAk42uq7NRP899jf lolx+Uq32uYrzIZ/SQMbZku1GKufET+k0I2pQ6tz48zbNQv0Cnw/0mMFdidarM2I99a7 IUNuflqXcAULR+jDy+qSwE/KDCQYz8amspfdJtGZVEkVpKXUpEl4it9AY9hJlz6Waa1j +D+w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=/tBmxR8wU32IhszEJXa8aMo6L0IWseZRyICM24Wp3Q8=; b=USgWqNXoAFopusA3oO3ZoU510ONszW5CYAIGX8OTI2TXYovPaqYo+pWYjCDRRHECEa nODSkTVh0FEUGy6DLJtg2FB7APLiDiBHIb0t/KaaRJtp4wY4Ahi2neVGokMlbWFbL/Ys 2XIP1obHyTCNYxTDy3coW6VgvfRIuG/rGM0DbmT5Y2BMt9Jedof8lDe0onUJvkDPl+V/ iUrw7bjER4GQbdm91Jr7v8j3Py+WKYIuLIVVbBAQb9idBmAqImdpE44KSn7H+SE3nOls 7cn5DI9hqfpm5Pbe3KDsEQxgJb+baem0HmlAqcdnxDw+HMXbztmDOG67+iW1m1yNqBRL B/WA== X-Gm-Message-State: APzg51BC+yFrxagRz7rhscjBsryEzQgI/xfMXQyOi8VRFvGkY5rd0P7O ltV8jWLCZV4A7/TfFD50d6Lr8A== X-Received: by 2002:a19:d206:: with SMTP id j6-v6mr8205858lfg.31.1536058639719; Tue, 04 Sep 2018 03:57:19 -0700 (PDT) Received: from [192.168.0.10] (95-166-82-66-cable.dk.customer.tdc.net. [95.166.82.66]) by smtp.googlemail.com with ESMTPSA id o102-v6sm3068310lfi.53.2018.09.04.03.57.18 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 04 Sep 2018 03:57:18 -0700 (PDT) Subject: Re: [PATCH V2] lightnvm: pblk: add tracing for chunk resets To: hans.ml.holmberg@owltronix.com Cc: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, javier@cnexlabs.com, hans.holmberg@cnexlabs.com References: <1536057487-17267-1-git-send-email-hans.ml.holmberg@owltronix.com> From: =?UTF-8?Q?Matias_Bj=c3=b8rling?= Message-ID: <76c839e6-7a30-7365-1813-d1f2aa81f4c8@lightnvm.io> Date: Tue, 4 Sep 2018 12:57:18 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.5.0 MIME-Version: 1.0 In-Reply-To: <1536057487-17267-1-git-send-email-hans.ml.holmberg@owltronix.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/04/2018 12:38 PM, Hans Holmberg wrote: > From: Hans Holmberg > > Trace state of chunk resets. > > Signed-off-by: Hans Holmberg > Signed-off-by: Matias Bjørling > > --- > > You already picked up the first version of this patch Matias, > but here's a V2 adressing the review comment from Javier that came > after that. > > Changes in V2: > Moved the synchronous PBLK_CHUNK_RESET_START trace to > pblk_blk_erase_sync (as Javier suggested) > > drivers/lightnvm/pblk-core.c | 12 ++++++++++++ > drivers/lightnvm/pblk-trace.h | 31 +++++++++++++++++++++++++++++++ > drivers/lightnvm/pblk.h | 6 ++++++ > 3 files changed, 49 insertions(+) > > diff --git a/drivers/lightnvm/pblk-core.c b/drivers/lightnvm/pblk-core.c > index 73f117bc99a9..951f81a1b273 100644 > --- a/drivers/lightnvm/pblk-core.c > +++ b/drivers/lightnvm/pblk-core.c > @@ -90,9 +90,15 @@ static void __pblk_end_io_erase(struct pblk *pblk, struct nvm_rq *rqd) > atomic_dec(&line->left_seblks); > > if (rqd->error) { > + trace_pblk_chunk_reset(pblk_disk_name(pblk), > + &rqd->ppa_addr, PBLK_CHUNK_RESET_FAILED); > + > chunk->state = NVM_CHK_ST_OFFLINE; > pblk_mark_bb(pblk, line, rqd->ppa_addr); > } else { > + trace_pblk_chunk_reset(pblk_disk_name(pblk), > + &rqd->ppa_addr, PBLK_CHUNK_RESET_DONE); > + > chunk->state = NVM_CHK_ST_FREE; > } > > @@ -923,6 +929,9 @@ static int pblk_blk_erase_sync(struct pblk *pblk, struct ppa_addr ppa) > struct nvm_rq rqd = {NULL}; > int ret; > > + trace_pblk_chunk_reset(pblk_disk_name(pblk), &ppa, > + PBLK_CHUNK_RESET_START); > + > pblk_setup_e_rq(pblk, &rqd, ppa); > > /* The write thread schedules erases so that it minimizes disturbances > @@ -1736,6 +1745,9 @@ int pblk_blk_erase_async(struct pblk *pblk, struct ppa_addr ppa) > rqd->end_io = pblk_end_io_erase; > rqd->private = pblk; > > + trace_pblk_chunk_reset(pblk_disk_name(pblk), > + &ppa, PBLK_CHUNK_RESET_START); > + > /* The write thread schedules erases so that it minimizes disturbances > * with writes. Thus, there is no need to take the LUN semaphore. > */ > diff --git a/drivers/lightnvm/pblk-trace.h b/drivers/lightnvm/pblk-trace.h > index c171d0450c07..679e5c458ca6 100644 > --- a/drivers/lightnvm/pblk-trace.h > +++ b/drivers/lightnvm/pblk-trace.h > @@ -31,6 +31,37 @@ struct ppa_addr; > { PBLK_STATE_RECOVERING, "RECOVERING", }, \ > { PBLK_STATE_STOPPED, "STOPPED" }) > > +#define show_chunk_erase_state(state) __print_symbolic(state, \ > + { PBLK_CHUNK_RESET_START, "START", }, \ > + { PBLK_CHUNK_RESET_DONE, "OK", }, \ > + { PBLK_CHUNK_RESET_FAILED, "FAILED" }) > + > + > +TRACE_EVENT(pblk_chunk_reset, > + > + TP_PROTO(const char *name, struct ppa_addr *ppa, int state), > + > + TP_ARGS(name, ppa, state), > + > + TP_STRUCT__entry( > + __string(name, name) > + __field(u64, ppa) > + __field(int, state); > + ), > + > + TP_fast_assign( > + __assign_str(name, name); > + __entry->ppa = ppa->ppa; > + __entry->state = state; > + ), > + > + TP_printk("dev=%s grp=%llu pu=%llu chk=%llu state=%s", __get_str(name), > + (u64)(((struct ppa_addr *)(&__entry->ppa))->m.grp), > + (u64)(((struct ppa_addr *)(&__entry->ppa))->m.pu), > + (u64)(((struct ppa_addr *)(&__entry->ppa))->m.chk), > + show_chunk_erase_state((int)__entry->state)) > + > +); > > TRACE_EVENT(pblk_chunk_state, > > diff --git a/drivers/lightnvm/pblk.h b/drivers/lightnvm/pblk.h > index ae705fb52cf7..f0fcd963ab3a 100644 > --- a/drivers/lightnvm/pblk.h > +++ b/drivers/lightnvm/pblk.h > @@ -79,6 +79,12 @@ enum { > PBLK_BLK_ST_CLOSED = 0x2, > }; > > +enum { > + PBLK_CHUNK_RESET_START, > + PBLK_CHUNK_RESET_DONE, > + PBLK_CHUNK_RESET_FAILED, > +}; > + > struct pblk_sec_meta { > u64 reserved; > __le64 lba; > Thanks. Applied for 4.20 (replaced the previous one)