From patchwork Thu Aug 11 00:42:16 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kyungmin Park X-Patchwork-Id: 1055432 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter2.kernel.org (8.14.4/8.14.4) with ESMTP id p7B0gOSA016145 for ; Thu, 11 Aug 2011 00:42:24 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752290Ab1HKAmX (ORCPT ); Wed, 10 Aug 2011 20:42:23 -0400 Received: from mailout2.samsung.com ([203.254.224.25]:14073 "EHLO mailout2.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755488Ab1HKAmW (ORCPT ); Wed, 10 Aug 2011 20:42:22 -0400 Received: from epcpsbgm1.samsung.com (mailout2.samsung.com [203.254.224.25]) by mailout2.samsung.com (Oracle Communications Messaging Exchange Server 7u4-19.01 64bit (built Sep 7 2010)) with ESMTP id <0LPQ00IFNNACHKI0@mailout2.samsung.com>; Thu, 11 Aug 2011 09:42:21 +0900 (KST) X-AuditID: cbfee61a-b7cf0ae000006bc6-b8-4e43256b9aa7 Received: from epmmp2 ( [203.254.227.17]) by epcpsbgm1.samsung.com (MMPCPMTA) with SMTP id 68.13.27590.B65234E4; Thu, 11 Aug 2011 09:42:20 +0900 (KST) Received: from TNRNDGASPAPP1.tn.corp.samsungelectronics.net ([165.213.149.150]) by mmp2.samsung.com (iPlanet Messaging Server 5.2 Patch 2 (built Jul 14 2004)) with ESMTPA id <0LPQ00H1JNAK94@mmp2.samsung.com>; Thu, 11 Aug 2011 09:42:20 +0900 (KST) Received: from july ([165.213.219.111]) by TNRNDGASPAPP1.tn.corp.samsungelectronics.net with Microsoft SMTPSVC(6.0.3790.4675); Thu, 11 Aug 2011 09:42:54 +0900 Received: by july (sSMTP sendmail emulation); Thu, 11 Aug 2011 09:42:16 +0900 Date: Thu, 11 Aug 2011 09:42:16 +0900 From: Kyungmin Park Subject: [RFC PATCH v2] Add new elevator ops for request hint To: jaxboe@fusionio.com Cc: linux-kernel@vger.kernel.org, arnd@arndb.de, jh80.chung@samsung.com, shli@kernel.org, linux-mmc@vger.kernel.org Message-id: <20110811004216.GA24810@july> MIME-version: 1.0 Content-type: text/plain; charset=us-ascii Content-transfer-encoding: 7BIT Content-disposition: inline User-Agent: Mutt/1.5.17 (2007-11-01) X-OriginalArrivalTime: 11 Aug 2011 00:42:54.0045 (UTC) FILETIME=[9B2958D0:01CC57BF] X-Brightmail-Tracker: AAAAAA== Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.6 (demeter2.kernel.org [140.211.167.43]); Thu, 11 Aug 2011 00:42:24 +0000 (UTC) Hi Jens Now eMMC device requires the upper layer information to improve the data performance and reliability. . Context ID Using the context information, it can sort out the data internally and improve the performance. The main problem is that it's needed to define "What's the context". Actually I expect cfq queue has own unique ID but it doesn't so decide to use the pid instead . Data Tag Using the Data Tag (1-bit information), It writes the data at SLC area when it's hot data. So it can make the chip more reliable. First I expect the REQ_META but current ext4 doesn't pass the WRITE_META. only use the READ_META. so it needs to investigate it. With these characteristics, it's helpful to teach the device. After some consideration. it's needed to pass out these information at request data structure. Sample usage is following in drivers/mmc/card/block.c struct elevator_queue *e = md->queue.queue->elevator; struct request_hint hint; int ret; if (e->ops->elevator_get_req_hint_fn && req) ret = e->ops->elevator_get_req_hint_fn(req, &hint); Thank you, Kyungmin Park --- Changelog v2 - Don't add the request member. instead add new elevator ops --- -- To unsubscribe from this list: send the line "unsubscribe linux-mmc" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/block/cfq-iosched.c b/block/cfq-iosched.c index 1f96ad6..5089f67 100644 --- a/block/cfq-iosched.c +++ b/block/cfq-iosched.c @@ -3800,6 +3800,18 @@ queue_fail: return 1; } +static int cfq_get_request_hint(struct request *rq, struct request_hint *hint) +{ + struct cfq_queue *cfqq = RQ_CFQQ(rq); + + if (cfqq) { + hint->context = cfqq->pid; + hint->hot = !!(rq->cmd_flags & REQ_META); + } + + return 0; +} + static void cfq_kick_queue(struct work_struct *work) { struct cfq_data *cfqd = @@ -4211,6 +4223,7 @@ static struct elevator_type iosched_cfq = { .elevator_latter_req_fn = elv_rb_latter_request, .elevator_set_req_fn = cfq_set_request, .elevator_put_req_fn = cfq_put_request, + .elevator_get_req_hint_fn = cfq_get_request_hint, .elevator_may_queue_fn = cfq_may_queue, .elevator_init_fn = cfq_init_queue, .elevator_exit_fn = cfq_exit_queue, diff --git a/include/linux/blkdev.h b/include/linux/blkdev.h index 0e67c45..8d9592b 100644 --- a/include/linux/blkdev.h +++ b/include/linux/blkdev.h @@ -71,6 +71,11 @@ enum rq_cmd_type_bits { #define BLK_MAX_CDB 16 +struct request_hint { + int context; /* Context ID */ + unsigned int hot:1; /* Hot/cold */ +}; + /* * try to put the fields that are referenced together in the same cacheline. * if you modify this structure, be sure to check block/blk-core.c:blk_rq_init() diff --git a/include/linux/elevator.h b/include/linux/elevator.h index d800d51..114d427 100644 --- a/include/linux/elevator.h +++ b/include/linux/elevator.h @@ -26,6 +26,7 @@ typedef int (elevator_may_queue_fn) (struct request_queue *, int); typedef int (elevator_set_req_fn) (struct request_queue *, struct request *, gfp_t); typedef void (elevator_put_req_fn) (struct request *); +typedef int (elevator_get_req_hint_fn) (struct request *, struct request_hint *); typedef void (elevator_activate_req_fn) (struct request_queue *, struct request *); typedef void (elevator_deactivate_req_fn) (struct request_queue *, struct request *); @@ -52,6 +53,7 @@ struct elevator_ops elevator_set_req_fn *elevator_set_req_fn; elevator_put_req_fn *elevator_put_req_fn; + elevator_get_req_hint_fn *elevator_get_req_hint_fn; elevator_may_queue_fn *elevator_may_queue_fn;