From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753932AbcIIJ74 (ORCPT ); Fri, 9 Sep 2016 05:59:56 -0400 Received: from outbound-smtp10.blacknight.com ([46.22.139.15]:44735 "EHLO outbound-smtp10.blacknight.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751120AbcIIJ7j (ORCPT ); Fri, 9 Sep 2016 05:59:39 -0400 From: Mel Gorman To: LKML , Linux-MM , Mel Gorman Cc: Dave Chinner , Linus Torvalds , Ying Huang , Michal Hocko Subject: [PATCH 2/4] block, brd: Treat storage as non-rotational Date: Fri, 9 Sep 2016 10:59:33 +0100 Message-Id: <1473415175-20807-3-git-send-email-mgorman@techsingularity.net> X-Mailer: git-send-email 2.6.4 In-Reply-To: <1473415175-20807-1-git-send-email-mgorman@techsingularity.net> References: <1473415175-20807-1-git-send-email-mgorman@techsingularity.net> Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Unlike the rims of a punked out car, RAM does not spin. Ramdisk as implemented by the brd is treated as rotational storage. When used as swap to simulate fast storage, swap uses the algoritms for minimising seek times instead of the algorithms optimised for SSD. When the tree_lock contention was reduced by the previous patch, it was found that the workload was dominated by scan_swap_map(). This patch has no practical application as swap-on-ramdisk is dumb is rocks but it's trivial to fix. 4.8.0-rc5 4.8.0-rc5 batch-v1 ramdisknonrot-v1 Amean System-1 192.98 ( 0.00%) 181.00 ( 6.21%) Amean System-3 198.33 ( 0.00%) 86.19 ( 56.54%) Amean System-5 105.22 ( 0.00%) 67.43 ( 35.91%) Amean System-7 97.79 ( 0.00%) 89.55 ( 8.42%) Amean System-8 149.39 ( 0.00%) 102.92 ( 31.11%) Amean Elapsd-1 219.95 ( 0.00%) 209.23 ( 4.88%) Amean Elapsd-3 79.02 ( 0.00%) 36.93 ( 53.26%) Amean Elapsd-5 29.88 ( 0.00%) 19.52 ( 34.69%) Amean Elapsd-7 24.06 ( 0.00%) 21.93 ( 8.84%) Amean Elapsd-8 33.34 ( 0.00%) 23.63 ( 29.12%) Signed-off-by: Mel Gorman --- drivers/block/brd.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/block/brd.c b/drivers/block/brd.c index 0c76d4016eeb..83a76a74e027 100644 --- a/drivers/block/brd.c +++ b/drivers/block/brd.c @@ -504,6 +504,7 @@ static struct brd_device *brd_alloc(int i) blk_queue_max_discard_sectors(brd->brd_queue, UINT_MAX); brd->brd_queue->limits.discard_zeroes_data = 1; queue_flag_set_unlocked(QUEUE_FLAG_DISCARD, brd->brd_queue); + queue_flag_set_unlocked(QUEUE_FLAG_NONROT, brd->brd_queue); #ifdef CONFIG_BLK_DEV_RAM_DAX queue_flag_set_unlocked(QUEUE_FLAG_DAX, brd->brd_queue); #endif -- 2.6.4