From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from g2t2352.austin.hpe.com (g2t2352.austin.hpe.com [15.233.44.25]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 46BC821A04823 for ; Mon, 1 May 2017 14:27:01 -0700 (PDT) From: "Kani, Toshimitsu" Subject: Re: [PATCH] libnvdimm: rework region badblocks clearing Date: Mon, 1 May 2017 21:26:57 +0000 Message-ID: <1493674015.30303.28.camel@hpe.com> References: <149355594185.9917.1577772489949690281.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <149355594185.9917.1577772489949690281.stgit@dwillia2-desk3.amr.corp.intel.com> Content-Language: en-US Content-ID: <4DD7C073ED202B4DA78149BF6FCDAF7B@NAMPRD84.PROD.OUTLOOK.COM> MIME-Version: 1.0 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" To: "dan.j.williams@intel.com" , "linux-nvdimm@lists.01.org" Cc: "linux-kernel@vger.kernel.org" List-ID: On Sun, 2017-04-30 at 05:39 -0700, Dan Williams wrote: > Toshi noticed that the new support for a region-level badblocks > missed the case where errors are cleared due to BTT I/O. > > An initial attempt to fix this ran into a "sleeping while atomic" > warning due to taking the nvdimm_bus_lock() in the BTT I/O path to > satisfy the locking requirements of __nvdimm_bus_badblocks_clear(). > However, that lock is not needed since we are not acting any data > that is subject to change due to a change of state of the bus / > region. The badblocks instance has its own internal lock to handle > mutations of the error list. > > So, to make it clear that we are just acting on region devices and > don't need the lock rename __nvdimm_bus_badblocks_clear() to > nvdimm_clear_badblocks_regions(). Eliminate the lock and consolidate > all routines in drivers/nvdimm/bus.c. Also, make some cleanups to > remove unnecessary casts, make the calling convention of > nvdimm_clear_badblocks_regions() clearer by replacing struct resource > with the minimal struct clear_badblocks_context, and use the > DEVICE_ATTR macro. > > Cc: Dave Jiang > Cc: Vishal Verma > Reported-by: Toshi Kani > Signed-off-by: Dan Williams Confirmed that the clear path to the region-level badblocks works with the btt workaround and ndctl fix. Tested-by: Toshi Kani Thanks! -Toshi _______________________________________________ Linux-nvdimm mailing list Linux-nvdimm@lists.01.org https://lists.01.org/mailman/listinfo/linux-nvdimm From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751824AbdEAV1F (ORCPT ); Mon, 1 May 2017 17:27:05 -0400 Received: from g2t2352.austin.hpe.com ([15.233.44.25]:21037 "EHLO g2t2352.austin.hpe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751091AbdEAV1C (ORCPT ); Mon, 1 May 2017 17:27:02 -0400 From: "Kani, Toshimitsu" To: "dan.j.williams@intel.com" , "linux-nvdimm@lists.01.org" CC: "linux-kernel@vger.kernel.org" , "dave.jiang@intel.com" , "vishal.l.verma@intel.com" Subject: Re: [PATCH] libnvdimm: rework region badblocks clearing Thread-Topic: [PATCH] libnvdimm: rework region badblocks clearing Thread-Index: AQHSwa+nta9I7uFKMkmISr7SDbaEM6Hf//CA Date: Mon, 1 May 2017 21:26:57 +0000 Message-ID: <1493674015.30303.28.camel@hpe.com> References: <149355594185.9917.1577772489949690281.stgit@dwillia2-desk3.amr.corp.intel.com> In-Reply-To: <149355594185.9917.1577772489949690281.stgit@dwillia2-desk3.amr.corp.intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: authentication-results: intel.com; dkim=none (message not signed) header.d=none;intel.com; dmarc=none action=none header.from=hpe.com; x-originating-ip: [15.219.163.8] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1;AT5PR84MB0259;7:1sM3gJ7uNgM9yqqF57ZeU7eik0vDLZu5yslYaLbsqH4KnL8RPEurnk+mTiaCmn2hd3abzq1fePyEh/ogoMoUKvae5TkMA1RuFPouAIdIuFSBWXkj0cVTFepl9VXaN+g+wmvSrX1vQhSQnMI8iWH4RGt0wy5TlFbnj4+wxhSdeCzyMQK389JsVXAS4a5N0QSXy0YWpfBCo3K9HPdSM9xPjBaVWefpxP5HCRrmuxNzNALKBiHcdqARX/dYmzyD6qrYrvtUAzgjSXdvpDxOmDOvEGR40oTLgKiVEq2bUOriWiV/wLx3uSeWwBupwxuQaGdIDDAA2fyXTksZ5U2+ySAYxQ== x-ms-office365-filtering-correlation-id: a5f8ea76-9a2a-4fee-ae0f-08d490d8cc21 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: UriScan:;BCL:0;PCL:0;RULEID:(22001)(2017030254075)(48565401081)(201703131423075)(201703031133081)(201702281549075);SRVR:AT5PR84MB0259; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(227479698468861)(228905959029699); x-exchange-antispam-report-cfa-test: BCL:0;PCL:0;RULEID:(6040450)(601004)(2401047)(5005006)(8121501046)(93006095)(93001095)(3002001)(10201501046)(6055026)(6041248)(20161123558100)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123555025)(20161123560025)(6072148);SRVR:AT5PR84MB0259;BCL:0;PCL:0;RULEID:;SRVR:AT5PR84MB0259; x-forefront-prvs: 02945962BD x-forefront-antispam-report: SFV:NSPM;SFS:(10019020)(6009001)(39400400002)(39850400002)(39860400002)(39410400002)(39840400002)(39450400003)(24454002)(377424004)(77096006)(6486002)(229853002)(6506006)(54906002)(54356999)(50986999)(189998001)(8676002)(2950100002)(4326008)(478600001)(2501003)(6436002)(122556002)(66066001)(53936002)(6246003)(38730400002)(5660300001)(6512007)(76176999)(102836003)(7736002)(81166006)(2900100001)(8936002)(103116003)(25786009)(86362001)(33646002)(3660700001)(305945005)(3280700002)(36756003)(2906002)(6116002)(3846002);DIR:OUT;SFP:1102;SCL:1;SRVR:AT5PR84MB0259;H:AT5PR84MB0260.NAMPRD84.PROD.OUTLOOK.COM;FPR:;SPF:None;MLV:sfv;LANG:en; spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="utf-8" Content-ID: <4DD7C073ED202B4DA78149BF6FCDAF7B@NAMPRD84.PROD.OUTLOOK.COM> MIME-Version: 1.0 X-MS-Exchange-CrossTenant-originalarrivaltime: 01 May 2017 21:26:57.6302 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 105b2061-b669-4b31-92ac-24d304d195dc X-MS-Exchange-Transport-CrossTenantHeadersStamped: AT5PR84MB0259 X-OriginatorOrg: hpe.com Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from base64 to 8bit by mail.home.local id v41LRGec024082 On Sun, 2017-04-30 at 05:39 -0700, Dan Williams wrote: > Toshi noticed that the new support for a region-level badblocks > missed the case where errors are cleared due to BTT I/O. > > An initial attempt to fix this ran into a "sleeping while atomic" > warning due to taking the nvdimm_bus_lock() in the BTT I/O path to > satisfy the locking requirements of __nvdimm_bus_badblocks_clear(). > However, that lock is not needed since we are not acting any data > that is subject to change due to a change of state of the bus / > region. The badblocks instance has its own internal lock to handle > mutations of the error list. > > So, to make it clear that we are just acting on region devices and > don't need the lock rename __nvdimm_bus_badblocks_clear() to > nvdimm_clear_badblocks_regions(). Eliminate the lock and consolidate > all routines in drivers/nvdimm/bus.c. Also, make some cleanups to > remove unnecessary casts, make the calling convention of > nvdimm_clear_badblocks_regions() clearer by replacing struct resource > with the minimal struct clear_badblocks_context, and use the > DEVICE_ATTR macro. > > Cc: Dave Jiang > Cc: Vishal Verma > Reported-by: Toshi Kani > Signed-off-by: Dan Williams Confirmed that the clear path to the region-level badblocks works with the btt workaround and ndctl fix. Tested-by: Toshi Kani Thanks! -Toshi