Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2911456pxp; Tue, 22 Mar 2022 08:19:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwWb70wWy9x7Mni5SEAbH8mxIe2JTx/5tBIzvNFcWH6wqNOj2irndkb20sq3YVNONje+slQ X-Received: by 2002:a17:907:60c8:b0:6da:83f0:9eaa with SMTP id hv8-20020a17090760c800b006da83f09eaamr25948999ejc.605.1647962397041; Tue, 22 Mar 2022 08:19:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647962397; cv=none; d=google.com; s=arc-20160816; b=B7R9eQjk3c0YhRQ+YzwOraSQz6c8xNPcDA1fgAZ1s/XAx3Tw7Y9rI//v7RkuL33khl iMXlgBtA6UNP1eLMbWx4MwGnMmxjCxZY8mm20f0mFwP4G+byCEbLwsrIty1c89unyK6z wt2yfzGGbEUL31xYeV2iGDDOLOld6FeTOSnWzUbqkqr04AtOEUV8qDTPwQ11FrPzpqmQ csr/PvIZARbqcAykIL2rvlSWb0ga/FINa2y2uTHDJkkOfe3tlI0wy9bcVxOA1mbqIdkV MfLWl+czQcO4Oz5/HKp/eaBu3eW14tAXz4Jvhflp3Db/dY3gmAUZZK8eSJ57A54g0x1B wXkg== 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:subject :from:references:cc:to:content-language:user-agent:mime-version:date :message-id:dkim-signature:dkim-signature; bh=hxjeJtctvItHxAuxf7YEFgNghbofAlK0X837AW6jowg=; b=td4kSrJf00FkUsKK9MA9ymLWZigH5vpkVgPWXQTSswNpVu3Osaz2XwDsYit643MPlr x/rnZXQNM9PQo+no/WJT5Gy8S0fll+GQXCnAqWfLTC+BDM4wPi2QBVV3KDr2w78J5OrZ tKUuG+uFWCrlOYQlwLIh8svNraE4ZsR9SjMJjlTdFGB6fx0OQHCbcQIkuktlSjLtv0FX zcw31nBn4orKWkayeaAgR2Y/P1vKF45la4i/cg3pxTvfgxP5lQn7I7olKuWbbZEqIDXq Coq/k1909XcyGT/uF/SA6gd8q6YE1QeQJgklhMF7AnBoYzEab5/X7bp0embc+/TJMkZ5 hypw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.de header.s=susede2_rsa header.b=1HahhxYu; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=+s+pJvWe; 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=NONE sp=NONE dis=NONE) header.from=suse.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id o11-20020a17090608cb00b006df76385db7si9585666eje.599.2022.03.22.08.19.31; Tue, 22 Mar 2022 08:19:57 -0700 (PDT) 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=pass header.i=@suse.de header.s=susede2_rsa header.b=1HahhxYu; dkim=neutral (no key) header.i=@suse.de header.s=susede2_ed25519 header.b=+s+pJvWe; 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=NONE sp=NONE dis=NONE) header.from=suse.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236049AbiCVOEh (ORCPT + 99 others); Tue, 22 Mar 2022 10:04:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50144 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236027AbiCVOEe (ORCPT ); Tue, 22 Mar 2022 10:04:34 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CE1B92181D; Tue, 22 Mar 2022 07:03:06 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 123B7210E2; Tue, 22 Mar 2022 14:03:05 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_rsa; t=1647957785; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hxjeJtctvItHxAuxf7YEFgNghbofAlK0X837AW6jowg=; b=1HahhxYubHjyjXf3x5tSAPtNs94DufBIYB7u1A0vP4mor3219f8y8piYhga6u25WArLFnS pI8luKQLIIAZLESqTiECLMRUY4662mREjQaQbZ+DXRDgXhqh9PhuolvCY5UGWoSBNymWZY cUDR+Cib+KwSMmvEjIpoPJ373jjq/vI= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.de; s=susede2_ed25519; t=1647957785; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=hxjeJtctvItHxAuxf7YEFgNghbofAlK0X837AW6jowg=; b=+s+pJvWejwOUWanic85/07ZAh2YkVuMiJHwRm5qpSCNi/cyi9lVo7pmXn2La49cbMKqUf/ nn/meLPCRH0vGQBA== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id D1B4112FC5; Tue, 22 Mar 2022 14:03:04 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id ZcjaMhjXOWI6HQAAMHmgww (envelope-from ); Tue, 22 Mar 2022 14:03:04 +0000 Message-ID: <306df4cf-0ee0-2b1e-044c-aed6c70122f9@suse.de> Date: Tue, 22 Mar 2022 15:03:04 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.4.0 Content-Language: en-US To: John Garry , Christoph Hellwig Cc: axboe@kernel.dk, damien.lemoal@opensource.wdc.com, bvanassche@acm.org, jejb@linux.ibm.com, martin.petersen@oracle.com, ming.lei@redhat.com, chenxiang66@hisilicon.com, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, linux-ide@vger.kernel.org, linux-scsi@vger.kernel.org, dm-devel@redhat.com, beanhuo@micron.com References: <1647945585-197349-1-git-send-email-john.garry@huawei.com> <1647945585-197349-2-git-send-email-john.garry@huawei.com> <20220322111848.GA29270@lst.de> From: Hannes Reinecke Subject: Re: [PATCH 01/11] blk-mq: Add blk_mq_init_queue_ops() In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.4 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_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE 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 3/22/22 13:30, John Garry wrote: > On 22/03/2022 12:16, Hannes Reinecke wrote: >> On 3/22/22 12:33, John Garry wrote: >>> On 22/03/2022 11:18, Christoph Hellwig wrote: >>>> On Tue, Mar 22, 2022 at 06:39:35PM +0800, John Garry wrote: >>>>> Add an API to allocate a request queue which accepts a custom set of >>>>> blk_mq_ops for that request queue. >>>>> >>>>> The reason which we may want custom ops is for queuing requests >>>>> which we >>>>> don't want to go through the normal queuing path. >>>> >>>> Eww.  I really do not think we should do separate ops per queue, as >>>> that >>>> is going to get us into a deep mess eventually. >>>> >>> >>> Yeah... so far (here) it works out quite nicely, as we don't need to >>> change the SCSI blk mq ops nor allocate a scsi_device - everything is >>> just separate. >>> >>> The other method mentioned previously was to add the request >>> "reserved" flag and add new paths in scsi_queue_rq() et al to handle >>> this, but that gets messy. >>> >>> Any other ideas ...? >>> >> >> As outlined in the other mail, I think might be useful is to have a >> _third_ type of requests (in addition to the normal and the reserved >> ones). >> That one would be allocated from the normal I/O pool (and hence could >> fail if the pool is exhausted), but would be able to carry a different >> payload (type) than the normal requests. > > As mentioned in the cover letter response, it just seems best to keep > the normal scsi_cmnd payload but have other means to add on the internal > command data, like using host_scribble or scsi_cmnd priv data. > Well; I found that most drivers I had been looking at the scsi command payload isn't used at all; the drivers primarily cared about the (driver-provided) payload, and were completely ignoring the scsi command payload. Similar for ATA/libsas: you basically never issue real scsi commands, but either 'raw' ATA requests or SCSI TMFs. None of which are scsi commands, so providing them is a bit of a waste. (And causes irritations, too, as a scsi command requires associated pointers like ->device etc to be set up. Which makes it tricky to use for the initial device setup.) >> And we could have a separate queue_rq for these requests, as we can >> differentiate them in the block layer. > > I don't know, let me think about it. Maybe we could add an "internal" > blk flag, which uses a separate "internal" queue_rq callback. > Yeah, that's what I had in mind. Cheers, Hannes -- Dr. Hannes Reinecke Kernel Storage Architect hare@suse.de +49 911 74053 688 SUSE Software Solutions Germany GmbH, Maxfeldstr. 5, 90409 Nürnberg HRB 36809 (AG Nürnberg), GF: Felix Imendörffer