Re: [RFC PATCH 0/3 v3] futex/sched: introduce FUTEX_SWAP operation

2021-03-17 Thread Peter Oskolkov
Hi Jim, thank you for your interest! While FUTEX_SWAP seems to be a nonstarter, there is a discussion off-list on how to approach the larger problem of userspace scheduling. A full userspace scheduling patchset is likely to take some time to shape out, but the "core" patches of wait/wake/swap are

Re: [RFC PATCH v2 00/13] Add futex2 syscall

2021-03-05 Thread Peter Oskolkov
On Fri, Mar 5, 2021 at 12:03 PM Peter Oskolkov wrote: > > Hi André! > > On Thu, Mar 4, 2021 at 10:58 AM André Almeida > wrote: > > > > Hi Peter, > > > > Às 02:44 de 04/03/21, Peter Oskolkov escreveu: > > > On Wed, Mar 3, 2021 at 5:22

Re: [RFC PATCH v2 00/13] Add futex2 syscall

2021-03-05 Thread Peter Oskolkov
Hi André! On Thu, Mar 4, 2021 at 10:58 AM André Almeida wrote: > > Hi Peter, > > Às 02:44 de 04/03/21, Peter Oskolkov escreveu: > > On Wed, Mar 3, 2021 at 5:22 PM André Almeida > > wrote: > >> > >> Hi, > >> > >> This

Re: [RFC PATCH v2 00/13] Add futex2 syscall

2021-03-03 Thread Peter Oskolkov
On Wed, Mar 3, 2021 at 5:22 PM André Almeida wrote: > > Hi, > > This patch series introduces the futex2 syscalls. > > * What happened to the current futex()? > > For some years now, developers have been trying to add new features to > futex, but maintainers have been reluctant to accept then, give

[PATCH] sched: a very minor refactoring.

2021-01-26 Thread Peter Oskolkov
The comment says: /* task_struct member predeclarations (sorted alphabetically): */ So move io_uring_task where it belongs (alphabetically). Signed-off-by: Peter Oskolkov --- include/linux/sched.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/sched.h b

Re: [PATCH] membarrier.2: Update prototype

2020-11-02 Thread Peter Oskolkov
were introduced to the kernel > > in commit 2a36ab717e8fe678d98f81c14a0b124712719840. > [...] > Peter (Oskolkov), can you contribute a patch detailing the new membarrier > flags and cpu_id > arguments to the man pages project ? Yes, sure, I'll prepare a patch in the next day or two. Thanks, Peter [...]

[tip: sched/core] sched/fair: Tweak pick_next_entity()

2020-10-05 Thread tip-bot2 for Peter Oskolkov
The following commit has been merged into the sched/core branch of tip: Commit-ID: 9abb897345ce1d41257567f571a78137c961c405 Gitweb: https://git.kernel.org/tip/9abb897345ce1d41257567f571a78137c961c405 Author:Peter Oskolkov AuthorDate:Wed, 30 Sep 2020 10:35:32 -07:00

[PATCH] sched/fair: tweak pick_next_entity

2020-09-30 Thread Peter Oskolkov
cycles checking the last buddy when eventually the next buddy is picked up. So this patch refactors two 'ifs' above into [...] if (next_buddy_ok()) result = next_buddy; else if (last_buddy_ok()) result = last_buddy; [...] Signed-off-by: Peter Oskolkov --- kernel/sched/f

[tip: sched/core] rseq/selftests,x86_64: Add rseq_offset_deref_addv()

2020-09-29 Thread tip-bot2 for Peter Oskolkov
The following commit has been merged into the sched/core branch of tip: Commit-ID: ea366dd79c05fcd4cf5e225d2de8a3a7c293160c Gitweb: https://git.kernel.org/tip/ea366dd79c05fcd4cf5e225d2de8a3a7c293160c Author:Peter Oskolkov AuthorDate:Wed, 23 Sep 2020 16:36:17 -07:00

[tip: sched/core] rseq/selftests: Test MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-09-29 Thread tip-bot2 for Peter Oskolkov
The following commit has been merged into the sched/core branch of tip: Commit-ID: f166b111e0491486fca0d105f09655ab718bd1c8 Gitweb: https://git.kernel.org/tip/f166b111e0491486fca0d105f09655ab718bd1c8 Author:Peter Oskolkov AuthorDate:Wed, 23 Sep 2020 16:36:18 -07:00

[tip: sched/core] rseq/membarrier: Add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-09-29 Thread tip-bot2 for Peter Oskolkov
The following commit has been merged into the sched/core branch of tip: Commit-ID: 2a36ab717e8fe678d98f81c14a0b124712719840 Gitweb: https://git.kernel.org/tip/2a36ab717e8fe678d98f81c14a0b124712719840 Author:Peter Oskolkov AuthorDate:Wed, 23 Sep 2020 16:36:16 -07:00

[PATCH v8 2/3] rseq/selftests: add rseq_offset_deref_addv

2020-09-23 Thread Peter Oskolkov
This patch adds rseq_offset_deref_addv function to tools/testing/selftests/rseq/rseq-x86.h, to be used in a selftest in the next patch in the patchset. v7->v8: this patch split out of the v7 selftest patch. Signed-off-by: Peter Oskolkov --- tools/testing/selftests/rseq/rseq-x86.h |

[PATCH v8 1/3] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-09-23 Thread Peter Oskolkov
membarrier.c. The second patch in the patchset adds a selftest of this feature. Signed-off-by: Peter Oskolkov --- include/linux/sched/mm.h| 3 + include/linux/syscalls.h| 2 +- include/uapi/linux/membarrier.h | 26 ++ kernel/sched/membarrier.c | 136 ++

[PATCH v8 3/3] rseq/selftests: test MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-09-23 Thread Peter Oskolkov
architectures other than x86_64). v8: split rseq_offset_deref_addv() into a separate patch; moved the test to param_test; other minor tweaks. Signed-off-by: Peter Oskolkov --- tools/testing/selftests/rseq/param_test.c | 223 +- .../testing/selftests/rseq/run_param_test.sh | 2

Re: [PATCH 1/2 v6] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-09-15 Thread Peter Oskolkov
On Tue, Sep 15, 2020 at 8:39 AM Mathieu Desnoyers wrote: > > - On Sep 15, 2020, at 2:12 AM, Peter Oskolkov p...@posk.io wrote: > > > Any comments here? Should I change anything? > > See below, Thanks for the review - all done in V7. Please have a look. Thanks, Peter [...]

[PATCH 2/2 v7] rseq/selftests: test MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-09-15 Thread Peter Oskolkov
architectures other than x86_64). Signed-off-by: Peter Oskolkov --- .../selftests/rseq/basic_percpu_ops_test.c| 187 ++ tools/testing/selftests/rseq/rseq-x86.h | 57 ++ 2 files changed, 244 insertions(+) diff --git a/tools/testing/selftests/rseq/basic_percpu_ops_test.c

[PATCH 1/2 v7] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-09-15 Thread Peter Oskolkov
arrier in syscalls.h. v5->v6: - made membarrier_private_expedited more efficient in a single-cpu case; - a couple of minor refactorings. v6->v7: - made @flags an unsigned int in sys_membarrier; - a couple of minor refactorings. The second patch in the patchset adds a selftest of

Re: [PATCH 1/2 v6] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-09-14 Thread Peter Oskolkov
Any comments here? Should I change anything? Thanks, Peter On Mon, Aug 31, 2020 at 3:58 PM Peter Oskolkov wrote: > > This patchset is based on Google-internal RSEQ > work done by Paul Turner and Andrew Hunter. > > When working with per-CPU RSEQ-based memory allocations, &g

Re: [PATCH 1/2 v5] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-31 Thread Peter Oskolkov
On Mon, Aug 31, 2020 at 8:35 AM Mathieu Desnoyers wrote: > Thanks for the review! > > - On Aug 26, 2020, at 7:02 PM, Peter Oskolkov p...@google.com wrote: > [...] > > > > static void ipi_mb(void *info) > > { > > +#ifdef CONFIG_RSEQ > > + in

[PATCH 2/2 v6] rseq/selftests: test MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-31 Thread Peter Oskolkov
architectures other than x86_64). Signed-off-by: Peter Oskolkov --- .../selftests/rseq/basic_percpu_ops_test.c| 187 ++ tools/testing/selftests/rseq/rseq-x86.h | 57 ++ 2 files changed, 244 insertions(+) diff --git a/tools/testing/selftests/rseq/basic_percpu_ops_test.c

[PATCH 1/2 v6] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-31 Thread Peter Oskolkov
arrier in syscalls.h. v5->v6: - made membarrier_private_expedited more efficient in a single-cpu case; - a couple of other minor refactorings. The second patch in the patchset adds a selftest of this feature. Signed-off-by: Peter Oskolkov --- include/linux/sched/mm.h| 3

[PATCH 2/2 v5] rseq/selftests: test MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-26 Thread Peter Oskolkov
architectures other than x86_64). Signed-off-by: Peter Oskolkov --- .../selftests/rseq/basic_percpu_ops_test.c| 187 ++ tools/testing/selftests/rseq/rseq-x86.h | 57 ++ 2 files changed, 244 insertions(+) diff --git a/tools/testing/selftests/rseq/basic_percpu_ops_test.c

[PATCH 1/2 v5] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-26 Thread Peter Oskolkov
rrier in syscalls.h. The second patch in the patchset adds a selftest of this feature. Signed-off-by: Peter Oskolkov --- include/linux/sched/mm.h| 3 ++ include/linux/syscalls.h| 2 +- include/uapi/linux/membarrier.h | 29 ++ kernel/sched/membarrier.c | 6

[PATCH 1/2 v4] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-26 Thread Peter Oskolkov
est of this feature. Signed-off-by: Peter Oskolkov --- include/linux/sched/mm.h| 3 ++ include/uapi/linux/membarrier.h | 29 ++ kernel/sched/membarrier.c | 67 - 3 files changed, 89 insertions(+), 10 deletions(-) diff --git a/include/linux/sc

[PATCH 2/2 v4] rseq/selftests: test MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-26 Thread Peter Oskolkov
architectures other than x86_64). Signed-off-by: Peter Oskolkov --- .../selftests/rseq/basic_percpu_ops_test.c| 187 ++ tools/testing/selftests/rseq/rseq-x86.h | 57 ++ 2 files changed, 244 insertions(+) diff --git a/tools/testing/selftests/rseq/basic_percpu_ops_test.c

Re: [PATCH 1/2 v3] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-25 Thread Peter Oskolkov
On Tue, Aug 25, 2020 at 9:58 AM Mathieu Desnoyers wrote: > [...] > > Concretely speaking, let's just add a new membarrier command for the use-case > at hand. All other ways of doing things we have discussed are tricky to expose > in a way that is discoverable by user-space through the QUERY comman

Re: [PATCH 1/2 v3] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-20 Thread Peter Oskolkov
On Wed, Aug 12, 2020 at 12:44 PM Mathieu Desnoyers wrote: > [...] > > > One way of doing what you suggest is to allow some commands to be > > bitwise-ORed. > > > > So, for example, the user could call > > > > membarrier(CMD_PRIVATE_EXPEDITED_SYNC_CORE | CMD_PRIVATE_EXPEDITED_RSEQ, > > cpu_id) >

Re: [PATCH 1/2 v3] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-12 Thread Peter Oskolkov
On Wed, Aug 12, 2020 at 11:30 AM Mathieu Desnoyers wrote: [...] > "flags" is there to allow extensibility without requiring to add new > membarrier commands for every change. Even though it is not used now, > I don't think re-purposing it is a good idea. What is wrong with just > adding an addit

Re: [PATCH 1/2 v3] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-11 Thread Peter Oskolkov
On Mon, Aug 10, 2020 at 11:27 PM Peter Zijlstra wrote: > > On Mon, Aug 10, 2020 at 05:09:58PM -0700, Peter Oskolkov wrote: > > @@ -27,6 +35,12 @@ > > > > static void ipi_mb(void *info) > > { > > The #ifdef wants to behere, otherwise you'll get a compile

[PATCH 2/2 v3] rseq/selftests: test MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-10 Thread Peter Oskolkov
make the test more explicit; on other architectures I kept using existing rseq_cmpeqv_cmpeqv_storev() as I have no easy way to test there. Added a comment explaining why the test works this way. Signed-off-by: Peter Oskolkov --- .../selftests/rseq/basic_percpu_ops_test.c| 196

[PATCH 1/2 v3] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_EXPEDITED_RSEQ

2020-08-10 Thread Peter Oskolkov
e needs to work when several bits are set, for example). The second patch in the patchset adds a selftest of this feature. Signed-off-by: Peter Oskolkov --- include/linux/sched/mm.h| 3 ++ include/uapi/linux/membarrier.h | 24 ++ kernel/sched/membarrier.c | 55

Re: [PATCH 2/2 v2] rseq/selftests: test MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU

2020-08-07 Thread Peter Oskolkov
On Fri, Aug 7, 2020 at 11:25 AM Mathieu Desnoyers wrote: > > - On Aug 7, 2020, at 1:55 PM, Peter Oskolkov p...@posk.io wrote: > > > On Thu, Aug 6, 2020 at 5:27 PM Boqun Feng wrote: > [...] > >> What if the manager thread update ->percpu_list_ptr and ca

Re: [PATCH 2/2 v2] rseq/selftests: test MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU

2020-08-07 Thread Peter Oskolkov
On Thu, Aug 6, 2020 at 5:27 PM Boqun Feng wrote: > > On Thu, Aug 06, 2020 at 10:05:44AM -0700, Peter Oskolkov wrote: > > Based on Google-internal RSEQ work done by > > Paul Turner and Andrew Hunter. > > > > This patch adds a selftest for MEMBARRIER_CMD_PRIVATE_RES

Re: [PATCH 1/2 v2] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU

2020-08-07 Thread Peter Oskolkov
On Fri, Aug 7, 2020 at 6:38 AM wrote: > [...] > I'm thinking even this is a problem, we can end up sending IPIs to CPUs > outside out partition (they might be NOHZ_FULL) and that's a no-no too. > > Something like so perhaps... that really limits it to CPUs that match > our mm. Thanks for the su

Re: [PATCH 1/2] membarrier: add MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU

2020-08-07 Thread Peter Oskolkov
On Thu, Aug 6, 2020 at 10:37 AM Mathieu Desnoyers wrote: > > >> > >> This is an unpriv IPI the world. That's a big no-no. > > > > removed in v2. > > I don't think the feature must be removed, but its implementation needs > adjustment. > > How about we simply piggy-back on the membarrier schemes

Re: [PATCH 1/2] membarrier: add MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU

2020-08-06 Thread Peter Oskolkov
On Thu, Aug 6, 2020 at 6:48 AM wrote: > > On Wed, Aug 05, 2020 at 05:08:58PM -0700, Peter Oskolkov wrote: > > Thanks for the Cc! Always a pleasure! (Sorry, included only membarrier maintainers in v1; in v2 included both membarrier and rseq

[PATCH 1/2 v2] rseq/membarrier: add MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU

2020-08-06 Thread Peter Oskolkov
than task->group_leader to identify tasks belonging to the same process. The second patch in the patchset adds a selftest of this feature. Signed-off-by: Peter Oskolkov --- include/uapi/linux/membarrier.h | 5 kernel/sched/membarrier.c | 43 +++-- 2

[PATCH 2/2 v2] rseq/selftests: test MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU

2020-08-06 Thread Peter Oskolkov
Based on Google-internal RSEQ work done by Paul Turner and Andrew Hunter. This patch adds a selftest for MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU. The test quite often fails without the previous patch in this patchset, but consistently passes with it. Signed-off-by: Peter Oskolkov

[PATCH 2/2] selftests/rseq: test MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU

2020-08-05 Thread Peter Oskolkov
Based on Google-internal RSEQ work done by Paul Turner and Andrew Hunter. This patch adds a selftest for MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU. The test quite often fails without the previous patch in this patchset, but consistently passes with it. Signed-off-by: Peter Oskolkov

[PATCH 1/2] membarrier: add MEMBARRIER_CMD_PRIVATE_RESTART_RSEQ_ON_CPU

2020-08-05 Thread Peter Oskolkov
test of this feature. Signed-off-by: Peter Oskolkov --- include/uapi/linux/membarrier.h | 8 ++ kernel/sched/membarrier.c | 51 +++-- 2 files changed, 57 insertions(+), 2 deletions(-) diff --git a/include/uapi/linux/membarrier.h b/include/uapi/linu

[PATCH for 5.9 v2 0/4] FUTEX_SWAP (tip/locking/core)

2020-08-03 Thread Peter Oskolkov
From: Peter Oskolkov This patchset introduces FUTEX_SWAP operation for fast task context switching (aided by futexes). Detailed use cases and reasoning are included in the commit message of the first patch in the patchset. v1->v2: - split two #defines in futex.h into a small first pa

[PATCH for 5.9 v2 4/4] selftests/futex: add futex_swap selftest

2020-08-03 Thread Peter Oskolkov
From: Peter Oskolkov This is the final patch in FUTEX_SWAP patchset. It adds a test/benchmark to validate the behavior and compare the performance of a new FUTEX_SWAP futex operation to a pair of FUTEX_WAKE/FUTEX_WAIT calls. Detailed API design and behavior considerations are provided in the

[PATCH for 5.9 v2 3/4] futex/sched: add wake_up_swap, use in FUTEX_SWAP

2020-08-03 Thread Peter Oskolkov
From: Peter Oskolkov As described in the previous patch in this patchset, it is often beneficial to wake a task and run it on the same CPU where the current (=going to sleep) task it running. Internally at Google, switchto_switch sycall not only migrates the wakee to the current CPU, but also

[PATCH for 5.9 v2 2/4] futex: implement FUTEX_SWAP as wake+wait.

2020-08-03 Thread Peter Oskolkov
From: Peter Oskolkov See the previous patch in the patchset, which introduced FUTEX_SWAP op in futex.h, for a detailed description of the use cases and future directions. This patch implements FUTEX_SWAP as a simple wake+wait. The next patch will improve this by migrating the wakee to the

[PATCH for 5.9 v2 1/4] futex: introduce FUTEX_SWAP operation

2020-08-03 Thread Peter Oskolkov
From: Peter Oskolkov As Paul Turner presented at LPC in 2003, Google has developed an M:N userspace threading subsystem backed by Google-private SwitchTo Linux Kernel API. This subsystem provides latency-sensitive services at Google withfine-grained user-space control/scheduling over what is

Re: [PATCH for 5.9 1/3] futex: introduce FUTEX_SWAP operation

2020-07-27 Thread Peter Oskolkov
[+cc BPF maintainers] I added a lot of details below... Maybe too much? Let me know... On Mon, Jul 27, 2020 at 2:51 AM wrote: > On Thu, Jul 23, 2020 at 05:25:05PM -0700, Peter Oskolkov wrote: > > On Thu, Jul 23, 2020 at 4:28 AM Peter Zijlstra wrote: > > > > What worries

Re: [PATCH for 5.9 1/3] futex: introduce FUTEX_SWAP operation

2020-07-23 Thread Peter Oskolkov
On Thu, Jul 23, 2020 at 8:00 PM Waiman Long wrote: > > On 7/23/20 8:25 PM, Peter Oskolkov wrote: > > On Thu, Jul 23, 2020 at 4:28 AM Peter Zijlstra wrote: > > > > Thanks a lot for your comments, Peter! My answers below. > > > >> On Wed, Jul 22, 2020 at

Re: [PATCH for 5.9 1/3] futex: introduce FUTEX_SWAP operation

2020-07-23 Thread Peter Oskolkov
On Thu, Jul 23, 2020 at 4:28 AM Peter Zijlstra wrote: Thanks a lot for your comments, Peter! My answers below. > > On Wed, Jul 22, 2020 at 04:45:36PM -0700, Peter Oskolkov wrote: > > This patchset is the first step to open-source this work. As explained > > in the linked pdf a

[PATCH for 5.9 1/3] futex: introduce FUTEX_SWAP operation

2020-07-22 Thread Peter Oskolkov
From: Peter Oskolkov As Paul Turner presented at LPC in 2013 ... - pdf: http://pdxplumbers.osuosl.org/2013/ocw//system/presentations/1653/original/LPC%20-%20User%20Threading.pdf - video: https://www.youtube.com/watch?v=KXuZi9aeGTw ... Google has developed an M:N userspace threading subsystem

[PATCH for 5.9 2/3] futex/sched: add wake_up_process_prefer_current_cpu, use in FUTEX_SWAP

2020-07-22 Thread Peter Oskolkov
From: Peter Oskolkov As described in the previous patch in this patchset ("futex: introduce FUTEX_SWAP operation"), it is often beneficial to wake a task and run it on the same CPU where the current going to sleep task it running. Internally at Google, switchto_switch sycall not onl

[PATCH for 5.9 3/3] selftests/futex: add futex_swap selftest

2020-07-22 Thread Peter Oskolkov
From: Peter Oskolkov This is the final patch in FUTEX_SWAP patchset. It adds a test/benchmark to validate behavior and compare performance of a new FUTEX_SWAP futex operation. Detailed API design and behavior considerations are provided in the commit messages of the previous two patches

[PATCH for 5.9 0/3] FUTEX_SWAP (tip/locking/core)

2020-07-22 Thread Peter Oskolkov
From: Peter Oskolkov As Paul Turner presented at LPC in 2013 ... - pdf: http://pdxplumbers.osuosl.org/2013/ocw//system/presentations/1653/original/LPC%20-%20User%20Threading.pdf - video: https://www.youtube.com/watch?v=KXuZi9aeGTw ... Google has developed an M:N userspace threading subsystem

Re: [RFC PATCH 2/4] rseq: Allow extending struct rseq

2020-07-14 Thread Peter Oskolkov
On Tue, Jul 14, 2020 at 10:43 AM Mathieu Desnoyers wrote: > > - On Jul 14, 2020, at 1:24 PM, Peter Oskolkov p...@posk.io wrote: > > > At Google, we actually extended struct rseq (I will post the patches > > here once they are fully deployed and we have specific > &g

Re: [RFC PATCH 2/4] rseq: Allow extending struct rseq

2020-07-14 Thread Peter Oskolkov
At Google, we actually extended struct rseq (I will post the patches here once they are fully deployed and we have specific benefits/improvements to report). We did this by adding several fields below __u32 flags (the last field currently), and correspondingly increasing rseq_len in rseq() syscall.

Re: [RFC PATCH 0/3 v3] futex/sched: introduce FUTEX_SWAP operation

2020-06-29 Thread Peter Oskolkov
Hi Thomas, Ingo! Do you have any comments/suggestions/objections here? FUTEX_SWAP seems to be quite useful for fast task context switching, and several teams at Google would like to see this capability upstreamed. Thanks, Peter On Wed, Jun 24, 2020 at 11:53 AM Peter Oskolkov wrote: > >

[RFC PATCH 1/3 v3] futex: introduce FUTEX_SWAP operation

2020-06-24 Thread Peter Oskolkov
From: Peter Oskolkov This is an RFC! As Paul Turner presented at LPC in 2013 ... - pdf: http://pdxplumbers.osuosl.org/2013/ocw//system/presentations/1653/original/LPC%20-%20User%20Threading.pdf - video: https://www.youtube.com/watch?v=KXuZi9aeGTw ... Google has developed an M:N userspace

[RFC PATCH 3/3] selftests/futex: add futex_swap selftest

2020-06-24 Thread Peter Oskolkov
From: Peter Oskolkov This is the final RFC patch in FUTEX_SWAP patchset. It adds a test/benchmark to validate behavior and compare performance of a new FUTEX_SWAP futex operation. Detailed API design and behavior considerations are provided in the commit messages of the previous two patches

[RFC PATCH 2/3 v3] futex/sched: add wake_up_process_prefer_current_cpu, use in FUTEX_SWAP

2020-06-24 Thread Peter Oskolkov
From: Peter Oskolkov This is an RFC! v2: fix undefined symbol error ifndef CONFIG_SMP, as Reported-by: kernel test robot As described in the previous patch in this patchset ("futex: introduce FUTEX_SWAP operation"), it is often beneficial to wake a task and run it on the same CPU

[RFC PATCH 0/3 v3] futex/sched: introduce FUTEX_SWAP operation

2020-06-24 Thread Peter Oskolkov
From: Peter Oskolkov This is an RFC! As Paul Turner presented at LPC in 2013 ... - pdf: http://pdxplumbers.osuosl.org/2013/ocw//system/presentations/1653/original/LPC%20-%20User%20Threading.pdf - video: https://www.youtube.com/watch?v=KXuZi9aeGTw ... Google has developed an M:N userspace

Re: [RFC PATCH 1/3 v2] futex: introduce FUTEX_SWAP operation

2020-06-23 Thread Peter Oskolkov
On Tue, Jun 23, 2020 at 12:45 PM Andrei Vagin wrote: > > On Tue, Jun 23, 2020 at 11:30:30AM -0700, Peter Oskolkov wrote: > ... > > > > /** > > > > +static int futex_swap(u32 __user *uaddr, unsigned int flags, u32 > > > > val, > > > &

Re: [RFC PATCH 1/3 v2] futex: introduce FUTEX_SWAP operation

2020-06-23 Thread Peter Oskolkov
Hi Aaron, thanks a lot for your tests and feedback! My comments below. Thanks, Peter On Tue, 2020-06-23 at 21:25 +0800, Aaron Lu wrote: > On Tue, Jun 16, 2020 at 10:22:26AM -0700, Peter Oskolkov wrote: > > static void futex_wait_queue_me(struct futex_hash_bucket *hb, > > st

[RFC PATCH 3/3 v2] selftests/futex: add futex_swap selftest

2020-06-16 Thread Peter Oskolkov
>From 7b091e46de4f9227b5a943e6d78283564e8c1c72 Mon Sep 17 00:00:00 2001 From: Peter Oskolkov Date: Tue, 2 Jun 2020 13:01:17 -0700 Subject: [RFC PATCH 3/3 v2] selftests/futex: add futex_swap selftest This is the final RFC patch in FUTEX_SWAP patchset. It adds a test/benchmark to validate behav

[RFC PATCH 1/3 v2] futex: introduce FUTEX_SWAP operation

2020-06-16 Thread Peter Oskolkov
>From 6fbe0261204692a7f488261ab3c4ac696b91db5c Mon Sep 17 00:00:00 2001 From: Peter Oskolkov Date: Tue, 9 Jun 2020 16:03:14 -0700 Subject: [RFC PATCH 1/3 v2] futex: introduce FUTEX_SWAP operation This is an RFC! As Paul Turner presented at LPC in 2013 ... - pdf: http://pdxplumbers.osuosl.

[RFC PATCH 0/3 v2] futex: introduce FUTEX_SWAP operation

2020-06-16 Thread Peter Oskolkov
>From 7b091e46de4f9227b5a943e6d78283564e8c1c72 Mon Sep 17 00:00:00 2001 From: Peter Oskolkov Date: Tue, 16 Jun 2020 10:13:58 -0700 Subject: [RFC PATCH 0/3 v2] futex: introduce FUTEX_SWAP operation This is an RFC! As Paul Turner presented at LPC in 2013 ... - pdf: http://pdxplumbers.osuosl.

[RFC PATCH 2/3 v2] futex, sched: add wake_up_swap, use in FUTEX_SWAP

2020-06-16 Thread Peter Oskolkov
>From abbd01d55ce1576d3e4d674ce96c581837801e10 Mon Sep 17 00:00:00 2001 From: Peter Oskolkov Date: Sun, 14 Jun 2020 17:08:00 -0700 Subject: [RFC PATCH 2/3 v2] futex, sched: add wake_up_swap, use in FUTEX_SWAP This is an RFC! v2: fix undefined symbol error ifndef CONFIG_SMP, as Reported

[RFC PATCH 0/3] futex/sched: introduce FUTEX_SWAP operation

2020-06-15 Thread Peter Oskolkov
>From 42709b7f82d38c573fc1ff5f5aa7d0065ee54b82 Mon Sep 17 00:00:00 2001 From: Peter Oskolkov Date: Mon, 15 Jun 2020 10:17:36 -0700 Subject: [RFC PATCH 0/3] futex/sched: introduce FUTEX_SWAP operation As Paul Turner presented at LPC in 2013 ... - pdf: http://pdxplumbers.osuosl.org/2013/

[RFC PATCH 2/3] futex, sched: add wake_up_swap, use in FUTEX_SWAP

2020-06-15 Thread Peter Oskolkov
>From 2e5a6e670f4d5f5ab94893fe0bff17150b56c142 Mon Sep 17 00:00:00 2001 From: Peter Oskolkov Date: Sun, 14 Jun 2020 17:08:00 -0700 Subject: [RFC PATCH 2/3] futex, sched: add wake_up_swap, use in FUTEX_SWAP This is an RFC! As described in the previous patch in this patchset ("futex: i

[RFC PATCH 1/3] futex: introduce FUTEX_SWAP operation

2020-06-15 Thread Peter Oskolkov
>From 6fbe0261204692a7f488261ab3c4ac696b91db5c Mon Sep 17 00:00:00 2001 From: Peter Oskolkov Date: Tue, 9 Jun 2020 16:03:14 -0700 Subject: [RFC PATCH 1/3] futex: introduce FUTEX_SWAP operation This is an RFC! As Paul Turner presented at LPC in 2013 ... - pdf: http://pdxplumbers.osuosl.org/2

[RFC PATCH 3/3] selftests/futex: add futex_swap selftest

2020-06-15 Thread Peter Oskolkov
>From 42709b7f82d38c573fc1ff5f5aa7d0065ee54b82 Mon Sep 17 00:00:00 2001 From: Peter Oskolkov Date: Tue, 2 Jun 2020 13:01:17 -0700 Subject: [RFC PATCH 3/3] selftests/futex: add futex_swap selftest This is the final RFC patch in FUTEX_SWAP patchset. It adds a test/benchmark to validate behav

[PATCH] smp: fix a comment typo.

2020-05-27 Thread Peter Oskolkov
>From b93e86294d30f58440762106e517d9467f4f3b69 Mon Sep 17 00:00:00 2001 From: Peter Oskolkov Date: Wed, 27 May 2020 10:23:07 -0700 Subject: [PATCH] smp: fix a comment typo. Fix a typo in a comment. Signed-off-by: Peter Oskolkov --- include/linux/smp.h | 2 +- 1 file changed, 1 insertion(+)

Re: [PATCH] sched/fair: Introduce fits_capacity()

2019-06-04 Thread Peter Oskolkov
On Tue, Jun 4, 2019 at 12:02 AM Viresh Kumar wrote: > > The same formula to check utilization against capacity (after > considering capacity_margin) is already used at 5 different locations. > > This patch creates a new macro, fits_capacity(), which can be used from > all these locations without e

Re: [RFC PATCH v3 16/16] sched: Debug bits...

2019-05-29 Thread Peter Oskolkov
On Wed, May 29, 2019 at 1:37 PM Vineeth Remanan Pillai wrote: > > From: Peter Zijlstra > > Not-Signed-off-by: Peter Zijlstra (Intel) No commit message, not-signed-off-by... > --- > kernel/sched/core.c | 44 ++-- > 1 file changed, 42 insertions(+), 2 del

Re: linux-next: Tree for Feb 15 (net/core/lwt_bpf.c)

2019-02-15 Thread Peter Oskolkov
On Fri, Feb 15, 2019 at 8:48 AM Randy Dunlap wrote: > > On 2/14/19 10:03 PM, Stephen Rothwell wrote: > > Hi all, > > > > Changes since 20190214: > > > > on x86_64: > > ld: net/core/lwt_bpf.o: in function `bpf_lwt_xmit_reroute': > lwt_bpf.c:(.text+0x11e): undefined reference to `ip_route_output_flo

Re: linux-next: Tree for Feb 15 (net/core/lwt_bpf.c)

2019-02-15 Thread Peter Oskolkov
On Fri, Feb 15, 2019 at 8:48 AM Randy Dunlap wrote: > > On 2/14/19 10:03 PM, Stephen Rothwell wrote: > > Hi all, > > > > Changes since 20190214: > > > > on x86_64: > > ld: net/core/lwt_bpf.o: in function `bpf_lwt_xmit_reroute': > lwt_bpf.c:(.text+0x11e): undefined reference to `ip_route_output_flo

Re: [net] eedbbb0d98: RIP:inet_hashinfo2_init

2018-12-24 Thread Peter Oskolkov
A fix sent to netdev: https://patchwork.ozlabs.org/patch/1018304/ On Mon, Dec 24, 2018 at 5:01 AM kernel test robot wrote: > > > FYI, we noticed the following commit (built with gcc-7): > > commit: eedbbb0d98b2a89250a8bb83d9c71b77881e5247 ("net: dccp: initialize > (addr,port) listening hashtable