Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 2 Jan 2021 17:06:05 +0000
From:      Rick Macklem <rmacklem@uoguelph.ca>
To:        Alan Somers <asomers@freebsd.org>, Matthias Apitz <guru@unixarea.de>, FreeBSD CURRENT <freebsd-current@freebsd.org>
Cc:        Konstantin Belousov <kib@FreeBSD.org>, Kirk McKusick <mckusick@mckusick.com>
Subject:   Re: cp(1) of large files is causing 100% CPU utilization and poor transfer
Message-ID:  <YQXPR0101MB0968022D574AA673BB80DEC6DDD40@YQXPR0101MB0968.CANPRD01.PROD.OUTLOOK.COM>
In-Reply-To: <CAOtMX2iRS6XVLkABSMQdcDCUHRXhEHEjyzuOqkMHudK=he33GA@mail.gmail.com>
References:  <X/CKQFbpbWDdLXvw@c720-r368166.fritz.box> <CAOtMX2gd6vaBF=6Z6stefGRN8A7S4Gtf4drO-YgAbd=KXPwKNg@mail.gmail.com> <X/CY/kuKUJHUVEbB@c720-r368166.fritz.box> <CAOtMX2hFupzf-MD84eo_-n9OzfYX6b6tWRsHPECZGKaq5QCUVw@mail.gmail.com> <X/CbUu4tVQG81ItJ@c720-r368166.fritz.box>, <CAOtMX2iRS6XVLkABSMQdcDCUHRXhEHEjyzuOqkMHudK=he33GA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
Just fyi, I've reproduced the problem.=0A=
All I did was create a 20Gbyte file=0A=
on UFS on a slow (4Gbyte or RAM,=0A=
slow spinning disk) laptop.=0A=
(The UFS file system is just what the installer creates these days.)=0A=
=0A=
cp still hasn't finished and is definitely=0A=
taking a looott longer than dd did.=0A=
=0A=
I'll start drilling down later to-day.=0A=
=0A=
I'll admit doing lots of testing of copy_file_range(2)=0A=
with large sparse files, but I may have missed testing=0A=
a large non-sparse file.=0A=
=0A=
rick=0A=
ps: I've added Kostik and Kirk to the cc.=0A=
=0A=
=0A=
________________________________________=0A=
From: owner-freebsd-current@freebsd.org <owner-freebsd-current@freebsd.org>=
 on behalf of Alan Somers <asomers@freebsd.org>=0A=
Sent: Saturday, January 2, 2021 11:30 AM=0A=
To: Matthias Apitz; FreeBSD CURRENT=0A=
Subject: Re: cp(1) of large files is causing 100% CPU utilization and poor =
transfer=0A=
=0A=
CAUTION: This email originated from outside of the University of Guelph. Do=
 not click links or open attachments unless you recognize the sender and kn=
ow the content is safe. If in doubt, forward suspicious emails to IThelp@uo=
guelph.ca=0A=
=0A=
=0A=
On Sat, Jan 2, 2021 at 9:12 AM Matthias Apitz <guru@unixarea.de> wrote:=0A=
=0A=
> El d=EDa s=E1bado, enero 02, 2021 a las 09:06:24a. m. -0700, Alan Somers=
=0A=
> escribi=F3:=0A=
>=0A=
> > > As I said, it can be reproduced using only the local file system. Thi=
s=0A=
> > > was setup recently on a SSD:=0A=
> > >=0A=
> > > # dmesg | grep ada0=0A=
> > > ada0 at ahcich0 bus 0 scbus0 target 0 lun 0=0A=
> > > ada0: <TS512GMTS430S R0906A> ACS-2 ATA SATA 3.x device=0A=
> > > ada0: Serial Number F995890846=0A=
> > > ada0: 600.000MB/s transfers (SATA 3.x, UDMA6, PIO 1024bytes)=0A=
> > > ada0: Command Queueing enabled=0A=
> > > ada0: 488386MB (1000215216 512 byte sectors)=0A=
> > >=0A=
> > > and by this procedure:=0A=
> > >=0A=
> > > # gpart create -s gpt ada0=0A=
> > > # gpart add -t freebsd-boot -s 512k -a4k -l ssdboot ada0=0A=
> > > # gpart bootcode -b /boot/pmbr -p /boot/gptboot -i1 ada0=0A=
> > > # gpart add -t freebsd-ufs -l ssdrootfs -b 1m -s 2g ada0=0A=
> > > # gpart add -t freebsd-ufs -l ssdvarfs -a 1m -s 2g ada0=0A=
> > > # gpart add -t freebsd-ufs -l ssdusrfs -a 1m ada0=0A=
> > > # newfs -U -t /dev/gpt/ssdrootfs=0A=
> > > # newfs -U -t /dev/gpt/ssdvarfs=0A=
> > > # newfs -U -t /dev/gpt/ssdusrfs=0A=
> > >=0A=
> > > # gpart show -l ada0=0A=
> > > =3D>        40  1000215136  ada0  GPT  (477G)=0A=
> > >           40        1024     1  ssdboot  (512K)=0A=
> > >         1064         984        - free -  (492K)=0A=
> > >         2048     4194304     2  ssdrootfs  (2.0G)=0A=
> > >      4196352     4194304     3  ssdvarfs  (2.0G)=0A=
> > >      8390656    16777216     4  ssdswap  (8.0G)=0A=
> > >     25167872   975046656     5  ssdusrfs  (465G)=0A=
> > >   1000214528         648        - free -  (324K)=0A=
> > >=0A=
> > > # mount -t ufs=0A=
> > > /dev/gpt/ssdrootfs on / (ufs, local, soft-updates)=0A=
> > > /dev/gpt/ssdvarfs on /var (ufs, local, soft-updates)=0A=
> > > /dev/gpt/ssdusrfs on /usr (ufs, local, soft-updates)=0A=
> > >=0A=
> > > When I run in the /usr fs the command=0A=
> > >=0A=
> > > # cp -p guru-20210102.tar.gz xxx=0A=
> > >=0A=
> > > it copies around 168M per minute.=0A=
> > >=0A=
>=0A=
> > Is that copying from /usr to /usr, or from /usr to /var or /?=0A=
>=0A=
> # cd /home/backups=0A=
> # cp -p guru-20210102.tar.gz xxx=0A=
>=0A=
> i.e. from /usr to /usr.=0A=
>=0A=
>         matthias=0A=
>=0A=
=0A=
Ok, let's narrow this down.  Could you please run the command with the=0A=
attached D script ?=0A=
sudo dtrace -s copy_file_range.d -c "cp -p guru-20210102.tar.gz xxx"=0A=
_______________________________________________=0A=
freebsd-current@freebsd.org mailing list=0A=
https://lists.freebsd.org/mailman/listinfo/freebsd-current=0A=
To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org"=
=0A=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?YQXPR0101MB0968022D574AA673BB80DEC6DDD40>