From nobody Fri Apr 19 18:31:00 2024 Delivered-To: importer@patchew.org Received-SPF: none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail(p=none dis=none) header.from=virtuozzo.com ARC-Seal: i=1; a=rsa-sha256; t=1570138160; cv=none; d=zoho.com; s=zohoarc; b=Ut0chJ206INVeI6wkcvKFihObZf8mT7IkPetD5YgDIxnoY5FO34dopYpLxsNpUq821tO77ORVBic+xcI+Cqam4jZ4BcKhMUa5618hOJdQqLsiMZzvkmlX/4aXcPgVzjjGUXYmlPWjiuqvncc9ERFP0Gfk6sXFGlDL5OvrYWWVoM= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zoho.com; s=zohoarc; t=1570138160; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Subject:To:ARC-Authentication-Results; bh=ro9cpAMati3YeVEkuy6Q/3/3n67UswZG9oJB2am1iaA=; b=Tj+b3X0g2IBpS3kJCR4+tuj5cFc/dhRZ7GQn6aJvLXRderlgVQmuWksc9NuZl7esTR2R+QL4TxwoddLaV3C/XxdRTQIGYbJ3QmwQMK9cC5ub0pBrUp7EQEx20PHA+inZ/laoC10QKTPviLXJjq1R+F9i3NDME66CzEPJJbGIbt8= ARC-Authentication-Results: i=1; mx.zoho.com; spf=none (zoho.com: 78.46.105.101 is neither permitted nor denied by domain of seabios.org) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1570138159966880.1462002710608; Thu, 3 Oct 2019 14:29:19 -0700 (PDT) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 167C012A0FD2; Thu, 3 Oct 2019 21:29:16 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 4F69C12A0F8F for ; Tue, 1 Oct 2019 07:25:34 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by relay.sw.ru with esmtp (Exim 4.92.2) (envelope-from ) id 1iFCXL-0001Xh-1u; Tue, 01 Oct 2019 10:25:31 +0300 From: Denis Plotnikov To: seabios@seabios.org Date: Tue, 1 Oct 2019 10:25:00 +0300 Message-Id: <20191001072500.18944-1-dplotnikov@virtuozzo.com> X-MailFrom: dplotnikov@virtuozzo.com X-Mailman-Rule-Hits: nonmember-moderation X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1 Message-ID-Hash: 24UXLPOZSXGECMBJAAHYLANOKHHZGHPJ X-Message-ID-Hash: 24UXLPOZSXGECMBJAAHYLANOKHHZGHPJ X-Mailman-Approved-At: Thu, 03 Oct 2019 21:29:04 +0000 CC: den@virtuozzo.com X-Mailman-Version: 3.2.3 Precedence: list Subject: [SeaBIOS] [PATCH] virtio: extend virtio queue size to 256 List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Post: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-Spamd-Bar: +++++ X-Spam-Level: ***** Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org Content-Type: text/plain; charset="utf-8" Some linux kernels has a performance flaw in virtio block device access. On some frequent disk access patterns, e.g. 1M read, the kernel produces more block requests than needed. This happens because of virtio seg_max parameter set to 126 (virtqueue_size - 2) which limits the maximum block request to 516096 (126 * 4096_PAGE_SIZE). Setting seg_max > 126 fixes the issue, however, not all linux kernels allow that. The old ones have a restriction virtqueue_size >=3D seg_max. This restriction is hardcoded and the kernel crashes in case of violation. The restriction is relaxed in the recent kernels. Windows kernels don't have such a restriction. To increse seg_max and not to break the restriction, one can increase the virtqueue size to 256 and seg_max to 254. To do that, seabios support of 256 virtqueue size is needed. Signed-off-by: Denis Plotnikov --- src/hw/virtio-ring.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/hw/virtio-ring.h b/src/hw/virtio-ring.h index 8604a01..dccc50d 100644 --- a/src/hw/virtio-ring.h +++ b/src/hw/virtio-ring.h @@ -20,7 +20,7 @@ #define VIRTIO_F_VERSION_1 32 #define VIRTIO_F_IOMMU_PLATFORM 33 =20 -#define MAX_QUEUE_NUM (128) +#define MAX_QUEUE_NUM (256) =20 #define VRING_DESC_F_NEXT 1 #define VRING_DESC_F_WRITE 2 --=20 2.17.0 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org