From patchwork Wed Apr 22 14:26:51 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Matias_Bj=C3=B8rling?= X-Patchwork-Id: 6256451 Return-Path: X-Original-To: patchwork-linux-fsdevel@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 377079F1C4 for ; Wed, 22 Apr 2015 14:27:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 6F092202F8 for ; Wed, 22 Apr 2015 14:27:26 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7D30C20303 for ; Wed, 22 Apr 2015 14:27:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932238AbbDVO1T (ORCPT ); Wed, 22 Apr 2015 10:27:19 -0400 Received: from mail-la0-f46.google.com ([209.85.215.46]:34205 "EHLO mail-la0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1757325AbbDVO1P (ORCPT ); Wed, 22 Apr 2015 10:27:15 -0400 Received: by laat2 with SMTP id t2so176251739laa.1 for ; Wed, 22 Apr 2015 07:27:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bjorling.me; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=f4MrFp8WXNAbVVrAqIo8i57pm8FX851KQ6PxCgkpZhY=; b=djrgGa5MLHny07yC611ExecpZHR1YI92HTzVE4pnZ2k33Zj68OvGnVLYnf0bf14uCj HtN8Z9/DOi3z/JBUvImc3ZM9zklpIpYhpES/sijRLuKnMBBlnQB2wqhRh1MWJGLPlV82 kDfcXeY3PHzJJrrCk6f9F2fdPnfch9TTjpzQI= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=f4MrFp8WXNAbVVrAqIo8i57pm8FX851KQ6PxCgkpZhY=; b=eQfzmOLNSiJO9Am1HNXTNb6kl7eokdTrPUIGUIQ9XRhuGNO9BK+67U/CHRbfcjmpzx NhtENmKq+Zt4hQ6ls0GhM4X6ifl/xjjhOGPWFINSGfxYI1coLTyruLm7c9e2eK3CtFfA 4qhaALwJ6p6xXnWbnmfscRgaMyKhY7PuESUvPBHBhVkyIOECxeS3T+3goviJDZKe/BfM m53oDH3hXfCLlq7pQS4psCXW9n82Cdu6v4ize9b4SG/VlJS1mcxbJiOwIRZUdAaSraJd zZkJkI3JqOeMSzYYFyyIMv7Wt2C5OTO7Ai1jcWvEXV0Ob54GI3YpFyzAhBbeWw6GZO/w Lcvw== X-Gm-Message-State: ALoCoQmml8cvbqrOMEREWFjuIaFRHGnjmwPWS8qsDLm1o+ImUiKfOZKZ4uimaHRTFYZ8/0myXeyI X-Received: by 10.152.42.141 with SMTP id o13mr25149543lal.33.1429712833803; Wed, 22 Apr 2015 07:27:13 -0700 (PDT) Received: from MacroNinja.itu.dk ([130.226.133.111]) by mx.google.com with ESMTPSA id xx2sm1105262lbb.13.2015.04.22.07.27.12 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 22 Apr 2015 07:27:13 -0700 (PDT) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: hch@infradead.org, axboe@fb.com, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-nvme@lists.infradead.org Cc: javier@paletta.io, keith.busch@intel.com, =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH v3 2/7] block: add REQ_NVM_GC for targets gc Date: Wed, 22 Apr 2015 16:26:51 +0200 Message-Id: <1429712816-10336-3-git-send-email-m@bjorling.me> X-Mailer: git-send-email 1.9.1 In-Reply-To: <1429712816-10336-1-git-send-email-m@bjorling.me> References: <1429712816-10336-1-git-send-email-m@bjorling.me> MIME-Version: 1.0 Sender: linux-fsdevel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fsdevel@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=unavailable 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 In preparation for Open-Channel SSDs. We introduce a special request for open-channel ssd targets that must perform garbage collection. Requests are divided into two types. The user and target specific. User IOs are from fs, user-space, etc. While target specific are IOs that are issued in the background by targets. Usually garbage collection actions. For the target to issue garbage collection requests, it is a requirement that a logical address is locked over two requests. One read and one write. If a write to the logical address comes in from user-space, a race-condition might occur and garbage collection will write out-dated data. By introducing this flag, the target can manually control locking of logical addresses. Signed-off-by: Matias Bjørling --- include/linux/blk_types.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/include/linux/blk_types.h b/include/linux/blk_types.h index 272c17e..25c6e02 100644 --- a/include/linux/blk_types.h +++ b/include/linux/blk_types.h @@ -195,6 +195,7 @@ enum rq_flag_bits { __REQ_HASHED, /* on IO scheduler merge hash */ __REQ_MQ_INFLIGHT, /* track inflight for MQ */ __REQ_NO_TIMEOUT, /* requests may never expire */ + __REQ_NVM_GC, /* request is a nvm gc request */ __REQ_NR_BITS, /* stops here */ }; @@ -215,7 +216,7 @@ enum rq_flag_bits { #define REQ_COMMON_MASK \ (REQ_WRITE | REQ_FAILFAST_MASK | REQ_SYNC | REQ_META | REQ_PRIO | \ REQ_DISCARD | REQ_WRITE_SAME | REQ_NOIDLE | REQ_FLUSH | REQ_FUA | \ - REQ_SECURE | REQ_INTEGRITY) + REQ_SECURE | REQ_INTEGRITY | REQ_NVM_GC) #define REQ_CLONE_MASK REQ_COMMON_MASK #define BIO_NO_ADVANCE_ITER_MASK (REQ_DISCARD|REQ_WRITE_SAME) @@ -249,5 +250,5 @@ enum rq_flag_bits { #define REQ_HASHED (1ULL << __REQ_HASHED) #define REQ_MQ_INFLIGHT (1ULL << __REQ_MQ_INFLIGHT) #define REQ_NO_TIMEOUT (1ULL << __REQ_NO_TIMEOUT) - +#define REQ_NVM_GC (1ULL << __REQ_NVM_GC) #endif /* __LINUX_BLK_TYPES_H */