From owner-freebsd-hackers@freebsd.org Thu Jan 9 22:37:43 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 0D5831FBAA6 for ; Thu, 9 Jan 2020 22:37:43 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-QB1-obe.outbound.protection.outlook.com (mail-qb1can01on0623.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe5c::623]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "mail.protection.outlook.com", Issuer "GlobalSign Organization Validation CA - SHA256 - G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 47v1GF4lJdz3L9t; Thu, 9 Jan 2020 22:37:41 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=S3UFLsUu2he4Rccxy+D1SzE14wWzY2h2EEi8cT79y0Gg743C3QMShke7+EXyT3b2/CII/VYhwu5n376WaGmSmMk1THGwJnfvoRcuIG+zksd6K2FtA+DH4sp4AU2bfjJDz69VgPVYONa5p4yOCDVHw09e0GGwfGTgaDWj/L16ZkjNhc2DUeDiV3MbibK3uwm35QHLWYDILiAhfsvAThcVdJpgzXGsZLpUe/NYqGqXx3BgoK2eWOW1obtoWJXjBEpAn9zNYqBYd99Ld43EYTaksD1zoqvQa/t8y9bn80EASHdn0epGslt/y1UDpbFQNDIe0uZXWKh3/w1SPzG/timpBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=BwZZAzhKh+S7FnaamfUcpyG6VFdo6cgRxtX/nFQ3KpI=; b=IHclqP2phytv1ohx4awdzTYMJtlllwibIQZPQ2T7EEIbNzS/ES8iN3IjDhky9DpgVSeIJ0NN6Fc2RurmZB8M1sWNox20sNvnuysx+NXCYTIbi7HNEu81OKmGytx40A96iK0jGIIIXFC/gIOhfKNuqGJQbiCDZkpDtxdzJA1avHmuB0TzD1cqyDI5P6StS870lLKS2yYHKOEPuYk6X0xd0G9SnYaNvJNs8ehyvx2tvZm5NWF/zLxeW1m9eaqWcWTBYLDcpbjanRVh5KNSwrbgQfLL/fJ3zIqeo3DQNlj4ZSeJPqyBACgqcMU5WF1cyeufwt9ffqJdj9vGbNqfGgR1yQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=uoguelph.ca; dmarc=pass action=none header.from=uoguelph.ca; dkim=pass header.d=uoguelph.ca; arc=none Received: from YQBPR0101MB1427.CANPRD01.PROD.OUTLOOK.COM (52.132.69.153) by YQBPR0101MB1714.CANPRD01.PROD.OUTLOOK.COM (52.132.67.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2602.10; Thu, 9 Jan 2020 22:37:39 +0000 Received: from YQBPR0101MB1427.CANPRD01.PROD.OUTLOOK.COM ([fe80::7512:8580:8d82:6c94]) by YQBPR0101MB1427.CANPRD01.PROD.OUTLOOK.COM ([fe80::7512:8580:8d82:6c94%6]) with mapi id 15.20.2602.018; Thu, 9 Jan 2020 22:37:39 +0000 From: Rick Macklem To: Warner Losh , Peter Jeremy CC: Gary Jennejohn , Hans Petter Selasky , Conrad Meyer , "freebsd-hackers@freebsd.org" , Wojciech Puchar , Konstantin Belousov Subject: Re: maximum MAXBSIZE Thread-Topic: maximum MAXBSIZE Thread-Index: AQHVxZ9FBsxnSDZEj0us27plJrH9YKfftkgAgAAWuIiAAk5fk4AAR5AAgAAB+ICAABdxgIAAVQyAgAAG1ICAABWsiQ== Date: Thu, 9 Jan 2020 22:37:39 +0000 Message-ID: References: <20200108105136.0d54ebce@ernst.home> <20200108141810.GX23031@kib.kiev.ua> <20200109164519.33fc7478@ernst.home> <20200109204943.GC25924@server.rulingia.com>, In-Reply-To: Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: efeeb2bf-b15b-4dfd-393c-08d79554884e x-ms-traffictypediagnostic: YQBPR0101MB1714: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 02778BF158 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(346002)(396003)(366004)(39860400002)(376002)(189003)(199004)(76116006)(66556008)(66946007)(86362001)(64756008)(66446008)(186003)(66476007)(91956017)(9686003)(316002)(786003)(81166006)(7116003)(26005)(8676002)(54906003)(71200400001)(110136005)(81156014)(52536014)(55016002)(4326008)(478600001)(3480700007)(8936002)(7696005)(2906002)(5660300002)(33656002)(6506007); DIR:OUT; SFP:1101; SCL:1; SRVR:YQBPR0101MB1714; H:YQBPR0101MB1427.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: bvkiJ6beKQ/SJk05Mqi5q2aUkdJX46kbediJIg1d9svwGUnhuflEJewEykiRWbwtI6G0qWyxrhy4Yqna1+vqEPwxetvdlItpqfprNTQxTaEHbgvzIz2sAXlNxa1vlJRzp/wf5lsUYu6oJf2/belUlt7frjxu0Cp67G8/c49J7Ypzw0n+PrtECmOGpmMLcU45Yreh+5e/MnkhTVe/HcuYiBNEtiuaIiiNcjbBommh100Rvgf4oPncNk8Z58enKg2ATr4YIYHFViGB9+OP9xDTSQ9ZsYVavnBX5w2yraFi5JPxBcAaol5YDkepuvgd1sX9PprqBflT+BZJf5d1qKC4Z4d8eRPmnDpTs+JQfvNJygeJm/3AMGf423IggdwHUPCPr2bCLqVXhKCj3CNlm4Gv3o35HdlEUn7BtUZYgRxh8GcKV9LPOGL2b5anCNxJgzQZ x-ms-exchange-transport-forked: True Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: uoguelph.ca X-MS-Exchange-CrossTenant-Network-Message-Id: efeeb2bf-b15b-4dfd-393c-08d79554884e X-MS-Exchange-CrossTenant-originalarrivaltime: 09 Jan 2020 22:37:39.1404 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: be62a12b-2cad-49a1-a5fa-85f4f3156a7d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: CHA39a/6fz8wZFS9vk1BBzsqm3d3Lis/r7xEHt5yKAEIVPHp4DE6OtDh6lrlGvITWQPkF0WOUZ6djhV3NIMt3A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: YQBPR0101MB1714 X-Rspamd-Queue-Id: 47v1GF4lJdz3L9t X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=none; spf=pass (mx1.freebsd.org: domain of rmacklem@uoguelph.ca designates 2a01:111:f400:fe5c::623 as permitted sender) smtp.mailfrom=rmacklem@uoguelph.ca X-Spamd-Result: default: False [-4.65 / 15.00]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; FROM_HAS_DN(0.00)[]; TO_DN_SOME(0.00)[]; R_SPF_ALLOW(-0.20)[+ip6:2a01:111:f400::/48]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; DMARC_NA(0.00)[uoguelph.ca]; RCVD_COUNT_THREE(0.00)[3]; TO_MATCH_ENVRCPT_SOME(0.00)[]; RCPT_COUNT_SEVEN(0.00)[8]; IP_SCORE(-1.35)[ipnet: 2a01:111:f000::/36(-3.72), asn: 8075(-2.99), country: US(-0.05)]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8075, ipnet:2a01:111:f000::/36, country:US]; ARC_ALLOW(-1.00)[i=1]; FREEMAIL_CC(0.00)[gmail.com] 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: Thu, 09 Jan 2020 22:37:43 -0000 Warner Losh wrote:=0A= >On Thu, Jan 9, 2020 at 1:55 PM Peter Jeremy > wrote:=0A= >On 2020-Jan-09 16:45:19 +0100, Gary Jennejohn > wrote:=0A= >>On Thu, 9 Jan 2020 15:21:25 +0100 (CET)=0A= >>Wojciech Puchar > wrote:=0A= >>> why FreeBSD default is so completely wrong for modern hardware?=0A= >>>=0A= >>> i think 4MB is OK for HDDs, more may be optimal for RAID5 arrays.=0A= >>=0A= >>POLA (principle of least amazement). I certainly don't need a MAXPHYS se= t=0A= >>to 4MB on my desktop machine.=0A= >=0A= >What are the downsides of running with MAXPHYS set to 4MB (or similar)?=0A= >=0A= >There's two issues. One, it makes every buf and bio 32 times larger.=0A= >Second, there's a lot of drivers that say their max I/O size is MAXPHYS wh= en 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 th= roughput).=0A= >=0A= >> Not everyone using FreeBSD is running=0A= >>servers with large amounts of memory and disk storage.=0A= >=0A= >Actually, I disagree with this statement. MAXPHYS on x86 was doubled from= =0A= >64KB to 128KB in r32724 - 22 years ago. A small, embedded system today ha= s=0A= >more RAM than a decent server had disk space then. I think we are well=0A= >overdue for an examination of many of the kernel parameters to take into= =0A= >account that a "typical" user machine today has 3 orders of magnitude more= =0A= >RAM, disk and performance than it had when most of the kernel parameters= =0A= >were last tweaked.=0A= >=0A= >Likely 1MB is the right place to have MAXPHYS for most people these days..= .. But there's a >number of other parameters to tweak, and likely a few bug= s to hunt...=0A= >=0A= >>It's a trivial change if it's beneficial in a certain use scenario. The= =0A= >>decision should be left up to the user.=0A= >=0A= >Actually, I suspect it would benefit most typical use cases - even an=0A= >average desktop machine does for more I/O than when the values were last= =0A= >set. Also, adjusting it isn't quite that easy - it's a compile-time=0A= >constant so a user has to build their own kernel and the Project is trying= =0A= >to get away from requiring users to build from source.=0A= >=0A= >And, before someone starts, the "it will hurt embedded systems" argument= =0A= >isn't a good reason for keeping the status quo for two main reasons:=0A= One thought here is to move them to machine/param.h, so they can be=0A= set to different defaults for different arches.=0A= =0A= rick=0A= [stuff snipped]=0A= =0A= Warner=0A=