From owner-freebsd-usb@freebsd.org Sun Mar 1 16:33:52 2020 Return-Path: Delivered-To: freebsd-usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id E1F54244B8E for ; Sun, 1 Mar 2020 16:33:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mailman.nyi.freebsd.org (mailman.nyi.freebsd.org [IPv6:2610:1c1:1:606c::50:13]) by mx1.freebsd.org (Postfix) with ESMTP id 48VpkS1YhZz4c1T for ; Sun, 1 Mar 2020 16:33:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: by mailman.nyi.freebsd.org (Postfix) id 05208244B8D; Sun, 1 Mar 2020 16:33:52 +0000 (UTC) Delivered-To: usb@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 04C56244B8B for ; Sun, 1 Mar 2020 16:33:52 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 48VpkR3sQHz4c0L for ; Sun, 1 Mar 2020 16:33:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2610:1c1:1:606c::50:1d]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 6FB11666D for ; Sun, 1 Mar 2020 16:33:51 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org ([127.0.1.5]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id 021GXp9E070503 for ; Sun, 1 Mar 2020 16:33:51 GMT (envelope-from bugzilla-noreply@freebsd.org) Received: (from www@localhost) by kenobi.freebsd.org (8.15.2/8.15.2/Submit) id 021GXpcA070502 for usb@FreeBSD.org; Sun, 1 Mar 2020 16:33:51 GMT (envelope-from bugzilla-noreply@freebsd.org) X-Authentication-Warning: kenobi.freebsd.org: www set sender to bugzilla-noreply@freebsd.org using -f From: bugzilla-noreply@freebsd.org To: usb@FreeBSD.org Subject: [Bug 244356] Writing to a USB 3.0 stick is very slow Date: Sun, 01 Mar 2020 16:33:50 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: usb X-Bugzilla-Version: 12.1-RELEASE X-Bugzilla-Keywords: needs-qa, performance X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: seb@boisvert.info X-Bugzilla-Status: Open X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: usb@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-usb@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: FreeBSD support for USB List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 01 Mar 2020 16:33:53 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D244356 --- Comment #20 from Sebastien Boisvert --- (In reply to Hans Petter Selasky from comment #18) > FreeBSD doesn't have a disk cache. I don't know much about FreeBSD so maybe I am wrong, but: In FreeBSD, ZFS ARC (adaptive replacement cache) is a disk cache for read operations for ZFS. So, for read operations, if I have ZFS on the USB stick, then there is a di= sk cache for read operations through the ZFS ARC, right ? Although that there are no disk cache for write operations, FreeBSD probably has a queue (or queues) in the block subsystem for AHCI I/O operations (with SATA 3 for instance). This logical queue can be used to coalesce and/or ord= er I/O commands before draining this queue to submit to the device queue. I don't know if USB 3.0 sticks are mono-queue or multi-queue. I know that SATA has 1 queue with a depth of 32 whereas NVMe has 64k queues with each a depth of 64k. I know that Linux has a page cache (unified for the virtual memory and block devices and so on). Do you think that USB 3.0 works well on Linux because of the page cache tha= t is used for write operations ? I mean, if userspace does not call "sync", then the data can be dirty in ke= rnel space without being written back to the device. That usually makes I/O fast= er. The documentation of "select" says: "to see if some of their descriptors are ready for reading, are ready for writing" --> https://www.freebsd.org/cgi/man.cgi?select Here, select takes 60 seconds to conclude that none of the descriptors are ready. That delay is clearly abnormal. How can I trace what is being called between the select_ENTER and select_EX= IT in FreeBSD ? --=20 You are receiving this mail because: You are the assignee for the bug.=