Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp1136450pxb; Wed, 10 Feb 2021 00:32:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJx9qxFzScrjHZuoiiBP/LPZ9Tj41oy6vkqMn5g82uhc8bEcE9GOYYocu0llcJCzTC/g/btX X-Received: by 2002:a05:6402:31a3:: with SMTP id dj3mr2088098edb.172.1612945948396; Wed, 10 Feb 2021 00:32:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1612945948; cv=none; d=google.com; s=arc-20160816; b=UTWbFQi8MhfiPMGrhcQ7Jbg7Z5hK1p8Un9nFL9US4oiCrQm4v1/N/paKXI+ytv2Wwz SbycKsWTc1pZ83sM1e0kF/QiK7ue6bYbQoYTe+Obvxeda86l7nvBgMzsk1t+SciNZMoy 4FF0LleLer1YgS6mcykGE33wHvmmYxZBCIYNE1h270KUkd5D234VefFvzxmnVp2Jsg6L WYmprw8Pj+MK+K6Yl3OAa+hzsldJMjkY/FJ/GUzyBzFaAahKfFDHUPbUZcgwpYI7OWvV qbe1peu/pa9MoEpgWG3e5LvQF3LB3oOyFRvFunmx9fGMUGvyG0CHOrhwUWEIIjnTAOIW ePsQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=JqmadxYZLc0FLW64LW2DFiVInbGdVi8GRy4JiLq5c/U=; b=Rm9F7l6+CACS/+MLbVBuwuBaA7rTFKwAboLTHtIPvm4jA8dhk3ifHxTMmbjDQpeuf7 pytL4JFHPh0cH4pcFHsgHYo2qBfZitUcO9ssKhwcz2/0SRixAhVAKvpyQBGHbJe1RE8a 8U8EX4pVVGDuLj/Qen8OPEKfo5Oq5KYdutfkGsEIKjusGqivLCr61eb3GlKFYGkRTduC 50oS6QiB62Fq+XLaZsXXV/GocuqZzrc7y0f5xwTnI5cyXXZNUSxmk45dMekp8Yw2MViq NaELluuPlaHoVATNNiAg6VQVQYtqJd56OavXsF0rUwzKyH0FTC72CB4pbX03H2b9y8Mm sG2g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=bMcD2oq4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m6si1129018ejl.63.2021.02.10.00.32.05; Wed, 10 Feb 2021 00:32:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@rere.qmqm.pl header.s=1 header.b=bMcD2oq4; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229809AbhBJEZk (ORCPT + 99 others); Tue, 9 Feb 2021 23:25:40 -0500 Received: from rere.qmqm.pl ([91.227.64.183]:16556 "EHLO rere.qmqm.pl" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229684AbhBJEZj (ORCPT ); Tue, 9 Feb 2021 23:25:39 -0500 Received: from remote.user (localhost [127.0.0.1]) by rere.qmqm.pl (Postfix) with ESMTPSA id 4Db69h3nZ6z2d; Wed, 10 Feb 2021 05:24:56 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=rere.qmqm.pl; s=1; t=1612931096; bh=QHxzW/XJK3U0oNQjGYevmIuaZObRFPo3K4Pd9Nk0lHM=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=bMcD2oq404OShRFj1fd4CTBBo5rmZXa0Z2HJCX6iLLEpoAzr7mPzW6q2yYUOqp8a0 rwtNsp5kkM2LBtyWaNUr8PAkSGFoWjtA5qrhlhj+FLMZbM3Uw7tyb8nQ01obvBBnZu 5XSOiQh9WaizlWsTs+PpQY03kyv/NruzHjQKxmV9oR9nMlbH0x9Z9fB6vsDTJwETuZ B0BAtkGWsp24Y1Ak/mZ1Yt/2DsWbb7oxyPt8cNrfUV4d9JDB1gmfK31/f1J79cF4/c kCBTgjCHgniUGBH4eptG9XW4+dd3pL8vbk7ncoMUIMHAv+IDLbKH4AIP9klFperz2w 1Az1SUNujMmzg== X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.102.4 at mail Date: Wed, 10 Feb 2021 05:24:28 +0100 From: =?iso-8859-2?Q?Micha=B3_Miros=B3aw?= To: Michal Rostecki Cc: Chris Mason , Josef Bacik , David Sterba , "open list:BTRFS FILE SYSTEM" , open list , Michal Rostecki Subject: Re: [PATCH RFC 6/6] btrfs: Add roundrobin raid1 read policy Message-ID: <20210210042428.GC12086@qmqm.qmqm.pl> References: <20210209203041.21493-1-mrostecki@suse.de> <20210209203041.21493-7-mrostecki@suse.de> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-2 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210209203041.21493-7-mrostecki@suse.de> User-Agent: Mutt/1.10.1 (2018-07-13) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Feb 09, 2021 at 09:30:40PM +0100, Michal Rostecki wrote: [...] > For the array with 3 HDDs, not adding any penalty resulted in 409MiB/s > (429MB/s) performance. Adding the penalty value 1 resulted in a > performance drop to 404MiB/s (424MB/s). Increasing the value towards 10 > was making the performance even worse. > > For the array with 2 HDDs and 1 SSD, adding penalty value 1 to > rotational disks resulted in the best performance - 541MiB/s (567MB/s). > Not adding any value and increasing the value was making the performance > worse. > > Adding penalty value to non-rotational disks was always decreasing the > performance, which motivated setting it as 0 by default. For the purpose > of testing, it's still configurable. [...] > + bdev = map->stripes[mirror_index].dev->bdev; > + inflight = mirror_load(fs_info, map, mirror_index, stripe_offset, > + stripe_nr); > + queue_depth = blk_queue_depth(bdev->bd_disk->queue); > + > + return inflight < queue_depth; [...] > + last_mirror = this_cpu_read(*fs_info->last_mirror); [...] > + for (i = last_mirror; i < first + num_stripes; i++) { > + if (mirror_queue_not_filled(fs_info, map, i, stripe_offset, > + stripe_nr)) { > + preferred_mirror = i; > + goto out; > + } > + } > + > + for (i = first; i < last_mirror; i++) { > + if (mirror_queue_not_filled(fs_info, map, i, stripe_offset, > + stripe_nr)) { > + preferred_mirror = i; > + goto out; > + } > + } > + > + preferred_mirror = last_mirror; > + > +out: > + this_cpu_write(*fs_info->last_mirror, preferred_mirror); This looks like it effectively decreases queue depth for non-last device. After all devices are filled to queue_depth-penalty, only a single mirror will be selected for next reads (until a read on some other one completes). Have you tried testing with much more jobs / non-sequential accesses? Best Reagrds, Micha? Miros?aw