Received: by 2002:a05:6a10:eb17:0:0:0:0 with SMTP id hx23csp3981579pxb; Tue, 7 Sep 2021 11:49:06 -0700 (PDT) X-Google-Smtp-Source: ABdhPJza0xEUsNS0/dvrm2yiBxab9LIyE/Hoqnh85PbywVJBOveUNRMXlPucCyJYEEpgK4cNtVmQ X-Received: by 2002:a17:906:249a:: with SMTP id e26mr19748493ejb.221.1631040546736; Tue, 07 Sep 2021 11:49:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1631040546; cv=none; d=google.com; s=arc-20160816; b=QepJbFQhg7rax6B0z3TTHShuDNiwfPTC0AbHwGPlVd38IxXuIsCMxhD2EuxF1+x96b u7h3RDWOHzS89UdEzMLYubRjjwcNPBtV3zb75J08SUbS6bmXJXTLbnFBFBA4/+13i8d/ 5vvKxS8MPIn9gYH/c5rVMYB8ayvjiGZdtqQ3dvUrxzo6VMIYT/NsyjU4Yb4R3BVvxS9k QC5PfR9/0ynFcsC+sHqQQubTf8Qt6mYSwn3h3h5rDxHl+eRd7RsR14fpeoFxPq6HUj+m rMxe9tdotLEpY8DGvpKuCGp0zUo06lZQ8+61cr8vCJ0r+IpEzpQ1bcXaPjZWkTXe5FJx 6Trg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject; bh=dYDs401BvuatCbxnRZw1i+4w3pvPmJU5MtqWESg7zUI=; b=RDakXu98vpVnzvrpCJcnVUOd9LkeOaTPTJMPHFchTLgxie5JMU1opAb9bB9pIMjxwU zmDh8sf05+vaGmgx+EGrDnDMkt2gJMRTVrAYbZ2aArOrDeK5q3Tqivd6KSdf8x+BE892 PmNsflBe1JIl7Uq/0ofBf+w0XQWZKHxpydPckdOfNcqB+H9hDCxJQIvcs7QU78g1nbaP r+Yci1RFd47zXfdn2fr6aDfJx3EPeYPavGphjCljf7LVnZac3JmZcmvFuqBiU9Dj9tTE +7A5Q1drzh71ffYbLJg6UcauMSR5zepPIqRIpZajmguEI+dVOM9nYVhJOjy+er42Ygqa uAhQ== ARC-Authentication-Results: i=1; mx.google.com; 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 w21si3054445edt.523.2021.09.07.11.48.43; Tue, 07 Sep 2021 11:49:06 -0700 (PDT) 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; 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 S1345622AbhIGROA (ORCPT + 99 others); Tue, 7 Sep 2021 13:14:00 -0400 Received: from mail-pl1-f180.google.com ([209.85.214.180]:34420 "EHLO mail-pl1-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345578AbhIGRN7 (ORCPT ); Tue, 7 Sep 2021 13:13:59 -0400 Received: by mail-pl1-f180.google.com with SMTP id j2so6243416pll.1; Tue, 07 Sep 2021 10:12:53 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=dYDs401BvuatCbxnRZw1i+4w3pvPmJU5MtqWESg7zUI=; b=er3fgh6ervAPgAOioMqaKxmMXwmahHMRCqVz3OV1fuylFcD32WjiFjBKlWCt592KpJ GY3DXObwM8Avs8w8mEAdxpDI/i6k94Qf3G1qmwtsLIPSaIhRSpLuWpACX3+P2QO4onBF qLYcXMPVPY22/1WxhY5dJ0BpNRDXBBbrjvbBkbcxyvbdh9k5WuFDbu8+qKg1/7LBH7oM v5S3V1OabZnjXXShEIZMepYD5+g66T2yzn6cAp8ByI3ywq0niN2ptpYuzw7r4g26EEvM 16x/YcAnRzPJdi9yQRir498gZY2cdHcdD9c28KHCWlBVOATsYYor9Voy5sxzXmp0vMCk 0nYg== X-Gm-Message-State: AOAM530ALOmaN5BKsNyoWqswAV/1Hpo6R6d4ynMCioR6yWtj8+FPtISH q/wEtoRLPs+7taB8V1xdgnP1I88R7II= X-Received: by 2002:a17:90a:2f23:: with SMTP id s32mr5619327pjd.168.1631034772758; Tue, 07 Sep 2021 10:12:52 -0700 (PDT) Received: from [192.168.50.110] (c-73-241-217-19.hsd1.ca.comcast.net. [73.241.217.19]) by smtp.gmail.com with ESMTPSA id q18sm11569127pfj.46.2021.09.07.10.12.51 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Tue, 07 Sep 2021 10:12:51 -0700 (PDT) Subject: Re: [PATCH 2/2] Revert "mq-deadline: Fix request accounting" To: Niklas Cassel Cc: Jens Axboe , Damien Le Moal , Paolo Valente , Ming Lei , "linux-block@vger.kernel.org" , "linux-kernel@vger.kernel.org" References: <20210907142145.112096-1-Niklas.Cassel@wdc.com> <20210907142145.112096-3-Niklas.Cassel@wdc.com> From: Bart Van Assche Message-ID: <55fca3f4-4ed0-fd56-3069-c0ab343b2aed@acm.org> Date: Tue, 7 Sep 2021 10:12:49 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.13.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 9/7/21 9:28 AM, Niklas Cassel wrote: > On Tue, Sep 07, 2021 at 08:15:03AM -0700, Bart Van Assche wrote: >> On 9/7/21 7:21 AM, Niklas Cassel wrote: >>> blk-mq will no longer call the I/O scheduler .finish_request() callback >>> for requests that were never inserted to the I/O scheduler. >> >> I do not agree. Even with patch 1/2 from this series applied, finish_request() >> will still be called for requests inserted by blk_insert_cloned_request() >> although these requests are never inserted to the I/O scheduler. > > Looking at blk_mq_free_request(), > e->type->ops.finish_request() will only be called if RQF_ELVPRIV > is set. > > blk_insert_cloned_request() doesn't seem to allocate a request > itself, but instead takes an already cloned request. > > So I guess it depends on how the supplied request was cloned. > > I would assume if the original request doesn't have RQF_ELVPRIV set, > then neither will the cloned request? > > I tried to look at blk_rq_prep_clone(), which seems to be a common > cloning function, but I don't see req->rq_flags being copied > (except for RQF_SPECIAL_PAYLOAD). > > Anyway, I don't see how .finish_request() will be called in relation > to blk_insert_cloned_request(). Could you please help me out and > give me an example of a call chain where this can happen? Hi Niklas, This is a bit outside my area of expertise. Anyway: map_request() calls .clone_and_map_rq(). At least multipath_clone_and_map() calls blk_get_request(). I think this shows that blk_insert_cloned_request() may insert an entirely new request. Is my understanding correct that blk_mq_rq_ctx_init() will set RQF_ELVPRIV for the cloned request if a scheduler is associated with the request queue associated with the cloned request? Bart.