From owner-svn-src-all@freebsd.org Fri May 4 23:12:48 2018 Return-Path: Delivered-To: svn-src-all@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 3190FFBAEB4; Fri, 4 May 2018 23:12:48 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-qk0-x243.google.com (mail-qk0-x243.google.com [IPv6:2607:f8b0:400d:c09::243]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G2" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id B8DA987202; Fri, 4 May 2018 23:12:47 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-qk0-x243.google.com with SMTP id p186so17914184qkd.1; Fri, 04 May 2018 16:12:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=DI7Me33TWwo7wA+idU3CooCTWjKnTbqrWX2tDhp2gfE=; b=p9RmOLbmg3SUFhhT3gb1rOB/LPitsK6PZSyOAiXcqgC/suHnZm7nnn/fjSoocKMUqX /T1M/7JWslKzlxb1VIvJFTjvpu1HDEuUcDBenr4gognw9AhOV5NzDqovAgqA9ayQFKoU wHe0TyMUgK7NeS+leLfuWvy5NroDplrl4/jwkd2tRiTkXvpDWk0dnDMYNTNyIEERRN/j sc1ZQCVrlZS/euK6+K+JJFcdGVtD3NsTv1aVNjU9RbnXkclZ35GLywCb3oRAXSGJoPDQ B3YaSAzDJsRMvUOVKUNhorLVzAK4JLWtiKeghVqhCUEZQ+65ah4lnzF3co32uAvDypzb CVYA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=DI7Me33TWwo7wA+idU3CooCTWjKnTbqrWX2tDhp2gfE=; b=pUUI/K3Vt12sv337E9KvAZZW+2Z0x9Sj4ZM5trcw4rDh/6zj8e/4iZh+MhC3ZEqCJk P2adoeOO2Y7qpClNvxuGoIy0D6DmyyvpgNzKt3VMq1eo3R+/zHrvaDIIPhuj9l99jj58 begMRYuuV+jZPZuGvkkBdKvtN9nmWt5hRrUKIEGctjgbYc5jnOHr0qN8HNPTAdKtDqlM oso0Rlj/+RIP/N+ZV921i6YuY5EAb+qXaGi1snMDmEPfYqbtfr9GCAHGyTa3GsdgUs6U rzdr5voVIQVk0t6LrzmTefKQvC68uLfWqWJDSrAUe02FlZ8RUQOwmKUS2+qitKycOQc7 DtjQ== X-Gm-Message-State: ALQs6tBnSDaGqx2ijwo9/t5T7GdH4fXWvja92rxw+54AakV6eNrVWF5l kTEjFMCxUAsnQ/FCGNCBCZzNff5HVCOJzkVkSNc= X-Google-Smtp-Source: AB8JxZrvDN/zzdPqZgySTwMY9NITdPN8TBprPReglysGr0MY/lbKPQJDiGTQWJT/k9mx0PpGAsY9foliG5VhVi3u8Po= X-Received: by 10.55.147.66 with SMTP id v63mr24993686qkd.40.1525475567356; Fri, 04 May 2018 16:12:47 -0700 (PDT) MIME-Version: 1.0 Received: by 10.200.28.74 with HTTP; Fri, 4 May 2018 16:12:46 -0700 (PDT) In-Reply-To: References: <201805042241.w44MfC9E090893@repo.freebsd.org> From: Mateusz Guzik Date: Sat, 5 May 2018 01:12:46 +0200 Message-ID: Subject: Re: svn commit: r333266 - head/sys/amd64/amd64 To: Steven Hartland Cc: Mateusz Guzik , src-committers , svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.25 X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.25 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 04 May 2018 23:12:48 -0000 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 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