Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1741770
| From | Mathieu Desnoyers <mathieu.desnoyers@efficios.com> |
|---|---|
| Newsgroups | linux.kernel |
| Subject | Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command |
| Date | 2017-09-28 20:30 +0200 |
| Message-ID | <uuLJn-3Ze-7@gated-at.bofh.it> (permalink) |
| References | (2 earlier) <uukg9-35a-1@gated-at.bofh.it> <uuHcK-17h-13@gated-at.bofh.it> <uuIBR-289-37@gated-at.bofh.it> <uuIVc-2ep-23@gated-at.bofh.it> <uuJHA-2JP-15@gated-at.bofh.it> |
| Organization | linux.* mail to news gateway |
----- On Sep 28, 2017, at 12:16 PM, Nicholas Piggin npiggin@gmail.com wrote: > On Thu, 28 Sep 2017 15:29:50 +0000 (UTC) > Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote: > >> ----- On Sep 28, 2017, at 11:01 AM, Nicholas Piggin npiggin@gmail.com wrote: >> >> > On Thu, 28 Sep 2017 13:31:36 +0000 (UTC) >> > Mathieu Desnoyers <mathieu.desnoyers@efficios.com> wrote: >> > >> >> ----- On Sep 27, 2017, at 9:04 AM, Nicholas Piggin npiggin@gmail.com wrote: >> >> > > [snip] > >> >> So I don't see much point in trying to remove that registration step. >> > >> > I don't follow you. You are talking about the concept of registering >> > intention to use a different function? And the registration API is not >> > merged yet? >> >> Yes, I'm talking about requiring processes to invoke membarrier cmd >> MEMBARRIER_CMD_REGISTER_PRIVATE_EXPEDITED before they can successfully >> invoke membarrier cmd MEMBARRIER_CMD_PRIVATE_EXPEDITED. >> >> > Let me say I'm not completely against the idea of a registration API. But >> > don't think registration for this expedited command is necessary. >> >> Given that we have the powerpc lack-of-full-barrier-on-return-to-userspace >> case now, and we foresee x86-sysexit, sparc, and alpha also requiring >> special treatment when we introduce the MEMBARRIER_FLAG_SYNC_CORE behavior >> in the next release, it seems that we'll have a hard time handling >> architecture special cases efficiently if we don't expose the registration >> API right away. > > But SYNC_CORE is a different functionality, right? You can add the > registration API for it when that goes in. Sure, I could. However, I was hoping to re-use the same command, with a "SYNC_CORE" flag, and I would have liked to have consistent behavior for same commands used with different flags. > >> > But (aside) let's say a tif flag turns out to be a good diea for your >> > second case, why not just check the flag in the membarrier sys call and >> > do the registration the first time it uses it? >> >> We also considered that option. It's mainly about guaranteeing that >> an expedited membarrier command never blocks. If we introduce this >> "lazy auto-registration" behavior, we end up blocking the process >> at a random point in its execution so we can issue a synchronize_sched(). >> By exposing an explicit registration, we can control where this delay >> occurs, and even allow library constructors to invoke the registration >> while the process is a single threaded, therefore allowing us to completely >> skip synchronize_sched(). > > Okay I guess that could be a good reason. As I said I'm not opposed to > the concept. I suppose you could even have a registration for expedited > private even if it's a no-op on all architectures, just in case some new > ways of implementing it can be done in future. That's an approach I would be OK with too. Mandating explicit registration will give us much more flexibility. > I suppose I'm more objecting to the added complexity for powerpc, and > more code in the fastpath to make the slowpath faster. Just to make sure I understand your concern here. The "fastpath" you refer to is the TIF flag test in membarrier_sched_in() within finish_task_switch(), and the "slowpath" is switch_mm() which lacks the required full barrier now, am I correct ? Would it help if we invoke the membarrier hook from switch_mm() instead ? We'd therefore only add the TIF flag test in switch_mm(), rather than for every context switch. Thanks, Mathieu > > Thanks, > Nick -- Mathieu Desnoyers EfficiOS Inc. http://www.efficios.com
Back to linux.kernel | Previous | Next — Previous in thread | Next in thread | Find similar | Unroll thread
[PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2017-09-26 20:00 +0200
Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2017-09-26 22:50 +0200
Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command Nicholas Piggin <npiggin@gmail.com> - 2017-09-27 15:10 +0200
Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2017-09-28 15:40 +0200
Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command Nicholas Piggin <npiggin@gmail.com> - 2017-09-28 17:10 +0200
Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2017-09-28 17:30 +0200
Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command Nicholas Piggin <npiggin@gmail.com> - 2017-09-28 18:20 +0200
Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command Mathieu Desnoyers <mathieu.desnoyers@efficios.com> - 2017-09-28 20:30 +0200
Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command Peter Zijlstra <peterz@infradead.org> - 2017-09-28 18:00 +0200
Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command Nicholas Piggin <npiggin@gmail.com> - 2017-09-28 18:30 +0200
Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command Peter Zijlstra <peterz@infradead.org> - 2017-09-29 12:40 +0200
Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command Nicholas Piggin <npiggin@gmail.com> - 2017-09-29 13:40 +0200
Re: [PATCH v4 for 4.14 1/3] membarrier: Provide register expedited private command Peter Zijlstra <peterz@infradead.org> - 2017-09-29 13:50 +0200
csiph-web