can't find file to patch at input line 148 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |From patchwork Thu Jun 3 19:59:13 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: 43669 |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 37168382E830 | for ; Thu, 3 Jun 2021 20:04:22 +0000 (GMT) |DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 37168382E830 |DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; | s=default; t=1622750662; | bh=WR4y69Q5ZCqqWn3ihf4J7EdCK2/S/j1RAY5AcDxJmCI=; | 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=MZkhw6HCoJRxWewkvR3GSec1glzL70QnAw3v6vgRqtO1Uuoogx3I+nrVxfwo90CQY | vQYBNVRV+6slDb5tLB/bM/xttxbjzZZCSnXrFupC96rq6I6oPueFQWecVZXvPmGR6d | yYrzIHkxIwx2bsnTznbqFaUDl5J18y5mPHuyFrgs= |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 54BE5398EC13 | for ; Thu, 3 Jun 2021 20:00:37 +0000 (GMT) |DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 54BE5398EC13 |Received: from [127.0.0.1] (localhost [127.0.0.1]) | (Authenticated sender: tonyk) with ESMTPSA id 1B87A1F43504 |To: Thomas Gleixner , Ingo Molnar , | Peter Zijlstra , Darren Hart , | linux-kernel@vger.kernel.org, Steven Rostedt , | Sebastian Andrzej Siewior |Subject: [PATCH v4 04/15] futex2: Implement requeue operation |Date: Thu, 3 Jun 2021 16:59:13 -0300 |Message-Id: <20210603195924.361327-5-andrealmeid@collabora.com> |X-Mailer: git-send-email 2.31.1 |In-Reply-To: <20210603195924.361327-1-andrealmeid@collabora.com> |References: <20210603195924.361327-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.2 |X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) 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?= , | 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 *uaddr1, struct futex_requeue *uaddr2, | unsigned int nr_wake, unsigned int nr_requeue, | u64 cmpval, unsigned int flags) | |struct futex_requeue { | void *uaddr; | unsigned int flags; |}; | |If (uaddr1->uaddr == cmpval), wake at uaddr1->uaddr a nr_wake number of |waiters and then, remove a number of nr_requeue waiters at uaddr1->uaddr |and add them to uaddr2->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(). |- *uaddr1 and *uaddr2 are used as void* (instead of struct | futex_requeue) just like wait/wake(). | |In that way, we could avoid the copy_from_user(). |--- | arch/arm/tools/syscall.tbl | 1 + | arch/arm64/include/asm/unistd.h | 2 +- | arch/arm64/include/asm/unistd32.h | 2 + | arch/x86/entry/syscalls/syscall_32.tbl | 1 + | arch/x86/entry/syscalls/syscall_64.tbl | 1 + | include/linux/compat.h | 12 + | include/linux/syscalls.h | 5 + | include/uapi/asm-generic/unistd.h | 5 +- | include/uapi/linux/futex.h | 10 + | kernel/futex2.c | 208 ++++++++++++++++++ | kernel/sys_ni.c | 2 + | .../arch/x86/entry/syscalls/syscall_64.tbl | 1 + | 12 files changed, 248 insertions(+), 2 deletions(-) | |diff --git a/arch/arm/tools/syscall.tbl b/arch/arm/tools/syscall.tbl |index 6e476c34bd00..25f175ada125 100644 |--- a/arch/arm/tools/syscall.tbl |+++ b/arch/arm/tools/syscall.tbl -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 157 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/arch/arm64/include/asm/unistd.h b/arch/arm64/include/asm/unistd.h |index 6bdb5f5db438..4e65da3445c7 100644 |--- a/arch/arm64/include/asm/unistd.h |+++ b/arch/arm64/include/asm/unistd.h -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 170 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/arch/arm64/include/asm/unistd32.h b/arch/arm64/include/asm/unistd32.h |index 729083a76472..3c16e0d742ac 100644 |--- a/arch/arm64/include/asm/unistd32.h |+++ b/arch/arm64/include/asm/unistd32.h -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored can't find file to patch at input line 183 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |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 192 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..a1a39ed156e8 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 204 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 78e3c8d9689c..1425ef149dda 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 234 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/include/linux/syscalls.h b/include/linux/syscalls.h |index a24193d8b180..c108df6b3b82 100644 |--- a/include/linux/syscalls.h |+++ b/include/linux/syscalls.h -------------------------- No file to patch. Skipping patch. 2 out of 2 hunks ignored can't find file to patch at input line 257 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 debe684f648f..5455c0be7798 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 274 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 ca019b682b2e..06ea9bdfa69e 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 patching file kernel/futex2.c can't find file to patch at input line 514 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 can't find file to patch at input line 527 Perhaps you used the wrong -p or --strip option? The text leading up to this was: -------------------------- |diff --git a/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl b/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl |index a5336eeffe45..dd371799843c 100644 |--- a/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl |+++ b/tools/perf/arch/x86/entry/syscalls/syscall_64.tbl -------------------------- No file to patch. Skipping patch. 1 out of 1 hunk ignored