From owner-freebsd-hackers@freebsd.org Fri Jan 10 08:32:51 2020 Return-Path: Delivered-To: freebsd-hackers@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 B172F1E014A for ; Fri, 10 Jan 2020 08:32:51 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: from mail-wm1-x341.google.com (mail-wm1-x341.google.com [IPv6:2a00:1450:4864:20::341]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47vGSy1hYbz4LWB for ; Fri, 10 Jan 2020 08:32:50 +0000 (UTC) (envelope-from gljennjohn@gmail.com) Received: by mail-wm1-x341.google.com with SMTP id 20so1003064wmj.4 for ; Fri, 10 Jan 2020 00:32:50 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:in-reply-to:references:reply-to :mime-version:content-transfer-encoding; bh=j8ArpeoqO3WcpXMGwJIdtbBfLFhn9lmJQOis8qiSV+o=; b=HcOhBDnB77vggC5+BQ15CtG/TxORyRiqPYhKmzO9hVgMwux9E+bqes0RHys/TWt4RJ hgWoKMP1vBBkVCB4tb/1S1zS8XDsHH0dXOMUzrcR9foSsit+m1+bt4vCjggaMymxea49 GWO4PvDJmAkDoUQXa0Iw9nrqskRb2Sz3H49UvFMwDS9jxGTstB+/Vzrd12BEhwtR9uYE 6JNHHSlfmXcEadCmMsurc8pZPbdYEl/WqVCdYDIUY3vqgmQ4L00nz23/emIeVHFwlIwY NHjIcrTGnAUGf6jhLNWaCrpmtSLfF0AS2gsQNEANS0So/PtvT8C8DOdOAxkESI7vCXG5 Gj/g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:subject:message-id:in-reply-to :references:reply-to:mime-version:content-transfer-encoding; bh=j8ArpeoqO3WcpXMGwJIdtbBfLFhn9lmJQOis8qiSV+o=; b=mhlooiAtHD4Qgr5ozmYt+Hj9H1ObU86XDwURA5RWqmyskbfHSyYFzCMYdE1iWVXbvf tzbzlQXuXzbnfSRVlkpE55zxgOTiZ8ZxcULqAI1OAIpiP8oGHJAiyFIBSXUnyG3DZMLl kWxTMUK0D4+kefH0Eyy/4dLfwTw6vOcX2kVfuDIpQJxFuBDEhsOqPzRhyFPBX+vjKtzl /vcZz29jOrSnThRItTqEKplvZXIZS9xTZpbXmSo6O+cOy74CrmJPKLKhQMzzA8Ri5MaG ZAT8H/vBKryV0nlUHuDxvgOkwXEG5G8/I/I6jXP9SfCQWMgeyqSfSg/IEH5LgWfCIMQp PQEg== X-Gm-Message-State: APjAAAUWUA49aLdPPuDvKO9eZc3p5LFCaNFryHrHde9QDjLqDB0DXxPC u7rk20Us9HTN3AjHOOlHukwtWEjr X-Google-Smtp-Source: APXvYqyY8hvS87VzfoyK3O7NOo7XjdvT37WUWaHgH0aOJualXObTDSZOY3vFO7uIAwuHjwPjww+91g== X-Received: by 2002:a1c:5f8a:: with SMTP id t132mr2781022wmb.162.1578645167479; Fri, 10 Jan 2020 00:32:47 -0800 (PST) Received: from ernst.home (pD9E235CE.dip0.t-ipconnect.de. [217.226.53.206]) by smtp.gmail.com with ESMTPSA id q3sm1311485wmj.38.2020.01.10.00.32.46 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 10 Jan 2020 00:32:46 -0800 (PST) Date: Fri, 10 Jan 2020 09:32:45 +0100 From: Gary Jennejohn To: "freebsd-hackers@freebsd.org" Subject: Re: maximum MAXBSIZE Message-ID: <20200110093245.1d11d175@ernst.home> In-Reply-To: References: <20200108105136.0d54ebce@ernst.home> <20200108141810.GX23031@kib.kiev.ua> <20200109164519.33fc7478@ernst.home> <20200109204943.GC25924@server.rulingia.com> Reply-To: gljennjohn@gmail.com X-Mailer: Claws Mail 3.17.4 (GTK+ 2.24.32; amd64-portbld-freebsd13.0) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: 47vGSy1hYbz4LWB X-Spamd-Bar: -- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=HcOhBDnB; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of gljennjohn@gmail.com designates 2a00:1450:4864:20::341 as permitted sender) smtp.mailfrom=gljennjohn@gmail.com X-Spamd-Result: default: False [-3.00 / 15.00]; RCVD_VIA_SMTP_AUTH(0.00)[]; HAS_REPLYTO(0.00)[gljennjohn@gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; FREEMAIL_FROM(0.00)[gmail.com]; REPLYTO_ADDR_EQ_FROM(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RECEIVED_SPAMHAUS_PBL(0.00)[206.53.226.217.khpj7ygk5idzvmvt5x4ziurxhy.zen.dq.spamhaus.net : 127.0.0.10]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; FREEMAIL_REPLYTO(0.00)[gmail.com]; PREVIOUSLY_DELIVERED(0.00)[freebsd-hackers@freebsd.org]; IP_SCORE_FREEMAIL(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; IP_SCORE(0.00)[ip: (2.63), ipnet: 2a00:1450::/32(-2.61), asn: 15169(-1.85), country: US(-0.05)]; RCVD_IN_DNSWL_NONE(0.00)[1.4.3.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; TO_DN_EQ_ADDR_ALL(0.00)[]; RCVD_TLS_ALL(0.00)[] X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jan 2020 08:32:51 -0000 On Thu, 9 Jan 2020 14:14:09 -0700 Warner Losh wrote: > On Thu, Jan 9, 2020 at 1:55 PM Peter Jeremy wrote: > > > On 2020-Jan-09 16:45:19 +0100, Gary Jennejohn > > wrote: > > >On Thu, 9 Jan 2020 15:21:25 +0100 (CET) > > >Wojciech Puchar wrote: > > >> why FreeBSD default is so completely wrong for modern hardware? > > >> > > >> i think 4MB is OK for HDDs, more may be optimal for RAID5 arrays. > > > > > >POLA (principle of least amazement). I certainly don't need a MAXPHYS set > > >to 4MB on my desktop machine. > > > > What are the downsides of running with MAXPHYS set to 4MB (or similar)? > > > > There's two issues. One, it makes every buf and bio 32 times larger. > Second, there's a lot of drivers that say their max I/O size is MAXPHYS > when really they mean max(128k,MAXPHYS). Newer hardware is better about it, > but not perfect (I had to fix a NVMe bug because the format of SG lists we > used is limited to 4k which means our NVMe driver can't do more than 1MB > I/Os). DFLTPHYS also needs to be raised. There are (or were) some drivers > in the tree that bogusly used DFLTPHYS as the maximum I/O, though I think I > caught all of those. And once you bump MAXPHYS, there's other limits you'll > run into with fast SSDs/NVMe drives (like runningbufs limiting write > throughput). > [I reduced the Cc: list] Not just storage drivers use MAXPHYS. All of the attempts at porting the rtsx SD controller driver from OpenBSD use MAXPHYS. That's due to the OpenBSD code using it; but MAXPHYS on OpenBSD is only 64KiB. It would definitely be a POLA violation if MAXPHYS were suddenly set to e.g. 1MiB. Assuming we ever get the DMA to work. -- Gary Jennejohn