From patchwork Thu Apr 16 21:13:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gabriel Krisman Bertazi X-Patchwork-Id: 11494169 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 9971D186E for ; Fri, 17 Apr 2020 06:44:02 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-delivery-1.mimecast.com [205.139.110.120]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 1560C221E9 for ; Fri, 17 Apr 2020 06:44:01 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=redhat.com header.i=@redhat.com header.b="gLY/Pib7" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 1560C221E9 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=collabora.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dm-devel-bounces@redhat.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1587105841; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=ah/CoYXYByLvgsjM2XfZhk3idCeJF0DBNi8yJfxtaPM=; b=gLY/Pib7X+qdwnnesc/CG6elvxCffdM6PnYj6oE37l7Mp8oNElbBASSeYdNsI52s4cYcaS 9n3jNCaGfPaQWNPsjlpJUkn6H14JEi8gVqgWmFXDxUieKWYkKg5V17WYkO3nwQ7QOzQGVM vrl+9sHGgMv6IScJvyCcPqP5X3HGtRA= Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-512-gWG6j9WQO4CPZk5YpQdE5Q-1; Fri, 17 Apr 2020 02:43:58 -0400 X-MC-Unique: gWG6j9WQO4CPZk5YpQdE5Q-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 6B3E1100F2E5; Fri, 17 Apr 2020 06:43:54 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4917911A086; Fri, 17 Apr 2020 06:43:54 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id A979A18089C8; Fri, 17 Apr 2020 06:43:51 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.rdu2.redhat.com [10.11.54.3]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 03GLDoNo002317 for ; Thu, 16 Apr 2020 17:13:50 -0400 Received: by smtp.corp.redhat.com (Postfix) id 881161006B08; Thu, 16 Apr 2020 21:13:50 +0000 (UTC) Delivered-To: dm-devel@redhat.com Received: from mimecast-mx02.redhat.com (mimecast02.extmail.prod.ext.rdu2.redhat.com [10.11.55.18]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 844311006B06 for ; Thu, 16 Apr 2020 21:13:47 +0000 (UTC) Received: from us-smtp-1.mimecast.com (us-smtp-1.mimecast.com [205.139.110.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-SHA384 (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id DEEC4800A18 for ; Thu, 16 Apr 2020 21:13:47 +0000 (UTC) Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk [46.235.227.227]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-66-EN2HrBxsP36jBpHCOSq14g-1; Thu, 16 Apr 2020 17:13:45 -0400 X-MC-Unique: EN2HrBxsP36jBpHCOSq14g-1 Received: from [127.0.0.1] (localhost [127.0.0.1]) (Authenticated sender: krisman) with ESMTPSA id E8F742A23DF From: Gabriel Krisman Bertazi To: agk@redhat.com, snitzer@redhat.com Date: Thu, 16 Apr 2020 17:13:34 -0400 Message-Id: <20200416211336.2423618-1-krisman@collabora.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.78 on 10.11.54.3 X-MIME-Autoconverted: from quoted-printable to 8bit by lists01.pubmisc.prod.ext.phx2.redhat.com id 03GLDoNo002317 X-loop: dm-devel@redhat.com X-Mailman-Approved-At: Fri, 17 Apr 2020 02:43:50 -0400 Cc: linux-kernel@vger.kernel.org, khazhy@google.com, song@kernel.org, dm-devel@redhat.com, kernel@collabora.com, Gabriel Krisman Bertazi Subject: [dm-devel] [PATCH 0/2] Historical Service Time Path Selector X-BeenThere: dm-devel@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: device-mapper development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: dm-devel-bounces@redhat.com Errors-To: dm-devel-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Hello, This small series implements a new path selector that leverages historical path IO time in order to estimate future path performance. Implementation details can be found on Patch 2. This selector yields better path distribution, considering the mean deviation from the calculated optimal utilization, for small IO depths when compared to the Service Time selector with fio benchmarks. For instance, on a multipath setup with 4 paths, where one path is 4 times slower than the rest, issuing 500MB of randwrites, we have the following path utilization rates: | depth=1 | depth=64 | | | ST | HST | ST | HST | Best | |-----+-------+-------+-------+-------+-------| | sda | 0.250 | 0.294 | 0.297 | 0.294 | 0.307 | | sdb | 0.250 | 0.297 | 0.296 | 0.297 | 0.307 | | sdc | 0.250 | 0.296 | 0.298 | 0.296 | 0.307 | | sdd | 0.250 | 0.112 | 0.106 | 0.112 | 0.076 | For small depths, HST is much quicker in detecting slow paths and has a better selection than ST. As the iodepth increases, ST gets close to HST, which still behaves steadily. The raw performance data for different depths types of IO can be found at: This was tested primarily on a Google cloud SAN with real data and usage patterns and with artificial benchmarks using fio. Khazhismel Kumykov (2): md: Expose struct request to path selector md: Add Historical Service Time Path Selector drivers/md/Kconfig | 11 + drivers/md/Makefile | 1 + drivers/md/dm-historical-service-time.c | 561 ++++++++++++++++++++++++ drivers/md/dm-mpath.c | 12 +- drivers/md/dm-path-selector.h | 6 + 5 files changed, 589 insertions(+), 2 deletions(-) create mode 100644 drivers/md/dm-historical-service-time.c