Received: by 2002:a05:6a10:206:0:0:0:0 with SMTP id 6csp4483393pxj; Tue, 25 May 2021 09:00:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw3xC6yd6jG7+7wY9ddHXm9EeroSbzUuniWnUbK6zQV/Yy80uh/YrGDe+cdVs6Rj7VJ2bhB X-Received: by 2002:aa7:c1c9:: with SMTP id d9mr33712836edp.308.1621958442006; Tue, 25 May 2021 09:00:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1621958441; cv=none; d=google.com; s=arc-20160816; b=Eyaw84muTOgX/H9KI1kXvC2bN0K9rmBuIT800ZgLPdf3WnKS3wZBDcVYxAWzBlwOC9 MQmROtB0uzko3+L64a6GwBM57aihjdrWTqpU/UyJTF4hji5wubzZrrB2X6fqUMG0jDVh 6tpbQhWJdV3j5BwXYtE94U7qxA39ALpIOPY9tfIkr4BM2bgggXCE/z7h+Yz6Aju7wN12 6CObusCYUAPPJrIU+eCfBD0u17+hZulit036Dh2UuGxsaNYIdaSZLU0KLuCAYwTaiXNT on4QfbTVUJT7hLokc/sZX558rfbPHO7XFKWX6hdAliToePj81lmDUqcY/jnae5MO5nRv pWTA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=zZxaIXMKBL2xYZBd8FBb6gCvi6cm3iqOYV73SsLQBnI=; b=D6ZCKt3RoX00Og2cH1YP4e3YVw6CKy5UfD6VrFokxJ2SdZ8e8esWBCyjA2DKwKGH1T a6bmng4leAmbIgmRMBHHl4/eQ37E8P+3zcVoSU+OhRuK2e8wop95DTSGtkjnE8lS/plj wM7XrO+k7Zf2auL/foxYgR7VI1I9ukGn0NgilZxAAOIPEXlc1QXGpbYpHiWd44+PFImV tIERAhHHhUuPoAs/sckXjnvA2gTnx0sE47ZTNWvjtIjxG5t6gxCVAl0zFIlC+PjR89Bm xdetspaTaOj7JwK78nSuOmvWNGSsutQA+sLcUSH4yDOGGYcu+88YO+DAN9Rj1EfDZJN8 c0tQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="UH6r/UVe"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id n5si6240132ejj.89.2021.05.25.09.00.18; Tue, 25 May 2021 09:00:41 -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; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b="UH6r/UVe"; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233162AbhEYNVH (ORCPT + 99 others); Tue, 25 May 2021 09:21:07 -0400 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]:38321 "EHLO us-smtp-delivery-124.mimecast.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233127AbhEYNVF (ORCPT ); Tue, 25 May 2021 09:21:05 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1621948774; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=zZxaIXMKBL2xYZBd8FBb6gCvi6cm3iqOYV73SsLQBnI=; b=UH6r/UVeRPsTBXNnwvsW7V3CwelN0e46jmtDKXNRdVTzWWiJOfJ2qYtnevh+5xweMEJ2Z9 cYZqbkWS86fSKb4/58/HtpV076pkRv9l8f6peCFAtLRx3ZDSqBVRZ1ItfCTKo5NcZwJdVz 7JyIgzaiSf48FHqS8D+4AZfKIG5bPnc= 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-58-4G8AXiD4MC6vQu30vdl2ng-1; Tue, 25 May 2021 09:19:32 -0400 X-MC-Unique: 4G8AXiD4MC6vQu30vdl2ng-1 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4D733100945E; Tue, 25 May 2021 13:19:31 +0000 (UTC) Received: from localhost (ovpn-115-80.ams2.redhat.com [10.36.115.80]) by smtp.corp.redhat.com (Postfix) with ESMTP id 15982100760F; Tue, 25 May 2021 13:19:23 +0000 (UTC) Date: Tue, 25 May 2021 14:19:22 +0100 From: Stefan Hajnoczi To: Christoph Hellwig Cc: virtualization@lists.linux-foundation.org, linux-block@vger.kernel.org, linux-kernel@vger.kernel.org, Jason Wang , Paolo Bonzini , Jens Axboe , slp@redhat.com, sgarzare@redhat.com, "Michael S. Tsirkin" Subject: Re: [PATCH 3/3] virtio_blk: implement blk_mq_ops->poll() Message-ID: References: <20210520141305.355961-1-stefanha@redhat.com> <20210520141305.355961-4-stefanha@redhat.com> <20210524145928.GA3873@lst.de> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="FcfGVErKD3SlOPsb" Content-Disposition: inline In-Reply-To: <20210524145928.GA3873@lst.de> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --FcfGVErKD3SlOPsb Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Mon, May 24, 2021 at 04:59:28PM +0200, Christoph Hellwig wrote: > On Thu, May 20, 2021 at 03:13:05PM +0100, Stefan Hajnoczi wrote: > > Possible drawbacks of this approach: > >=20 > > - Hardware virtio_blk implementations may find virtqueue_disable_cb() > > expensive since it requires DMA. If such devices become popular then > > the virtio_blk driver could use a similar approach to NVMe when > > VIRTIO_F_ACCESS_PLATFORM is detected in the future. > >=20 > > - If a blk_poll() thread is descheduled it not only hurts polling > > performance but also delays completion of non-REQ_HIPRI requests on > > that virtqueue since vq notifications are disabled. >=20 > Yes, I think this is a dangerous configuration. What argument exists > again just using dedicated poll queues? Aside from what Paolo described (the lack of a hardware interface to designate polling queues), the poll_queues=3DN parameter needs to be added to the full guest and host software stack. Users also need to learn about this so they can enable it in all the places. This is much more hassle for users to configure. The dynamic polling mode approach requires no configuration. Paolo's suggestion is to notify the driver when irqs need to be re-enabled if the polling thread is descheduled. I actually have a prototype that achieves something similar here: https://gitlab.com/stefanha/linux/-/commits/cpuidle-haltpoll-virtqueue It's a different approach from the current patch series: the cpuidle driver provides poll_start/stop() callbacks and virtio_blk participates in cpuidle-haltpoll. That means all virtio-blk devices temporarily use polling mode while the vCPU is doing cpuidle-haltpoll polling. The neat thing about the cpuidle approach is: 1. Applications don't need to set the RWF_HIPRI flag! 2. Other drivers besides virtio_blk can participate in polling too. Maybe we should go with cpuidle polling instead? Stefan --FcfGVErKD3SlOPsb Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQEzBAEBCAAdFiEEhpWov9P5fNqsNXdanKSrs4Grc8gFAmCs+VoACgkQnKSrs4Gr c8iQxwgAmR9W7hmYqTRjXDc7N6m7WlEUvC5lJOdzS6z9lyWow8E4NbsDC3bWMGRA FqBeqV/uXR7quNHf2SlUJRYU8vCiHklVo2GuEVi28frjrI+a1jNIAYqgreDPruWp raBsSoXtEiYp7hbNFxTbRV78h/NiM/YB5SaVLSW5X+0JTbIDvQ3Too7VZeDfvdki ia88AtFEQ19hFnvIMnnEPu/Lh6J71U2opqacHvBqJMfFJGIQotpBlnHc/uwW+GQ6 Uys7SGQ073N8tZStszYefcPI0QRiptiIAE08DO40KlLjKtBHt1hc5QAd3y89y5el ZSupk+mYJLpzLXQUB+VvLAINMtu2Og== =PIq+ -----END PGP SIGNATURE----- --FcfGVErKD3SlOPsb--