can't find file to patch at input line 147 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |From patchwork Fri Jul 9 00:13:20 2021 |Content-Type: text/plain; charset="utf-8" |MIME-Version: 1.0 |Content-Transfer-Encoding: 8bit |X-Patchwork-Submitter: =?utf-8?q?Andr=C3=A9_Almeida?= | |X-Patchwork-Id: 44279 |Return-Path: |X-Original-To: patchwork@sourceware.org |Delivered-To: patchwork@sourceware.org |Received: from server2.sourceware.org (localhost [IPv6:::1]) | by sourceware.org (Postfix) with ESMTP id 026D1385741D | for ; Fri, 9 Jul 2021 00:16:42 +0000 (GMT) |DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 026D1385741D |DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; | s=default; t=1625789802; | bh=7vZmKfITdR7e0tr64RbVQt1huzWJkWy2O4HlRBTAJ90=; | h=To:Subject:Date:In-Reply-To:References:List-Id:List-Unsubscribe: | List-Archive:List-Post:List-Help:List-Subscribe:From:Reply-To:Cc: | From; | b=fbnEnPuzfD3BEd5LJlnJlTLliz1ZEa+52zbtpCm9rDLdv5J8XQE9C5RkVYIEtrV1V | HUNjefZuFlRz1A0BFk0b9+NDqud7MACnP6YNXi8fwIE0vpTTb6pq1acm8EM4DElKH6 | 0LqwRmvMjgMjSxwPrZbXjuhckRq7pdFjjJB1zUN0= |X-Original-To: libc-alpha@sourceware.org |Delivered-To: libc-alpha@sourceware.org |Received: from bhuna.collabora.co.uk (bhuna.collabora.co.uk | [IPv6:2a00:1098:0:82:1000:25:2eeb:e3e3]) | by sourceware.org (Postfix) with ESMTPS id B21FB3982CB0 | for ; Fri, 9 Jul 2021 00:14:14 +0000 (GMT) |DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B21FB3982CB0 |Received: from [127.0.0.1] (localhost [127.0.0.1]) | (Authenticated sender: tonyk) with ESMTPSA id C3F5E1F421A2 |To: Thomas Gleixner , Ingo Molnar , | Peter Zijlstra , Darren Hart , | linux-kernel@vger.kernel.org, Steven Rostedt , | Sebastian Andrzej Siewior |Subject: [PATCH v5 03/11] futex2: Implement requeue operation |Date: Thu, 8 Jul 2021 21:13:20 -0300 |Message-Id: <20210709001328.329716-4-andrealmeid@collabora.com> |X-Mailer: git-send-email 2.32.0 |In-Reply-To: <20210709001328.329716-1-andrealmeid@collabora.com> |References: <20210709001328.329716-1-andrealmeid@collabora.com> |MIME-Version: 1.0 |X-Spam-Status: No, score=-12.1 required=5.0 tests=BAYES_00, GIT_PATCH_0, | KAM_DMARC_STATUS, KAM_MANYTO, SPF_HELO_PASS, SPF_PASS, TXREP, | UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 |X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on | server2.sourceware.org |X-BeenThere: libc-alpha@sourceware.org |X-Mailman-Version: 2.1.29 |Precedence: list |List-Id: Libc-alpha mailing list |List-Unsubscribe: , | |List-Archive: |List-Post: |List-Help: |List-Subscribe: , | |X-Patchwork-Original-From: =?utf-8?q?Andr=C3=A9_Almeida_via_Libc-alpha?= | |From: =?utf-8?q?Andr=C3=A9_Almeida?= |Reply-To: =?utf-8?q?Andr=C3=A9_Almeida?= |Cc: fweimer@redhat.com, shuah@kernel.org, Davidlohr Bueso , | libc-alpha@sourceware.org, corbet@lwn.net, linux-api@vger.kernel.org, | z.figura12@gmail.com, | =?utf-8?q?Andr=C3=A9_Almeida?= , | Nicholas Piggin , malteskarupke@fastmail.fm, | acme@kernel.org, linux-kselftest@vger.kernel.org, | Andrey Semashev , joel@joelfernandes.org, | Peter Oskolkov , kernel@collabora.com, krisman@collabora.com, | pgriffais@valvesoftware.com |Errors-To: libc-alpha-bounces+patchwork=sourceware.org@sourceware.org |Sender: "Libc-alpha" | | |Implement requeue interface similarly to FUTEX_CMP_REQUEUE operation. | |This is the syscall implemented by this patch: | |futex_requeue(struct futex_requeue *rq1, struct futex_requeue *rq2, | unsigned int nr_wake, unsigned int nr_requeue, | u64 cmpval, unsigned int flags) | |struct futex_requeue { | void *uaddr; | unsigned int flags; |}; | |If (rq1->uaddr == cmpval), wake at rq1->uaddr a nr_wake number of |waiters and then, remove a number of nr_requeue waiters at rq1->uaddr |and add them to rq2->uaddr list. Each uaddr has its own set of flags, |that must be defined at struct futex_requeue (such as size, shared, NUMA). |The flags argument of the syscall is there just for the sake of |extensibility, and right now it needs to be zero. | |Return the number of the woken futexes + the number of requeued ones on |success, error code otherwise. | |Signed-off-by: André Almeida |--- | |The original FUTEX_CMP_REQUEUE interfaces is such as follows: | |futex(*uaddr1, FUTEX_CMP_REQUEUE, nr_wake, nr_requeue, *uaddr2, cmpval); | |Given that when this interface was created they was only one type of |futex (as opposed to futex2, where there is shared, sizes, and NUMA), |there was no way to specify individual flags for uaddr1 and 2. When |FUTEX_PRIVATE was implemented, a new opcode was created as well |(FUTEX_CMP_REQUEUE_PRIVATE), but they apply both futexes, so they |should be of the same type regarding private/shared. This imposes a |limitation on the use cases of the operation, and to overcome that at futex2, |`struct futex_requeue` was created, so one can set individual flags for |each futex. This flexibility is a trade-off with performance, given that |now we need to perform two extra copy_from_user(). One alternative would |be to use the upper half of flags bits to the first one, and the bottom |half for the second futex, but this would also impose limitations, given |that we would limit by half the flags possibilities. If equal futexes |are common enough, the following extension could be added to overcome |the current performance: | |- A flag FUTEX_REQUEUE_EQUAL is added to futex2() flags; |- If futex_requeue() see this flag, that means that both futexes uses | the same set of attributes. |- Then, the function parses the flags as of futex_wait/wake(). |- *rq1 and *rq2 are used as void* (instead of struct | futex_requeue) just like wait/wake(). | |In that way, we could avoid the copy_from_user(). |--- | arch/x86/entry/syscalls/syscall_32.tbl | 1 + | arch/x86/entry/syscalls/syscall_64.tbl | 1 + | include/linux/compat.h | 10 +++ | include/linux/futex.h | 3 + | include/uapi/asm-generic/unistd.h | 4 +- | include/uapi/linux/futex.h | 10 +++ | kernel/futex.c | 18 ++-- | kernel/futex2.c | 111 +++++++++++++++++++++++++ | kernel/sys_ni.c | 2 + | 9 files changed, 150 insertions(+), 10 deletions(-) | |diff --git a/arch/x86/entry/syscalls/syscall_32.tbl b/arch/x86/entry/syscalls/syscall_32.tbl |index 5573437c1914..f02c3da76945 100644 |--- a/arch/x86/entry/syscalls/syscall_32.tbl |+++ b/arch/x86/entry/syscalls/syscall_32.tbl -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 156 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/arch/x86/entry/syscalls/syscall_64.tbl b/arch/x86/entry/syscalls/syscall_64.tbl |index bad4aca3e9ba..8815c0de5d05 100644 |--- a/arch/x86/entry/syscalls/syscall_64.tbl |+++ b/arch/x86/entry/syscalls/syscall_64.tbl -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 168 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/include/linux/compat.h b/include/linux/compat.h |index 75b90e41e05b..861616de6d75 100644 |--- a/include/linux/compat.h |+++ b/include/linux/compat.h -------------------------- No file to patch. Skipping patch. 2 out of 2 hunks ignored can't find file to patch at input line 196 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/include/linux/futex.h b/include/linux/futex.h |index 7afef5bb3da2..95afac7b2f76 100644 |--- a/include/linux/futex.h |+++ b/include/linux/futex.h -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 210 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/include/uapi/asm-generic/unistd.h b/include/uapi/asm-generic/unistd.h |index 57acb3a0f69f..89a480490dca 100644 |--- a/include/uapi/asm-generic/unistd.h |+++ b/include/uapi/asm-generic/unistd.h -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 227 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/include/uapi/linux/futex.h b/include/uapi/linux/futex.h |index daa135bdedda..7effdd568699 100644 |--- a/include/uapi/linux/futex.h |+++ b/include/uapi/linux/futex.h -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 248 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/kernel/futex.c b/kernel/futex.c |index 135782fc3461..7e6d70195d8a 100644 |--- a/kernel/futex.c |+++ b/kernel/futex.c -------------------------- No file to patch. Skipping patch. 5 out of 5 hunks ignored patching file kernel/futex2.c can't find file to patch at input line 427 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/kernel/sys_ni.c b/kernel/sys_ni.c |index 93807bb7be51..20a425b79fca 100644 |--- a/kernel/sys_ni.c |+++ b/kernel/sys_ni.c -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored