Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp7102426rwb; Tue, 6 Dec 2022 00:53:17 -0800 (PST) X-Google-Smtp-Source: AA0mqf7EGbe1Fj2h+qzQRrjryVy3EVjS9bOxe07R7a9z7U6MUE26lecxik8mW4O1c5GMtxjHVPfl X-Received: by 2002:a17:902:a40a:b0:176:d59e:3aa with SMTP id p10-20020a170902a40a00b00176d59e03aamr67509595plq.31.1670316796890; Tue, 06 Dec 2022 00:53:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1670316796; cv=none; d=google.com; s=arc-20160816; b=uYluHEeKuAEfXkG9hENx3ELtn1e0VhSfaDZDYO6zpbMbPUck4lAhBp1kvvpuGEnvWA TzfWUQ0eA6JE3EBLCZ6hDQFTWmLwIwGt10LMEOyWUfdPjR1KsDaDtcnZvnmcjTA+GC3K 1+6ZxaDaZSOQOIoG3HL/5AwueFHPVCVb+OQJqCY6zfzXqhHQjgXv5ElFH6CFykeMFYQv DA2L74aE38Ac1eFKdfMWUVLo8sJloozs9q/GqHhdl+buLulvsO/fogyRrGNT0PTl+jMW BTzOnrlwrsVuNojk7Ol8B0GVYk9pn118BkpIdUdBphQEHAbt7MsTNMzAPoh1caiyy3VG AA/A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :organization:from:references:cc:to:content-language:subject :user-agent:mime-version:date:message-id:dkim-signature :wdcironportexception:ironport-sdr:ironport-sdr:dkim-signature; bh=JT7b/pUmqP1AWCWLbFnAqC1ROlHycx/3hMWPR7w0LIw=; b=xmtgHMeOkNz5hiOp17CLWRzhPAIPUl8tCLEFZSrjMQmp1xOsuA034Jm8N9EKrngNhq ruEND5FBXQTgXNxPggzxIjAf/dy7Rn7VlqTmGNxZRYByrl/UQnp2kG0kbvN6zOWh3g0L s9hWPr9P6gBFLN+yYlPovomtkp+rUThVUWVmOYfrnmArTKjCw386MqUwMYTzsBglIziy L3MgXRTFnO5ymcqjSgXzKhwxmZhJ+5Q+mfOfYP1I89P+co53z2bJUCymhrTeD5p09sVQ RdQbPE2VKmrsSsM5zRgddma0yzfs9biQL1x0SwSpbf4JQd/rSiE63PWfELbx4LDZPQQl 4kpg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=K6XM5lBw; dkim=pass header.i=@opensource.wdc.com header.s=dkim header.b=mxzaNg6b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=opensource.wdc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id z9-20020a630a49000000b0047895912190si1703943pgk.270.2022.12.06.00.53.06; Tue, 06 Dec 2022 00:53:16 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@wdc.com header.s=dkim.wdc.com header.b=K6XM5lBw; dkim=pass header.i=@opensource.wdc.com header.s=dkim header.b=mxzaNg6b; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=opensource.wdc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233846AbiLFI3x (ORCPT + 79 others); Tue, 6 Dec 2022 03:29:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:56408 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232099AbiLFI3r (ORCPT ); Tue, 6 Dec 2022 03:29:47 -0500 Received: from esa6.hgst.iphmx.com (esa6.hgst.iphmx.com [216.71.154.45]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8694713F93 for ; Tue, 6 Dec 2022 00:29:46 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=wdc.com; i=@wdc.com; q=dns/txt; s=dkim.wdc.com; t=1670315386; x=1701851386; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=cdyC1a0qwRBQniEmLvGy2bo9XStixIWTp8wQcxB/s4k=; b=K6XM5lBwdsuY2bkRzgSKvBdKrEBmQF3OhyS0xYZ59447KPWMPCl/YvH8 slzZ95coOgfkDPWxEmTJCflZPf19txkHw0GqQJod2LKiQjutLzmqfO0tQ y7NhBiYgxUGQtBZyOFrs+oC5Va9ZrpGvbmVYS6J5WIUcIO9J2xM7hfLWQ w6KDCL6GUh7gLrGSkuNLN9iBfwwGF2NoJYeLuqGbIpuvCYG5VEFCdmNO+ d0M/6dS8B4vB35Yo+oB86gqqxWfQ/IgtrL2fAuq7llREvGqc1jquChHGa 7O5xI12iL7Vv/b6aDLdRLaiRCqFCmwLD6SJXM5/QJb8N4MB/ApwwzNv5S g==; X-IronPort-AV: E=Sophos;i="5.96,220,1665417600"; d="scan'208";a="218258771" Received: from uls-op-cesaip01.wdc.com (HELO uls-op-cesaep01.wdc.com) ([199.255.45.14]) by ob1.hgst.iphmx.com with ESMTP; 06 Dec 2022 16:29:45 +0800 IronPort-SDR: 1A5XNCU5Gwi+6rjHvSzG0S93ixefuR4Y797x9ksocYpQ+EGJADjn8m/cpvHeyj1jiQ5/DZCeXm pBFwwbkXfApVTm+4OZai1t0gECkh9bbFvCoHdIL5uehkBz+8bYMnfrKGXbCkZChdxI3ffgHipf Nbvvw3mWjvB5XnkIEJ8UkABWASRHsNCT7JBiKst6ek0rJnI5cFZdeVHoeDmLZ+XxyPhUJ3totc 3KlVGT7CXgquMtzc1R2Pb0kLjWfDDuYKQuOpcYYQyWRN1MLMyw84lRxEeN2Zrt74cjLXD+qGRy oy0= Received: from uls-op-cesaip02.wdc.com ([10.248.3.37]) by uls-op-cesaep01.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 05 Dec 2022 23:48:17 -0800 IronPort-SDR: WDk3tcx3J7Fwq/nyUZvJdC4wgX1ppnUpf3mdTUuibelaurt4YzkGZiztJTVYnuGAhxOd12f39h bnZ9XxX0DxdVEUknpxzof1TWIxuVmR3yQv0kyeJ+P5XzMgKIOtJdjXkdrz8813UWLuzxfMoQxu chf8PKAGXpfFxfg0GvpW4DaiOLQXgc08k052jOC/JtvNN+4gMWyjBn4xkcJBbLcPquUa+A0o/R mISpRLrkPnk2S2o7jL2JfiLMlPq5imJ0DhWrrBbml6pQ00k89lMsGZxbH8opD1FF0DHDJzocn8 BPY= WDCIronportException: Internal Received: from usg-ed-osssrv.wdc.com ([10.3.10.180]) by uls-op-cesaip02.wdc.com with ESMTP/TLS/ECDHE-RSA-AES128-GCM-SHA256; 06 Dec 2022 00:29:45 -0800 Received: from usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTP id 4NRD9j1Nh2z1Rwrq for ; Tue, 6 Dec 2022 00:29:45 -0800 (PST) Authentication-Results: usg-ed-osssrv.wdc.com (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=opensource.wdc.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d= opensource.wdc.com; h=content-transfer-encoding:content-type :in-reply-to:organization:from:references:to:content-language :subject:user-agent:mime-version:date:message-id; s=dkim; t= 1670315384; x=1672907385; bh=cdyC1a0qwRBQniEmLvGy2bo9XStixIWTp8w QcxB/s4k=; b=mxzaNg6by6iVaLVXekHDkPEXWlsmURQQq/Y5dxQ+QMDjQrXkvyn p7w65o0OSV3FAUDyM8UEW1eHprrxC0FrPUQnD/r9xoxn9jqquSyAz91ODPAkeNzP sVHZ8XzGfG59C/LF1mg5az61QMpklcKIlO0bXOF8WJgjRWoWBLXuI7RrGNagNXBK 6GgH2z+6dPECpUDDBoraj1fveNKJEyatEfrTLbLjh4Or0VnIYIyxM7/WA32HuBrt 9Zcd9qMZ3lbMMZ+5U/lrDmgJlHh+Gr+uYv8opXR1MFoHQzNwrmAx9lhjvJwBPhs/ 32VWKLyvBijy454tgHfiMmpagqm2CIHlxIw== X-Virus-Scanned: amavisd-new at usg-ed-osssrv.wdc.com Received: from usg-ed-osssrv.wdc.com ([127.0.0.1]) by usg-ed-osssrv.wdc.com (usg-ed-osssrv.wdc.com [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id hxHg_48jZ5Td for ; Tue, 6 Dec 2022 00:29:44 -0800 (PST) Received: from [10.225.163.74] (unknown [10.225.163.74]) by usg-ed-osssrv.wdc.com (Postfix) with ESMTPSA id 4NRD9g27Kdz1RvLy; Tue, 6 Dec 2022 00:29:43 -0800 (PST) Message-ID: Date: Tue, 6 Dec 2022 17:29:41 +0900 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: [PATCH V6 6/8] block, bfq: retrieve independent access ranges from request queue Content-Language: en-US To: Paolo Valente Cc: Jens Axboe , linux-block , linux-kernel@vger.kernel.org, arie.vanderhoeven@seagate.com, rory.c.chen@seagate.com, Federico Gavioli References: <20221103162623.10286-1-paolo.valente@linaro.org> <20221103162623.10286-7-paolo.valente@linaro.org> <5d062001-2fff-35e5-d951-a61b510727d9@opensource.wdc.com> <4C45BCC6-D9AB-4C70-92E2-1B54AB4A2090@linaro.org> From: Damien Le Moal Organization: Western Digital Research In-Reply-To: <4C45BCC6-D9AB-4C70-92E2-1B54AB4A2090@linaro.org> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-4.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_MED, SPF_HELO_PASS,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 12/6/22 17:06, Paolo Valente wrote: > > >> Il giorno 21 nov 2022, alle ore 02:01, Damien Le Moal ha scritto: >> > > ... > >> >>> } >>> >>> static bool bfq_bio_merge(struct request_queue *q, struct bio *bio, >>> @@ -7144,6 +7159,8 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e) >>> { >>> struct bfq_data *bfqd; >>> struct elevator_queue *eq; >>> + unsigned int i; >>> + struct blk_independent_access_ranges *ia_ranges = q->disk->ia_ranges; >>> >>> eq = elevator_alloc(q, e); >>> if (!eq) >>> @@ -7187,10 +7204,31 @@ static int bfq_init_queue(struct request_queue *q, struct elevator_type *e) >>> bfqd->queue = q; >>> >>> /* >>> - * Multi-actuator support not complete yet, default to single >>> - * actuator for the moment. >>> + * If the disk supports multiple actuators, we copy the independent >>> + * access ranges from the request queue structure. >>> */ >>> - bfqd->num_actuators = 1; >>> + spin_lock_irq(&q->queue_lock); >>> + if (ia_ranges) { >>> + /* >>> + * Check if the disk ia_ranges size exceeds the current bfq >>> + * actuator limit. >>> + */ >>> + if (ia_ranges->nr_ia_ranges > BFQ_MAX_ACTUATORS) { >>> + pr_crit("nr_ia_ranges higher than act limit: iars=%d, max=%d.\n", >>> + ia_ranges->nr_ia_ranges, BFQ_MAX_ACTUATORS); >>> + pr_crit("Falling back to single actuator mode.\n"); >>> + bfqd->num_actuators = 0; >>> + } else { >>> + bfqd->num_actuators = ia_ranges->nr_ia_ranges; >>> + >>> + for (i = 0; i < bfqd->num_actuators; i++) >>> + bfqd->ia_ranges[i] = ia_ranges->ia_range[i]; >>> + } >>> + } else { >>> + bfqd->num_actuators = 0; >> >> That is very weird. The default should be 1 actuator. >> ia_ranges->nr_ia_ranges is 0 when the disk does not provide any range >> information, meaning it is a regular disk with a single actuator. > > Actually, IIUC this assignment to 0 seems to be done exactly when you > say that it should be done, i.e., when the disk does not provide any > range information (ia_ranges is NULL). Am I missing something else? No ranges reported means no extra actuators, so a single actuator an single LBA range for the entire device. In that case, bfq should process all IOs using bfqd->ia_ranges[0]. The get range function will always return that range. That makes the code clean and avoids different path for nr_ranges == 1 and nr_ranges > 1. No ? > > Once again, all other suggestions applied. I'm about to submit a V7. > > Thanks, > Paolo > -- Damien Le Moal Western Digital Research