From owner-freebsd-arch@freebsd.org Sun Nov 15 17:33:31 2020 Return-Path: Delivered-To: freebsd-arch@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 07FC82EEFA6 for ; Sun, 15 Nov 2020 17:33:31 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from out5-smtp.messagingengine.com (out5-smtp.messagingengine.com [66.111.4.29]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4CYznk3lQWz4d26; Sun, 15 Nov 2020 17:33:30 +0000 (UTC) (envelope-from scottl@samsco.org) Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.nyi.internal (Postfix) with ESMTP id E225F5C0120; Sun, 15 Nov 2020 12:33:29 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Sun, 15 Nov 2020 12:33:29 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsco.org; h= content-type:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; s=fm1; bh=O U6DGHtFqHyYMhrLlhEdexUL7R8w92RQ2n45oAN4eXM=; b=sIovS4MzZDc9szg0o NzFpFM8nRfugJbrC7mumv7PfviAD8OKws1rd+vuknPdtgcYH3WzAxplj9Ck1ML9r OwcC0oR7LsKyMPix4TIHf5rw94MXwMSWukQo52Di3PNRxBpOhASIF4oq87fbvc0z OI/lH12iGQM+eQP62alZjBxoJ8w68jWV6M2tPue8TqPRgGd8ZNGwvzG/sHNmPn1+ FSuOaDcrHjbHM56Vk5SiTkGfLMfRAVC2jTxeInSUa9RzEC+kes2XEPlx69gwrw1l KI50ayEM2uWAENRxQnT5KRHJSc68P7E8dQJ7zZQ2jN6XoRxSXgyOoul5e658uGIO R//lQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=OU6DGHtFqHyYMhrLlhEdexUL7R8w92RQ2n45oAN4e XM=; b=eeN3T3l2adZz0QpJcsicyIRs/rsAMsDwTQV0LEK7IUEIqb5Pee0S4RTTR 6kwGWJ9590M+003XaVtG3PRe4J57KzegiiRXTjPEqadAOq6g17xZiD1f9TX5zOHf 2XGJ8TD+QgxOFrt7M/cQQvW6rCLubg2+EefRBKHQJ7M5qLTMWO733a2hdhICgLJo Y6GXpfM8V/q8zJfF5ajMGZOJCshNoFkaySa+osfwFCHmnSVycRlxlRwRv55NWnNg FSkPRa+huFnGhjNGSxpu3rmKVNgRPvQGTJOBrtyUvStQWGI3xiEEapZBJmiSCVnh 6he8XUmwRSVO5UkwMvHRrVLoCWuxQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedruddvledguddthecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurheptggguffhjgffgffkfhfvofesth hqmhdthhdtjeenucfhrhhomhepufgtohhtthcunfhonhhguceoshgtohhtthhlsehsrghm shgtohdrohhrgheqnecuggftrfgrthhtvghrnhepfeejgefgjefhgfdtjeevjeekgeevie elueehjefgudetvefgtdetgffggefgvdegnecukfhppeekrdegiedrkeelrddvudefnecu vehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepshgtohhtth hlsehsrghmshgtohdrohhrgh X-ME-Proxy: Received: from [192.168.0.114] (unknown [8.46.89.213]) by mail.messagingengine.com (Postfix) with ESMTPA id 6DE133280060; Sun, 15 Nov 2020 12:33:29 -0500 (EST) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 13.4 \(3608.120.23.2.4\)) Subject: Re: MAXPHYS bump for FreeBSD 13 From: Scott Long In-Reply-To: Date: Sun, 15 Nov 2020 10:33:28 -0700 Cc: Konstantin Belousov , "freebsd-arch@freebsd.org" Content-Transfer-Encoding: quoted-printable Message-Id: References: <46AB39AF-B09A-4694-AA86-30EC82A1EB9E@samsco.org> To: Alexander Motin X-Mailer: Apple Mail (2.3608.120.23.2.4) X-Rspamd-Queue-Id: 4CYznk3lQWz4d26 X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=samsco.org header.s=fm1 header.b=sIovS4Mz; dkim=pass header.d=messagingengine.com header.s=fm1 header.b=eeN3T3l2; dmarc=none; spf=pass (mx1.freebsd.org: domain of scottl@samsco.org designates 66.111.4.29 as permitted sender) smtp.mailfrom=scottl@samsco.org X-Spamd-Result: default: False [-3.10 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; RCVD_VIA_SMTP_AUTH(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip4:66.111.4.29:c]; MV_CASE(0.50)[]; RWL_MAILSPIKE_GOOD(0.00)[66.111.4.29:from]; RCVD_COUNT_THREE(0.00)[4]; DKIM_TRACE(0.00)[samsco.org:+,messagingengine.com:+]; NEURAL_HAM_SHORT(-1.00)[-1.000]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_TLS_LAST(0.00)[]; ASN(0.00)[asn:11403, ipnet:66.111.4.0/24, country:US]; MID_RHS_MATCH_FROM(0.00)[]; RBL_DBL_DONT_QUERY_IPS(0.00)[66.111.4.29:from]; RCVD_IN_DNSWL_LOW(-0.10)[66.111.4.29:from]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; R_DKIM_ALLOW(-0.20)[samsco.org:s=fm1,messagingengine.com:s=fm1]; FREEFALL_USER(0.00)[scottl]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; NEURAL_HAM_LONG(-1.00)[-1.000]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[samsco.org]; SPAMHAUS_ZRD(0.00)[66.111.4.29:from:127.0.2.255]; TO_MATCH_ENVRCPT_SOME(0.00)[]; FREEMAIL_CC(0.00)[gmail.com,freebsd.org]; MAILMAN_DEST(0.00)[freebsd-arch] X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 15 Nov 2020 17:33:31 -0000 > On Nov 15, 2020, at 10:27 AM, Alexander Motin wrote: >=20 > On 15.11.2020 12:11, Scott Long wrote: >> The MAXPHYS use for AHCI is related to the maximum size of a PRD = needed >> for a command. AHCI specifies that you can have up to 65536 PRD = entries, >> which translates into 2^16 + 2^12 =3D 256MB maximum I/O size. = However, the >> AHCI driver seems inconsistent already in that it defines = AHCI_PRD_MAX=20 >> (via an indirection through AHCI_PRD_MASK) to be 2^22, or 4MB. This = is >> a pretty reasonable max default for AHCI, and I don=E2=80=99t think = we need to jump >> through hoops to make it dynamic or make it larger for the future. = My >> recommendation is to abandon the partial changes you have for AHCI = and >> use AHCI_PRD_MAX in place of MAXPHYS for the structure sizing and for >> the cpi->maxio attribute. >=20 > Scott, AHCI_PRD_MAX is a maximum size of single DMA segment. It does > not limit number of segments, which allows up to 256MB maximum I/O as > you have said. I am already looking on making number of of PRDs > dynamic. It does not look difficult. Though generally yes, the = memory > difference is not big, simply because SATA has maximal queue depth of > only 32 commands. For SAS/FC/NVMe/... it is more interesting. >=20 Sorry, you=E2=80=99re right, I got it backwards when I read the = arguments to bus_dma. Still, 4MB is a pretty reasonable maximum for AHCI, and keeping it = static would avoid extra complexity in the code. Scott