From owner-svn-src-head@freebsd.org Tue Dec 8 20:48:41 2015 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 2DF089D55A0 for ; Tue, 8 Dec 2015 20:48:41 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: from mail-wm0-x22e.google.com (mail-wm0-x22e.google.com [IPv6:2a00:1450:400c:c09::22e]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id CB8691B8F for ; Tue, 8 Dec 2015 20:48:40 +0000 (UTC) (envelope-from steven@multiplay.co.uk) Received: by wmvv187 with SMTP id v187so231366053wmv.1 for ; Tue, 08 Dec 2015 12:48:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=multiplay-co-uk.20150623.gappssmtp.com; s=20150623; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-type:content-transfer-encoding; bh=y7u6I+BBEwTN59F+MkNbFT5NfUD2DG/Q+5utHkZ8kRY=; b=MToUYoZKb8g3JQFzIeJJOLSigy0uvIwjkrpUFNkcvHE4s8dMtBtVy1oaKJPZxIltKo d1KbcRq/zn0FUcAsdcglEUndJrN44ePy+YR3l8+TKqogPxLA9Ui7OZS8bMlaFG0/W/J9 +tuJ0XZmrwQzwhnJxKMSBsvgz5E5kj1Sy/ABZlZiOfgYy0uHIJuxL43O/erSh4wEoSV8 UqUs4rRxgIQoxX5RpGquBlGnCpxpsk6S0WIl4Sa/TF5SZsKc7EY3Cqp6uRoa6PaXHTAZ FKf+bjLfwPlNlOsNbUyTiByt+aNQJF0GjXlQAaTbHp9+TLOBOWuBTRKzr8CreDFZs+wW IIWw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-type :content-transfer-encoding; bh=y7u6I+BBEwTN59F+MkNbFT5NfUD2DG/Q+5utHkZ8kRY=; b=EcBwEmCfg3OzwtgH2faeD2LNPR0DmKKgtCcO0qdCvBRFQuGX7Fo4mzc3xOlf4Zrykr Bx6DDb5vsxGMRJDHhY5mAWy12Ys/hJ39gdj/CZpkqlcbGLOMsoMizPaL8gEHsZmbTcrG kZPWJSkCl1QGTnSfwpela7v3SOPlz1C+gcUZcr7XWaEi+/nGxqo3onkAyUP1Zfg/yC4H XCZUpWxcDqUlfAwgIpX/IUB78uP6KhKbq6gH5eltB+uUSz1zrEsTBAGK0o7PQuhJHFRo z2LJo2hkWUD6XxsoiindJ+mOMEjtRApekz2cg+HaxvvAJzFa+JI2kbuQ/TfTK30LWDvs of/A== X-Gm-Message-State: ALoCoQnzoIU1jC5ir/25/VOzygmgNRn5yNNidYQJHEImTgX94g+aIP3GgAS6GVULh0GWKidzmApd7p+Bqq8ggB82Xb0g/PdNjg== X-Received: by 10.28.88.5 with SMTP id m5mr31416471wmb.54.1449607719241; Tue, 08 Dec 2015 12:48:39 -0800 (PST) Received: from [10.10.1.58] (liv3d.labs.multiplay.co.uk. [82.69.141.171]) by smtp.gmail.com with ESMTPSA id hp9sm4510867wjb.43.2015.12.08.12.48.38 (version=TLSv1/SSLv3 cipher=OTHER); Tue, 08 Dec 2015 12:48:38 -0800 (PST) From: Steven Hartland X-Google-Original-From: Steven Hartland Subject: Re: svn commit: r290199 - in head/sys/dev: nvd nvme To: Jim Harris , svn-src-head@freebsd.org References: <201510301635.t9UGZI0F085365@repo.freebsd.org> Message-ID: <5667422C.1050806@freebsd.org> Date: Tue, 8 Dec 2015 20:48:44 +0000 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.4.0 MIME-Version: 1.0 In-Reply-To: <201510301635.t9UGZI0F085365@repo.freebsd.org> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Dec 2015 20:48:41 -0000 Hi Jim could you let me know the use case for exposing the controller stripe size as the disk stripe size done by this commit? I ask as it actually causes problems for ZFS which has checks to ensure zpools perform optimally by correctly configuring ashift to match the stripesize if reported. This is usually fine as stripe size typically reports the physical block size of device, where sectorsize is the logical block size, unfortunately this is currently limited to ashift of 13 (8KB) so when nvme reports 128KB it limits it 8KB and hence every subsequent zpool status reports a warning about optimal performance. Before I look to fix one or the other, I wanted to fully understand the reasoning behind how nvme behaves here. On 30/10/2015 16:35, Jim Harris wrote: > Author: jimharris > Date: Fri Oct 30 16:35:18 2015 > New Revision: 290199 > URL: https://svnweb.freebsd.org/changeset/base/290199 > > Log: > nvd, nvme: report stripesize through GEOM disk layer > > MFC after: 3 days > Sponsored by: Intel > > Modified: > head/sys/dev/nvd/nvd.c > head/sys/dev/nvme/nvme.h > head/sys/dev/nvme/nvme_ns.c > > Modified: head/sys/dev/nvd/nvd.c > ============================================================================== > --- head/sys/dev/nvd/nvd.c Fri Oct 30 16:06:34 2015 (r290198) > +++ head/sys/dev/nvd/nvd.c Fri Oct 30 16:35:18 2015 (r290199) > @@ -279,6 +279,7 @@ nvd_new_disk(struct nvme_namespace *ns, > disk->d_sectorsize = nvme_ns_get_sector_size(ns); > disk->d_mediasize = (off_t)nvme_ns_get_size(ns); > disk->d_delmaxsize = (off_t)nvme_ns_get_size(ns); > + disk->d_stripesize = nvme_ns_get_stripesize(ns); > > if (TAILQ_EMPTY(&disk_head)) > disk->d_unit = 0; > > Modified: head/sys/dev/nvme/nvme.h > ============================================================================== > --- head/sys/dev/nvme/nvme.h Fri Oct 30 16:06:34 2015 (r290198) > +++ head/sys/dev/nvme/nvme.h Fri Oct 30 16:35:18 2015 (r290199) > @@ -870,6 +870,7 @@ const char * nvme_ns_get_serial_number(s > const char * nvme_ns_get_model_number(struct nvme_namespace *ns); > const struct nvme_namespace_data * > nvme_ns_get_data(struct nvme_namespace *ns); > +uint32_t nvme_ns_get_stripesize(struct nvme_namespace *ns); > > int nvme_ns_bio_process(struct nvme_namespace *ns, struct bio *bp, > nvme_cb_fn_t cb_fn); > > Modified: head/sys/dev/nvme/nvme_ns.c > ============================================================================== > --- head/sys/dev/nvme/nvme_ns.c Fri Oct 30 16:06:34 2015 (r290198) > +++ head/sys/dev/nvme/nvme_ns.c Fri Oct 30 16:35:18 2015 (r290199) > @@ -210,6 +210,13 @@ nvme_ns_get_data(struct nvme_namespace * > return (&ns->data); > } > > +uint32_t > +nvme_ns_get_stripesize(struct nvme_namespace *ns) > +{ > + > + return (ns->stripesize); > +} > + > static void > nvme_ns_bio_done(void *arg, const struct nvme_completion *status) > { >