From patchwork Wed Mar 23 15:25:49 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jens Axboe X-Patchwork-Id: 8650991 Return-Path: X-Original-To: patchwork-linux-block@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id F22579FB32 for ; Wed, 23 Mar 2016 15:27:00 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 869D4203AB for ; Wed, 23 Mar 2016 15:26:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A0471203A9 for ; Wed, 23 Mar 2016 15:26:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755864AbcCWP0V (ORCPT ); Wed, 23 Mar 2016 11:26:21 -0400 Received: from mx0b-00082601.pphosted.com ([67.231.153.30]:63512 "EHLO mx0b-00082601.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755768AbcCWP0S (ORCPT ); Wed, 23 Mar 2016 11:26:18 -0400 Received: from pps.filterd (m0001303.ppops.net [127.0.0.1]) by m0001303.ppops.net (8.16.0.11/8.16.0.11) with SMTP id u2NFJluM009845; Wed, 23 Mar 2016 08:26:17 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=fb.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=facebook; bh=dF5FMExFNeu9xfS77NRZoMst7aWs+58X0AO//GYBVGg=; b=h32Gy4yS3K/3bSEeZKf55sY44zvW53zJIkznMljZ6oV5nrpn4ZxUxgBnpa+l5LBGvdsS Go7r2FxQ4MITPv0zkIWbpPaGaxNePODqg215m9djL9qn6RnUCY6HWrKJyruU5vIMufr1 8icGWBi5yBx9bjSpjmWeue8Urrib9OODw+g= Received: from mail.thefacebook.com ([199.201.64.23]) by m0001303.ppops.net with ESMTP id 21uet8p3wv-19 (version=TLSv1 cipher=AES128-SHA bits=128 verify=NOT); Wed, 23 Mar 2016 08:26:17 -0700 Received: from localhost.localdomain (192.168.54.13) by mail.TheFacebook.com (192.168.16.18) with Microsoft SMTP Server (TLS) id 14.3.248.2; Wed, 23 Mar 2016 08:25:56 -0700 From: Jens Axboe To: , , CC: Jens Axboe Subject: [PATCH 7/8] NVMe: inform block layer of write cache state Date: Wed, 23 Mar 2016 09:25:49 -0600 Message-ID: <1458746750-9213-8-git-send-email-axboe@fb.com> X-Mailer: git-send-email 2.4.1.168.g1ea28e1 In-Reply-To: <1458746750-9213-1-git-send-email-axboe@fb.com> References: <1458746750-9213-1-git-send-email-axboe@fb.com> MIME-Version: 1.0 X-Originating-IP: [192.168.54.13] X-Proofpoint-Spam-Reason: safe X-FB-Internal: Safe X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-03-23_08:, , signatures=0 Sender: linux-block-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-block@vger.kernel.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID,T_RP_MATCHES_RCVD,UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP This isn't quite correct, since the VWC merely states if a potential write back cache is volatile or not. But for the purpose of write absortion, it's good enough. Signed-off-by: Jens Axboe --- drivers/nvme/host/core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c index 643f457131c2..05c8edfb7611 100644 --- a/drivers/nvme/host/core.c +++ b/drivers/nvme/host/core.c @@ -906,6 +906,7 @@ static void nvme_set_queue_limits(struct nvme_ctrl *ctrl, if (ctrl->vwc & NVME_CTRL_VWC_PRESENT) blk_queue_flush(q, REQ_FLUSH | REQ_FUA); blk_queue_virt_boundary(q, ctrl->page_size - 1); + blk_queue_write_cache(q, ctrl->vwc & NVME_CTRL_VWC_PRESENT); } /*