From owner-freebsd-current@freebsd.org Fri Jul 5 15:11:28 2019 Return-Path: Delivered-To: freebsd-current@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 3F04915CD3EC for ; Fri, 5 Jul 2019 15:11:28 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from CAN01-TO1-obe.outbound.protection.outlook.com (mail-eopbgr670055.outbound.protection.outlook.com [40.107.67.55]) (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 497B57387B; Fri, 5 Jul 2019 15:11:26 +0000 (UTC) (envelope-from rmacklem@uoguelph.ca) Received: from YTXPR01MB0285.CANPRD01.PROD.OUTLOOK.COM (10.165.219.7) by YTXPR01MB0287.CANPRD01.PROD.OUTLOOK.COM (10.165.219.9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2052.16; Fri, 5 Jul 2019 15:11:25 +0000 Received: from YTXPR01MB0285.CANPRD01.PROD.OUTLOOK.COM ([fe80::9cc8:c3b7:19c2:7baf]) by YTXPR01MB0285.CANPRD01.PROD.OUTLOOK.COM ([fe80::9cc8:c3b7:19c2:7baf%4]) with mapi id 15.20.2032.022; Fri, 5 Jul 2019 15:11:25 +0000 From: Rick Macklem To: Alan Somers CC: "freebsd-current@FreeBSD.org" , "kib@freebsd.org" Subject: Re: test program for copy_file_range(2) Thread-Topic: test program for copy_file_range(2) Thread-Index: AQHVMskgzujQNZ0SzEiZ5jXklpLAx6a8FweAgAAJc4g= Date: Fri, 5 Jul 2019 15:11:25 +0000 Message-ID: References: , 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: 20945e27-5771-482c-e012-08d7015b0c5b x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328)(7193020); SRVR:YTXPR01MB0287; x-ms-traffictypediagnostic: YTXPR01MB0287: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:10000; x-forefront-prvs: 008960E8EC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(376002)(136003)(366004)(396003)(199004)(189003)(68736007)(14454004)(52536014)(476003)(74482002)(99286004)(6506007)(486006)(256004)(14444005)(5024004)(2906002)(478600001)(316002)(5660300002)(7696005)(76176011)(786003)(186003)(53936002)(55016002)(86362001)(33656002)(4326008)(9686003)(71190400001)(71200400001)(74316002)(6916009)(66946007)(305945005)(6246003)(73956011)(81156014)(54906003)(81166006)(76116006)(8676002)(102836004)(46003)(8936002)(25786009)(450100002)(11346002)(6436002)(229853002)(64756008)(446003)(66476007)(66556008)(66446008); DIR:OUT; SFP:1101; SCL:1; SRVR:YTXPR01MB0287; H:YTXPR01MB0285.CANPRD01.PROD.OUTLOOK.COM; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: uoguelph.ca does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: maLqU1wgJzSgYsskIghg810VUTJoyQREuMefv+iw/psSyMJdFKUnyHDEPugyJ4iaF+VEc1+h53j+Wj2BEKbm58gHF3JN2/FhqHslfsxFmU4cCllsfIcIqqNUTuILPy7LO8oIJI5AdBEQ3gMHIRi29uil3zkS5ZDhj8YxCUyJvZhyw/8KA45rzA9vnoJ9LiOgdhGQgXaxeKGcKAKPknEWPj18BvC93K3306HWGMIHS6R0MJI3/dEylPamdEIhX31EH77G4UI2oF9meUm2zy91WLLXoEFOvgm0r+kK8d4UVNIRP1yM7gUPYSvbE1MLNrUle0cnomA9OALvZPYteDTsL0sbVkRwepEJihvi+2AJ0IRmyU7S5xVzvn+B0iQJHKOj4eN/XREQXkGuICaigi0RJuINbHMSJFkeO5qa/2KTNzY= 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: 20945e27-5771-482c-e012-08d7015b0c5b X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Jul 2019 15:11:25.5752 (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: rmacklem@uoguelph.ca X-MS-Exchange-Transport-CrossTenantHeadersStamped: YTXPR01MB0287 X-Rspamd-Queue-Id: 497B57387B X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; spf=pass (mx1.freebsd.org: domain of rmacklem@uoguelph.ca designates 40.107.67.55 as permitted sender) smtp.mailfrom=rmacklem@uoguelph.ca X-Spamd-Result: default: False [-3.98 / 15.00]; ARC_NA(0.00)[]; TO_DN_EQ_ADDR_SOME(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-0.999,0]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; R_SPF_ALLOW(-0.20)[+ip4:40.107.0.0/16]; TO_MATCH_ENVRCPT_ALL(0.00)[]; MIME_GOOD(-0.10)[text/plain]; DMARC_NA(0.00)[uoguelph.ca]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; RCVD_COUNT_THREE(0.00)[3]; IP_SCORE(-1.03)[ipnet: 40.64.0.0/10(-2.89), asn: 8075(-2.19), country: US(-0.06)]; MX_GOOD(-0.01)[cached: mx2.hc184-76.ca.iphmx.com]; NEURAL_HAM_SHORT(-0.64)[-0.644,0]; RCVD_IN_DNSWL_NONE(0.00)[55.67.107.40.list.dnswl.org : 127.0.3.0]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; ASN(0.00)[asn:8075, ipnet:40.64.0.0/10, country:US]; RCVD_TLS_LAST(0.00)[] X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 05 Jul 2019 15:11:28 -0000 Alan Somers wrote: >On Thu, Jul 4, 2019 at 6:38 PM Rick Macklem wrote: >> >> I have a little program for testing the copy_file_range(2) syscall I've = been >> working on. (The current version is attached, in case anyone is interest= ed.) >> >> It take a few minutes to run on a slow system and uses about 6Gbytes of = disk >> space for the file system the output file is on. (It creates 2 files to = use for testing. >> The first one is sparse and the second is copied from it, but grows as d= ifferent byte >> ranges get copied, since "punching holes" is done via writes of 0 bytes.= ) >> >> My question is.. >> What needs to be done to include this in FreeBSD? >> I see some stuff under head/tests. I could probably figure out >> what the macros in those files are, but I can only see tests to see if >> arguments are valid and similar. As such, I'm not sure if this is the co= rrect >> place for a test like this? >> >> Thanks for any help with this, rick > >head/tests is for complete automated tests, mostly in ATF format. >Your program sounds more like the kind of helper program that might be >more suitable for head/tools/regression. Those programs all require >some operator interaction. If you can automate your program then we >should add it to head/tests/sys. Does it really need 6GB to get >decent test coverage? Well, I wanted the input file to exceed 4Gb and to have a > 4Gb hole in it,= to catch 32bit bugs (I test on i386). This did catch some problems during testing. Then, the program copies (random) ranges of the file to a second file. If t= he random copy is done over the "big hole" for the case where it hasn't truncated the= output file (every second iteration), then it writes a "lot of 0s", growing the ou= tput file up to 6Gb of data. I could limit the "random" ranges to not copy the "big hole", but that woul= d avoid testing that case. rick