220 38133 <6528826.uWXH5iz4YB@tjmaciei-mobl1> article
Path: news.gmane.org!.POSTED!not-for-mail
From: Thiago Macieira <thiago@macieira.org>
Newsgroups: gmane.comp.lang.c++.isocpp.proposals
Subject: Re: memcpy/memset/etc overloads for volatile memory
Date: Fri, 18 May 2018 23:20:27 -0700
Lines: 26
Approved: news@gmane.org
Message-ID: <6528826.uWXH5iz4YB@tjmaciei-mobl1>
References: <CAFdMc-0NAvWrkwzpgEKq4DQj=0vL_0F2s17XyR9MSUNJk5R0sw@mail.gmail.com> <2300193.1RphyUdPvq@tjmaciei-mobl1> <CAFdMc-0wber+dL_ugAcg7OBxLoajOOU8mMqLmS-aKTWHRcCghQ@mail.gmail.com>
Reply-To: std-proposals@isocpp.org
NNTP-Posting-Host: blaine.gmane.org
Mime-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
X-Trace: blaine.gmane.org 1526710705 4590 195.159.176.226 (19 May 2018 06:18:25 GMT)
X-Complaints-To: usenet@blaine.gmane.org
NNTP-Posting-Date: Sat, 19 May 2018 06:18:25 +0000 (UTC)
To: std-proposals@isocpp.org
Original-X-From: std-proposals+bncBCB4TK757YBRBLUE77LQKGQE3EBMLTQ@isocpp.org Sat May 19 08:18:21 2018
Return-path: <std-proposals+bncBCB4TK757YBRBLUE77LQKGQE3EBMLTQ@isocpp.org>
Envelope-to: gclcip-std-proposals@m.gmane.org
Original-Received: from mail-qk0-f197.google.com ([209.85.220.197])
	by blaine.gmane.org with esmtp (Exim 4.84_2)
	(envelope-from <std-proposals+bncBCB4TK757YBRBLUE77LQKGQE3EBMLTQ@isocpp.org>)
	id 1fJvC8-00015Y-QE
	for gclcip-std-proposals@m.gmane.org; Sat, 19 May 2018 08:18:20 +0200
Original-Received: by mail-qk0-f197.google.com with SMTP id z78-v6sf9146144qkb.14
        for <gclcip-std-proposals@m.gmane.org>; Fri, 18 May 2018 23:20:32 -0700 (PDT)
ARC-Seal: i=2; a=rsa-sha256; t=1526710831; cv=pass;
        d=google.com; s=arc-20160816;
        b=SyWmEd2ab0TFrLcpaBBSC9QVDjtRdFLgKGu5KJ7NsnDbqpR1hDVq/xcWlhP4mQskuj
         IRTIvj8ChTcTIMpRE+IZpgKNURfmz3bAAwLqRWNSgxOLBd3VZwgbfNhZIWLorwaFSLgg
         Ow1BefLpQUgkN5bXBIv5OS0+wdueZTDp9yC88taU5QcaBf26KagflMLrk9R0o2Db1kPN
         2hGx08o6ZgWIGKYJnKkTfKh6OEAjUDhgZxe8zPHZj0KIxq5ab8/pxlo1mJAo9AYq3srE
         aBbo6xmwDn1DHZsIOaQvTNwXyDxtgkV8GzJ1ldIFNDQzULjeMReUWJdpjsI2N98fLINH
         zbmg==
ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=list-unsubscribe:list-subscribe:list-archive:list-help:list-post
         :list-id:mailing-list:precedence:reply-to:mime-version:references
         :in-reply-to:message-id:date:subject:to:from
         :arc-authentication-results:arc-message-signature:dkim-signature
         :arc-authentication-results;
        bh=zljREYQZTADyeZL2BuoJjv5r+xq/YVMkdu5eD0aTpbo=;
        b=gDqp5hyEMt8VjVNb0SxrMo0d8RGeqFc3t3XFzEsfWsjnwahyLDAXGMd2hcPvnYpAnZ
         0TFduaWLNFzbfgyObFN7mdHWieV/9g/ORiZ4PJTMLWdYyNcFMLWTVQOwPV9KY2WnzW/8
         pK3MQIorGBAyqLLawsLaMZE6YcDLXMj9chFvFHAzG2zAY1Cah7lsBdc0Bw8EWyCeXXKN
         Or1Nlh9FByehxS+MPcb7VaQXCllw+5a7UGxnT9475mzC+DYgBmu9Rav1OXoZUC4DPY2B
         ENRMINDXskGAa1PPSX/vx4xBKvpEGZxFkcR8EmPJvKlz1UNld8wuHt05ciPsoZPCOLrS
         KkBg==
ARC-Authentication-Results: i=2; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted sender) smtp.mailfrom=thiago@macieira.org
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=isocpp-org.20150623.gappssmtp.com; s=20150623;
        h=from:to:subject:date:message-id:in-reply-to:references:mime-version
         :x-original-sender:x-original-authentication-results:reply-to
         :precedence:mailing-list:list-id:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=zljREYQZTADyeZL2BuoJjv5r+xq/YVMkdu5eD0aTpbo=;
        b=Vrh0ogNvBy8LxfbSnTNhLMjdFYdMaHTAZhr5KBzRU7SD1krh8lr17c7CGWKgu+JicL
         uRUd76YXf46tPwSA/zcL7t3Nn424piqs0rtg0oOFSkG/KVI0tqize2D1B3RdFDFN/mLF
         TGycRG+oXsM5BUFlbclZvopWB1yDjt0cIqQKeCuBJmVNnLu+xgiVn2izGNeY+x5G7a9K
         +NoHB89jrkKGXJDeqWD8iTuxSGWegeGJbxEpbO0SOcB4lFfcc/0eNrKBVMvAArs4KthP
         nFHIaSsgcE6RiKCOK5N1Mntqwf0gXc6IOW0hd7iSEp7ZFvOQtLY0+42uLk7TC7E1K7MI
         TMNA==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
        d=1e100.net; s=20161025;
        h=x-gm-message-state:from:to:subject:date:message-id:in-reply-to
         :references:mime-version:x-original-sender
         :x-original-authentication-results:reply-to:precedence:mailing-list
         :list-id:x-spam-checked-in-group:list-post:list-help:list-archive
         :list-subscribe:list-unsubscribe;
        bh=zljREYQZTADyeZL2BuoJjv5r+xq/YVMkdu5eD0aTpbo=;
        b=ShCMe26Lba4YYpG+pHJZZwuO0YW727l5j9CwnGI0+jDgHWXNlIHWEXr27pj5ijaW6a
         VSZ/v78JNgpivtOKhj5f1/j/RBQ+/lw7Jpg1sVt4rhKNw5WwyX/A+8m4RWSIETpmtbgL
         sRfrF9AZGDSssoNQIOd2n6LMlZ96pDb1jaHGJdbOniqj04xxokhkvW+o79xl7aEEqi+3
         snmUIafWvJ7mCXVUeFgPXtwJVD37TdsbtMNWbFlvj3yMRBaBK3twcDFL4uYjIbzCQhCj
         hKFHJAT/G5q5TxYcx1lXDfOdty5L15EMtzsclf8hz0PCjsRGsAAl0+R59/c0IGToPaNd
         +rJA==
X-Gm-Message-State: ALKqPwdeGxfMRrZMk1bx0UB2/ySWx0TKm+JzSweRXy8ww48DAqbR5Nwo
	gVLegcjn/jr52uVBzRlleI2crw==
X-Google-Smtp-Source: AB8JxZov5RPgHP/fe3kLcHi+S1NRkUVlV2D8imx3OhURJ8ZlxH9hogwpwh5j3kn1u+3u8c4EWnDoJw==
X-Received: by 2002:ac8:44d3:: with SMTP id b19-v6mr8172121qto.2.1526710831596;
        Fri, 18 May 2018 23:20:31 -0700 (PDT)
X-BeenThere: std-proposals@isocpp.org
Original-Received: by 2002:a37:d718:: with SMTP id m24-v6ls4940687qki.7.gmail; Fri, 18
 May 2018 23:20:30 -0700 (PDT)
X-Received: by 2002:a37:7f46:: with SMTP id a67-v6mr10813428qkd.351.1526710830340;
        Fri, 18 May 2018 23:20:30 -0700 (PDT)
ARC-Seal: i=1; a=rsa-sha256; t=1526710830; cv=none;
        d=google.com; s=arc-20160816;
        b=HTl8L5zYY5OrvweUlmJYNkPW5cQjkqtYGFCSQ81UPjzsTEvcDgiz7skBXerfSfy2k9
         368MUJa5AYFuWzZ5sDBxOkraW2b2WY01V2RYWvrrRbzKZH7zoHGKRWLlttg9nMCVc6C+
         TIr4UPr284n1E4ZSPn3Qj8cyFux9jVVyC3PMojZn5Dxap8Xgfn2JRDAfO2QHU45jcFAw
         AiubySFaEGfbZinPPYZNE9pU4VIWNEf2MccGE8GJbndjkRi5YaBzgsl4iWJyQhTL8OUe
         snOn2mNRnKe/yXjUtaYdPlTKaCmQJhI8Gh7hHHPCYLtJyhybzHIqAhzkP7ewiiXopKJb
         a5Cw==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=content-transfer-encoding:mime-version:references:in-reply-to
         :message-id:date:subject:to:from:arc-authentication-results;
        bh=Mxx9hG3awzsNcnzf07m/UuaeTT1C7JfR1cIiGnd1cWI=;
        b=YqXrR8FnmtGCV36oEAzDnDs0Bgso2JSgb66tgP8bfqbv9vkupQLkjp5YEZobTvy14E
         hI379a7xFOwxucD69VSZaRhJ3i3MJL21Qfnorca734TF3Vmh9BDvdA9/uUOe078DX6wI
         TpHMdsxQIBfgx0vyf6kCRtWNGBX5+1B1H0UY+IplbmG/3g0K2608v3fzlkiCsP0je60U
         eDjTgNqiHKo6UasdukQuxn8Y2MQ0eVKrVrJGv8J1kbXe+n5NuzDoTZlU7q+yiLWgUT35
         tlqkEasV2/IMJNk/Yyk6upcMOrkN5P4+Yu/w40ZzWGDcqpgIfclTCnyYyqOpfzoNtE5l
         rFyg==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=pass (google.com: domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted sender) smtp.mailfrom=thiago@macieira.org
Original-Received: from smtp.macieira.info (smtp.macieira.info. [2001:19f0:5:2221::1:3])
        by mx.google.com with ESMTPS id l21-v6si8870039qvg.112.2018.05.18.23.20.29
        for <std-proposals@isocpp.org>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Fri, 18 May 2018 23:20:29 -0700 (PDT)
Received-SPF: pass (google.com: domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted sender) client-ip=2001:19f0:5:2221::1:3;
Original-Received: from tjmaciei-mobl1.localnet (unknown [IPv6:2601:1c0:4501:5f9f:bc1f:402:4b5e:fda5])
	by smtp.macieira.info (Postfix) with ESMTPSA id A73A3E7D0
	for <std-proposals@isocpp.org>; Fri, 18 May 2018 23:20:28 -0700 (PDT)
In-Reply-To: <CAFdMc-0wber+dL_ugAcg7OBxLoajOOU8mMqLmS-aKTWHRcCghQ@mail.gmail.com>
X-Original-Sender: thiago@macieira.org
X-Original-Authentication-Results: mx.google.com;       spf=pass (google.com:
 domain of thiago@macieira.org designates 2001:19f0:5:2221::1:3 as permitted
 sender) smtp.mailfrom=thiago@macieira.org
Precedence: list
Mailing-list: list std-proposals@isocpp.org; contact std-proposals+owners@isocpp.org
List-ID: <std-proposals.isocpp.org>
X-Spam-Checked-In-Group: std-proposals@isocpp.org
X-Google-Group-Id: 399137483710
List-Post: <https://groups.google.com/a/isocpp.org/group/std-proposals/post>, <mailto:std-proposals@isocpp.org>
List-Help: <https://support.google.com/a/isocpp.org/bin/topic.py?topic=25838>, <mailto:std-proposals+help@isocpp.org>
List-Archive: <https://groups.google.com/a/isocpp.org/group/std-proposals/>
List-Subscribe: <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>,
 <mailto:std-proposals+subscribe@isocpp.org>
List-Unsubscribe: <mailto:googlegroups-manage+399137483710+unsubscribe@googlegroups.com>,
 <https://groups.google.com/a/isocpp.org/group/std-proposals/subscribe>
Xref: news.gmane.org gmane.comp.lang.c++.isocpp.proposals:38133
Archived-At: <http://permalink.gmane.org/gmane.comp.lang.c++.isocpp.proposals/38133>

On Friday, 18 May 2018 18:24:37 PDT dgutson . wrote:
> Oh yes you don't know how hard it can get...  avoid prefetching, avoid
> SSE/vectorization, ensure right order of operations (WC regions).
> So there are lots of details that a too smart toolchain may mess.

Even with volatile? It can't change the accesses you make if you use volatile. 
So no prefetching, no SSE. The order is exactly the one that you specify.

> However I will think if an execution policy can help here in copy. I'm not
> talking about copying but also memsetting.
> The linux kernel has a nice memcpy_toio/fromio worth to look at.

Does it work for other types of memory besides I/O/

-- 
Thiago Macieira - thiago (AT) macieira.info - thiago (AT) kde.org
   Software Architect - Intel Open Source Technology Center



-- 
You received this message because you are subscribed to the Google Groups "ISO C++ Standard - Future Proposals" group.
To unsubscribe from this group and stop receiving emails from it, send an email to std-proposals+unsubscribe@isocpp.org.
To post to this group, send email to std-proposals@isocpp.org.
To view this discussion on the web visit https://groups.google.com/a/isocpp.org/d/msgid/std-proposals/6528826.uWXH5iz4YB%40tjmaciei-mobl1.

.
