From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id 50176A0547; Mon, 24 May 2021 20:13:37 +0200 (CEST) Received: from [217.70.189.124] (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 0EC394003E; Mon, 24 May 2021 20:13:37 +0200 (CEST) Received: from mail-ed1-f49.google.com (mail-ed1-f49.google.com [209.85.208.49]) by mails.dpdk.org (Postfix) with ESMTP id 919204003C for ; Mon, 24 May 2021 20:13:35 +0200 (CEST) Received: by mail-ed1-f49.google.com with SMTP id o5so24061729edc.5 for ; Mon, 24 May 2021 11:13:35 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to; bh=0A5cO6epMxkuaYquezxcvfmVFNBM/zAd3YJkzC6I4PA=; b=snPIzS6IzqUj/PQk0Yk8Ol78UPp67x02T4fWaQgOWV+Ti9hy6CsE4WNQ+6R8wOXtEw abVCQYJ7KlJIbDKx+2is72/rAusWbqa4l7hAzZiA51lio2cKXcv/RRDMePcs76GmZKZf lMYHpvVPp924I8VJNNMlKC2K+DrQlCcRAvM7E4cTZ3XqF88+N9E5UjE0AtKM7dH7td0t kPx29GMN7qRR8cEDvjDBIMyI87qSJ2Flc0BlLF1Pc/AXnB7iz3s9h9Ah7RxfPNZATHPA yG716rJNq78bpst9R/aMC3GyXfxOmCEng/2l3ulXKKsRDbxseLer/mpP7iKIBNKkTHTt BsCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=0A5cO6epMxkuaYquezxcvfmVFNBM/zAd3YJkzC6I4PA=; b=FK26cd8iwZN1zNBtnwmXGjWMachMq1C9NcSxfJ2LcRqg16hhKw9DGRRzhQekaHAtJ1 A7WYW8WAqsPy/EP5K6qCDW7POWYGWr/s46wEnlit/K8U1dQ2MyqUHVO09ztXMGRCtLn3 BVeZuV+Xzgsgp+GdN0O7CZloNm2urrjY0mkfJX5ODHyf4ulZu3wdQzPU/HDlYfSAel9y vzydBR50mv3e+5v3ph0NZ2MbjN+Wd1GEaD6d+nsyISQXO8ROiK25IMClod8YFmTaww7N v27hCp0qfa55EZBricUrtEluo3xLXdfj0a4t9OG/H/CY9DjFYFwO5aFO4v/nH9ByIkej dWvA== X-Gm-Message-State: AOAM5328g3huPNP0CrC0yLTbKx2Fpum0ukrJUSnhV00zp92DEuosfUcS jkXOLO4Rg1Ci/CnpsviXCF8xft2pXNiWtmCXPd5gNDmsjYg= X-Google-Smtp-Source: ABdhPJxHA6zcchPw9sjWOxRNb5EB2Usfaqg8HBq869DKj9gIUbTxEgoVrpVHS+8uV2dmcwChnjzF/hpZDphFagNhPOY= X-Received: by 2002:a05:6402:2713:: with SMTP id y19mr13714027edd.59.1621880015233; Mon, 24 May 2021 11:13:35 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Manish Sharma Date: Mon, 24 May 2021 23:43:24 +0530 Message-ID: To: dev@dpdk.org Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.29 Subject: [dpdk-dev] rte_memcpy - fence and stream X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" I am looking at the source for rte_memcpy (this is a discussion only for x86-64) For one of the cases, when aligned correctly, it uses /** * Copy 64 bytes from one location to another, * locations should not overlap. */ static __rte_always_inline void rte_mov64(uint8_t *dst, const uint8_t *src) { __m512i zmm0; zmm0 = _mm512_loadu_si512((const void *)src); _mm512_storeu_si512((void *)dst, zmm0); } I had some questions about this: 1. What I dont see is any use of x86 fence(rmb,wmb) instructions. Is that not required in this case and if not, why isnt it needed? 2. Are the mm512_loadu_si512 and _mm512_storeu_si512 non temporal? 3. Why isn't the code using stream variants, _mm512_stream_load_si512 and friends? It would not pollute the cache, so should be better - unless the required fence instructions cause a drop in performance? 4. Do the _mm512_stream_load_si512 need fence instructions? Based on my reading of the spec, the answer is yes - but wanted to confirm. TIA, Manish