mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Rusty Russell <rusty@ozlabs.org>
To: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Cc: Andrew Morton <akpm@linux-foundation.org>,
	linux-kernel@vger.kernel.org,
	linux-api <linux-api@vger.kernel.org>
Subject: Re: [PATCH 0/3] sys_membarrier (x86, generic)
Date: Thu, 08 Oct 2015 16:52:30 +1030	[thread overview]
Message-ID: <87h9m1zxp5.fsf@rustcorp.com.au> (raw)
In-Reply-To: <1840779213.18838.1444097856879.JavaMail.zimbra@efficios.com>

Mathieu Desnoyers <mathieu.desnoyers@efficios.com> writes:
> ----- On Oct 5, 2015, at 7:21 PM, Rusty Russell rusty@ozlabs.org wrote:
>
>> Mathieu Desnoyers <mathieu.desnoyers@efficios.com> writes:
>>> Hi Andrew,
>>>
>>> Here is a repost of sys_membarrier, rebased on top of Linus commit
>>> c4b5fd3fb2058b650447372472ad24e2a989f9f6 without any change since the
>>> last v19 post other that proceeding to further testing. When merging
>>> with other system calls, system call number conflicts should be quite
>>> straightforward to handle, there is nothing special there.
>> 
>> Hi Mathieu,
>> 
>>        Great to see this go in!  One small note: it talks about
>> threads, but membarrier as currently implemented would cover any shared
>> memory.  If you plan to optimize in future, that might not be the case:
>> we'd want an address argument for those cases?
>
> Hi Rusty,
>
> Indeed, the current membarrier implementation only supports
> the MEMBARRIER_CMD_SHARED flag, which works even with shared
> memory across processes. If we ever want to optimize that for
> single-process, multi-threaded cases, we would have to add
> a new flag (e.g. MEMBARRIER_CMD_PRIVATE). This is quite
> similar to what already exists in the futex system call.
>
> I'm not sure I fully understand where the address argument
> you are describing would be useful. So far, I see two
> main use-cases: we either interact with memory that is
> local to a single process, or with memory shared across
> processes.
>
> We could indeed think about sending a membarrier to all
> processes using a specific shared memory area (hence the
> possible need for an address argument). This could eventually
> be supported by adding a specific flag for this (e.g.
> MEMBARRIER_CMD_SHM), which would indicate that an extra
> parameter is provided (an address).

That's exactly what I was thinking; eg. it can be optimized in the case
where nothing else with the memory mapped is running.

Cheers,
Rusty.

      reply	other threads:[~2015-10-09  0:43 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-10 20:58 Mathieu Desnoyers
2015-07-10 20:58 ` [PATCH 1/3 v19] sys_membarrier(): system-wide memory barrier (generic, x86) Mathieu Desnoyers
2015-12-04 15:44   ` Michael Kerrisk (man-pages)
2015-12-05  8:48     ` Mathieu Desnoyers
2015-12-11 18:05       ` Michael Kerrisk (man-pages)
2015-12-13 11:44         ` Mathieu Desnoyers
2015-07-10 20:58 ` [PATCH 2/3] selftests: add membarrier syscall test Mathieu Desnoyers
2015-08-31  6:54   ` Michael Ellerman
2015-09-01 17:11     ` Mathieu Desnoyers
2015-09-01 18:32       ` Andy Lutomirski
2015-09-03  9:33         ` Michael Ellerman
2015-09-03 15:47           ` Mathieu Desnoyers
2015-09-04  3:36             ` Michael Ellerman
2015-09-07 16:01               ` Mathieu Desnoyers
2015-09-08  4:19                 ` Michael Ellerman
2015-09-08 14:02                   ` Mathieu Desnoyers
2015-09-03  9:24       ` Michael Ellerman
2015-07-10 20:58 ` [PATCH 3/3] selftests: enhance " Mathieu Desnoyers
2015-10-05 23:21 ` [PATCH 0/3] sys_membarrier (x86, generic) Rusty Russell
2015-10-06  2:17   ` Mathieu Desnoyers
2015-10-08  6:22     ` Rusty Russell [this message]

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=87h9m1zxp5.fsf@rustcorp.com.au \
    --to=rusty@ozlabs.org \
    --cc=akpm@linux-foundation.org \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mathieu.desnoyers@efficios.com \
    /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

Powered by JetHome