io-uring.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pavel Begunkov <asml.silence@gmail.com>
To: Jens Axboe <axboe@kernel.dk>, io-uring@vger.kernel.org
Subject: [PATCH v2 1/2] barriers: add load relaxed
Date: Sun, 21 Jun 2020 19:14:25 +0300	[thread overview]
Message-ID: <f7de9c7842c666cfe7b255224bd934427274b465.1592755912.git.asml.silence@gmail.com> (raw)
In-Reply-To: <cover.1592755912.git.asml.silence@gmail.com>

Add io_uring_smp_load_relaxed() for internal use.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
---
 src/include/liburing/barrier.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/src/include/liburing/barrier.h b/src/include/liburing/barrier.h
index ad69506..6a1aa52 100644
--- a/src/include/liburing/barrier.h
+++ b/src/include/liburing/barrier.h
@@ -47,6 +47,8 @@ do {						\
 	___p1;						\
 })
 
+#define io_uring_smp_load_relaxed(p) IO_URING_READ_ONCE(*(p))
+
 #else /* defined(__x86_64__) || defined(__i386__) */
 /*
  * Add arch appropriate definitions. Use built-in atomic operations for
@@ -55,6 +57,8 @@ do {						\
 #define io_uring_smp_store_release(p, v) \
 	__atomic_store_n(p, v, __ATOMIC_RELEASE)
 #define io_uring_smp_load_acquire(p) __atomic_load_n(p, __ATOMIC_ACQUIRE)
+#define io_uring_smp_load_relaxed(p) __atomic_load_n(p, __ATOMIC_RELAXED)
+
 #endif /* defined(__x86_64__) || defined(__i386__) */
 
 #endif /* defined(LIBURING_BARRIER_H) */
-- 
2.24.0


  reply	other threads:[~2020-06-21 16:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-06-21 16:14 [PATCH v2 0/2] Fix hang in io_uring_get_cqe() with iopoll Pavel Begunkov
2020-06-21 16:14 ` Pavel Begunkov [this message]
2020-06-21 16:14 ` [PATCH v2 2/2] " Pavel Begunkov
2020-06-21 18:48 ` [PATCH v2 0/2] " Jens Axboe
2020-06-21 19:54   ` Pavel Begunkov

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=f7de9c7842c666cfe7b255224bd934427274b465.1592755912.git.asml.silence@gmail.com \
    --to=asml.silence@gmail.com \
    --cc=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).