From owner-svn-src-head@freebsd.org Fri Jul 10 08:31:37 2020 Return-Path: Delivered-To: svn-src-head@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 B73C9363AC9; Fri, 10 Jul 2020 08:31:37 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4B35qY2vtXz4K2m; Fri, 10 Jul 2020 08:31:37 +0000 (UTC) (envelope-from mjguzik@gmail.com) Received: by mail-wr1-x434.google.com with SMTP id r12so4993123wrj.13; Fri, 10 Jul 2020 01:31:37 -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=lh7bGPU8c9s+eFe9uuMTRa9i2HBwixWoNS04ade9yuk=; b=jJCA0uMF2nfBpcYFT7V/i0jtrtLuNdlWv8CF81hfRgyGHW1E4eIWqRX0RjfGfO4gkr yO9fY0vEvJRdg4V/Ecr+Xj+i1UzquFDzc5wpQcjrTbGkNwYSfk7DzL+ITEF6BTj8jtCB vpIPAkPsSEMthd6wuJgm5oY7CJ5Cj2mOM15FfxFRcRZ8EmMjbRr4fd/mdt/X6/I3+rPp 4j+gV06tAEXYqXurPqnTbe6sO1WTpPzHVryVXYSVborYJ8T2G3a7SdzgwrE4FlBMcAV5 8O9LXmQ+bc25o0l31gO+qUvhEYREzZIKfRjeUfpVmYwHu9mMUVtlaW56gAVWESerCVxM O7NQ== 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=lh7bGPU8c9s+eFe9uuMTRa9i2HBwixWoNS04ade9yuk=; b=CgbySZpqXGCB6LcuuAH4siykMAMiOj/MpuFajSKGAuSUO3bmGOqfEdxtI6mA0NgX0M cP5/Rolxt4g6sNdToWW2gYVjE0JE9aAVkr2pOlmrlW48pJxjMVTX/+bmvyqQx56Qb2Eo xpLLg71/NqZ+hIZNBclSI5CDJ0Kh973HXFQs1p1yjS8SDVdCxpmVlJKrIfbTrjof7g1f 46Tv95Yr2ONFmmhVz6qXD/Wk3Bea8lLi7m9dDK9pMcqiWIhjNbtDXgseDfx/X6smJppd FkhL/fHroO6kU3HCEmtz1rdSLRWvgj89MTFHktj/4elv/u9vRE63P48SPyVR3hU+Y5qs B7oQ== X-Gm-Message-State: AOAM532w85z6S4aANzo8GP3krROAsDyw2MlVQ/QgmMVChxMySK/vkIHP pQCs/7djLRg10aU44NPAeBbC2LTigiPnoXE8DhOBLw== X-Google-Smtp-Source: ABdhPJxmEVj79z+ad03JSCmZzdcoPsXgeOBIomFUFB9szWyumTbj/xBHZMz5PfGXa/fbFzew6CeG6ry213gq/QRrJik= X-Received: by 2002:a05:6000:1290:: with SMTP id f16mr41014723wrx.66.1594369895255; Fri, 10 Jul 2020 01:31:35 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:adf:9d84:0:0:0:0:0 with HTTP; Fri, 10 Jul 2020 01:31:34 -0700 (PDT) In-Reply-To: <20200710082549.GC74062@freefall.freebsd.org> References: <202007100646.06A6kgnX015296@repo.freebsd.org> <20200710082549.GC74062@freefall.freebsd.org> From: Mateusz Guzik Date: Fri, 10 Jul 2020 10:31:34 +0200 Message-ID: Subject: Re: svn commit: r363068 - head/sys/kern To: "Piotr P. Stefaniak" Cc: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4B35qY2vtXz4K2m X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US] X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2020 08:31:37 -0000 On 7/10/20, Piotr P. Stefaniak wrote: >> */ >>- memcpy(sbp, &mp->mnt_stat, sizeof(*sbp)); >>+ if (sbp != &mp->mnt_stat) >>+ memcpy(sbp, &mp->mnt_stat, sizeof(*sbp)); >> > > Slightly unrelated question: wouldn't it be prudent to incorporate this > logic into memcpy? > Calls like that are just abusing the routine and indicate design problems in the consumer. Adding the branch into the routine would add overhead for everyone. However, now that you mention it, it may be prudent to do something like this: dtrace -n 'fbt::memcpy:entry,fbt::memmove:entry /arg1 == arg2/ { @[stack()] = count(); }' and run your favourite workload. -- Mateusz Guzik