Date: Sat, 5 May 2018 01:12:46 +0200 From: Mateusz Guzik <mjguzik@gmail.com> To: Steven Hartland <steven.hartland@multiplay.co.uk> Cc: Mateusz Guzik <mjg@freebsd.org>, src-committers <src-committers@freebsd.org>, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: Re: svn commit: r333266 - head/sys/amd64/amd64 Message-ID: <CAGudoHFDNLsMxKz9nY%2BvsOm66=7W0gd1-BBwi5ABEwOGiLvDbQ@mail.gmail.com> In-Reply-To: <CAHEMsqbybV8%2BYO2rE8BqbTKspqf_xVGKcH_vKJE-b3NFmuQCDA@mail.gmail.com> References: <201805042241.w44MfC9E090893@repo.freebsd.org> <CAHEMsqbybV8%2BYO2rE8BqbTKspqf_xVGKcH_vKJE-b3NFmuQCDA@mail.gmail.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Sat, May 5, 2018 at 12:58 AM, Steven Hartland < steven.hartland@multiplay.co.uk> wrote: > Can we get the why in commit messages please? > > This sort of message doesnt provide anything more that can be obtained > from reading the diff, which just leaves us wondering why? > > I=E2=80=99m sure there is a good reason, but without confirmation we=E2= =80=99re just left > guessing. The knock on to this is if some assumption that caused the why > changes, anyone looking at this will not be able to make an informed > descision that that was the case. > > bcopy is an equivalent of memmove, i.e. it accepts overlapping buffers. But if we know for a fact they don't overlap (like here), doing this over memcpy (which does not accept such buffers) only puts avoidable constraints on the optimizer. This is a rather pedestrian change which can be made in many places, I don't see the point of repeating the explanation in each one. Although I guess it would make sense to point at a specific commit which explains things. > On Fri, 4 May 2018 at 23:41, Mateusz Guzik <mjg@freebsd.org> wrote: > >> Author: mjg >> Date: Fri May 4 22:41:12 2018 >> New Revision: 333266 >> URL: https://svnweb.freebsd.org/changeset/base/333266 >> >> Log: >> amd64: syscall path bcopy -> memcpy >> >> Modified: >> head/sys/amd64/amd64/trap.c >> >> Modified: head/sys/amd64/amd64/trap.c >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D >> --- head/sys/amd64/amd64/trap.c Fri May 4 22:33:54 2018 (r333265= ) >> +++ head/sys/amd64/amd64/trap.c Fri May 4 22:41:12 2018 (r333266= ) >> @@ -908,7 +908,7 @@ cpu_fetch_syscall_args(struct thread *td) >> error =3D 0; >> argp =3D &frame->tf_rdi; >> argp +=3D reg; >> - bcopy(argp, sa->args, sizeof(sa->args[0]) * 6); >> + memcpy(sa->args, argp, sizeof(sa->args[0]) * 6); >> if (sa->narg > regcnt) { >> KASSERT(params !=3D NULL, ("copyin args with no params!"= )); >> error =3D copyin(params, &sa->args[regcnt], >> >> --=20 Mateusz Guzik <mjguzik gmail.com>
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAGudoHFDNLsMxKz9nY%2BvsOm66=7W0gd1-BBwi5ABEwOGiLvDbQ>