From patchwork Tue Jan 12 06:49:31 2016 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: 8014161 X-Patchwork-Delegate: axboe@kernel.dk 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 A15139F6FA for ; Tue, 12 Jan 2016 06:56:37 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C56FC20379 for ; Tue, 12 Jan 2016 06:56:36 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id F0526201F4 for ; Tue, 12 Jan 2016 06:56:35 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758017AbcALGvU (ORCPT ); Tue, 12 Jan 2016 01:51:20 -0500 Received: from mail-wm0-f52.google.com ([74.125.82.52]:36456 "EHLO mail-wm0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1761197AbcALGuQ (ORCPT ); Tue, 12 Jan 2016 01:50:16 -0500 Received: by mail-wm0-f52.google.com with SMTP id l65so238873690wmf.1 for ; Mon, 11 Jan 2016 22:50:15 -0800 (PST) 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=NOg3RmwswMX7fxuIusbU3Di6r8tbcU/ODFGssd28Dq4=; b=mPtcELXONM7++9pe/sZPccGySRw9G+JVq/foTt20RVjfFPbpqnw6ggiS0sXvihZcXV psq9tWECMUxRlGFo05EPZ82hTBTpp8stImbPTw/hEUQ9gy1RR3zr62+DmbQy0yY5bBX+ smmGv68qzG6neaemLz0N8dL93iuqklCHSL7OI= 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=NOg3RmwswMX7fxuIusbU3Di6r8tbcU/ODFGssd28Dq4=; b=SEUsG+Vbvyke0BqSmWmu8kSfbjNRP3zvUzSG1kWbG0ToaI28loSMl6lcn7+kJ9Gken Qhdh7Z8JM09gRsvSejEuMhcu4uLbuhyy2VQSCcoktwGclQFnr22lsE8HAg0ffqQeck+2 cHW14xx+jMsU8zr9wnbKbZPx+sVsjbP25MpP+zNi47gFRPD5LoeKQoMy2Uud5AoDWNiv mkPwleSHGNGwsJkeCWQihbqiDSB2IjO8oE1N4fMM32iXJmJJVsWVudf6dsKAXiRzG01u CXt85xaWSGEBdpxeFY/UmvVh/vyPzGiVoLO5xTb4k6tPOfqYB/ElpRJhGecDdtGLUxbG vgMA== X-Gm-Message-State: ALoCoQkeuyA7EBRHUjr4MwTqchCZ9m4Re3QKr13OT0IPVhTVXuieWh0WlZzEY5FGRfmsfxqPMLHdLqrXPfnVVjujzYCHPIkRZA== X-Received: by 10.28.12.9 with SMTP id 9mr18305422wmm.76.1452581415215; Mon, 11 Jan 2016 22:50:15 -0800 (PST) Received: from localhost.localdomain (6164198-cl69.boa.fiberby.dk. [193.106.164.198]) by smtp.gmail.com with ESMTPSA id yz5sm70776886wjc.36.2016.01.11.22.50.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 11 Jan 2016 22:50:14 -0800 (PST) From: =?UTF-8?q?Matias=20Bj=C3=B8rling?= To: linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, axboe@fb.com Cc: =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Javier=20Gonz=C3=A1lez?= , =?UTF-8?q?Matias=20Bj=C3=B8rling?= Subject: [PATCH 17/25] lightnvm: reference rrpc lun in rrpc block Date: Tue, 12 Jan 2016 07:49:31 +0100 Message-Id: <1452581379-18162-18-git-send-email-m@bjorling.me> X-Mailer: git-send-email 2.1.4 In-Reply-To: <1452581379-18162-1-git-send-email-m@bjorling.me> References: <1452581379-18162-1-git-send-email-m@bjorling.me> MIME-Version: 1.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,RP_MATCHES_RCVD,T_DKIM_INVALID,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 From: Javier González Currently, a rrpc block only points to its nvm_lun. If a user wants to find the associated rrpc lun, it will have to calculate the index and look it up manually. By referencing the rrpc lun directly, this step can be omitted, at the cost of a larger memory footprint. This is important for upcoming patches that implement write buffering in rrpc. Signed-off-by: Javier González Signed-off-by: Matias Bjørling --- drivers/lightnvm/rrpc.c | 1 + drivers/lightnvm/rrpc.h | 1 + 2 files changed, 2 insertions(+) diff --git a/drivers/lightnvm/rrpc.c b/drivers/lightnvm/rrpc.c index 9a5d940..280350c 100644 --- a/drivers/lightnvm/rrpc.c +++ b/drivers/lightnvm/rrpc.c @@ -1150,6 +1150,7 @@ static int rrpc_luns_init(struct rrpc *rrpc, int lun_begin, int lun_end) struct nvm_block *blk = &lun->blocks[j]; rblk->parent = blk; + rblk->rlun = rlun; INIT_LIST_HEAD(&rblk->prio); spin_lock_init(&rblk->lock); } diff --git a/drivers/lightnvm/rrpc.h b/drivers/lightnvm/rrpc.h index a9696a0..7c5fa4d 100644 --- a/drivers/lightnvm/rrpc.h +++ b/drivers/lightnvm/rrpc.h @@ -54,6 +54,7 @@ struct rrpc_rq { struct rrpc_block { struct nvm_block *parent; + struct rrpc_lun *rlun; struct list_head prio; #define MAX_INVALID_PAGES_STORAGE 8