From patchwork Fri Jul 21 10:22:37 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Zijlstra X-Patchwork-Id: 13321854 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 055DAEB64DC for ; Fri, 21 Jul 2023 10:58:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 8CCE52801B8; Fri, 21 Jul 2023 06:58:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 8562E2801B7; Fri, 21 Jul 2023 06:58:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5E5172801B5; Fri, 21 Jul 2023 06:58:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 4E8E52801A0 for ; Fri, 21 Jul 2023 06:58:52 -0400 (EDT) Received: from smtpin05.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay07.hostedemail.com (Postfix) with ESMTP id 1EC96160141 for ; Fri, 21 Jul 2023 10:58:52 +0000 (UTC) X-FDA: 81035321304.05.0EAB5A0 Received: from casper.infradead.org (casper.infradead.org [90.155.50.34]) by imf25.hostedemail.com (Postfix) with ESMTP id 1875FA0008 for ; Fri, 21 Jul 2023 10:58:49 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=cqAvjtTn; dmarc=none; spf=none (imf25.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1689937130; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:content-type: content-transfer-encoding:in-reply-to:references:dkim-signature; bh=lcLLsfwzzryhPpNrplrfD7AaAzzB68vL86jiPn1J03c=; b=LZ58cTuvFuZKa5ny8NeP8E/vaLkXLBrJOYeomW7WApiI90YyjsXsV0Q01EYGGRfr5eFt5X C6rUndeJ41PRgYK5uEyzNatSm3w5U+aPxW4Nxjitej4wu/3tEQ83N+IBSBJ7wxKn8XxQUe UgkkmJQMFjoMYC3pltG08XwXNzJZ5u4= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=infradead.org header.s=casper.20170209 header.b=cqAvjtTn; dmarc=none; spf=none (imf25.hostedemail.com: domain of peterz@infradead.org has no SPF policy when checking 90.155.50.34) smtp.mailfrom=peterz@infradead.org ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1689937130; a=rsa-sha256; cv=none; b=ILEAxmV4j1/bRC5VHHa9GxvZN5QJ4+VOobw659e5zz+Lu9Ve1FIS1iRcjpIGOhyYonmhCL wVCwERWSgmbD9lzE2Daexwg5yIAfx65aNlIOmHghBio9mCfMrlqOGdAnGavEC9cAxGqW3m tNRXGde0ZK7dPJzS9OH1/xHitmnArAg= DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Subject:Cc:To:From:Date:Message-ID: Sender:Reply-To:MIME-Version:Content-Type:Content-Transfer-Encoding: Content-ID:Content-Description:In-Reply-To:References; bh=lcLLsfwzzryhPpNrplrfD7AaAzzB68vL86jiPn1J03c=; b=cqAvjtTnCh22vJ3NZdY19uUDsT dakjp3WQqIb36goKS8vtFbnrBGEX+A8D46mL4l+0REZrWulK7bUMhE1x9fQ3FwrnUntSuk+Xu2UxQ qkcNpB///bEL+HrWTuIasMjrcwrVCG2BGgegmSRiW9RyJ/2poSkGzxkGyb25iXtZzEYutcLHzkfXo 7KFx1RgOIbRY8tl4f2BQ4Ytfp7JGSSj02vTTCJpYycrfdT7uTZCLerKV9YgNlTZRFWMS7h3GmNArb rcSFx2w6Gs+GCznImEvRaZdu48G4/VUb25W6NimdzeLOEcDhS190Buw03eBFpTjs0+b1vc9Dofzaa weE6UOCw==; Received: from j130084.upc-j.chello.nl ([24.132.130.84] helo=noisy.programming.kicks-ass.net) by casper.infradead.org with esmtpsa (Exim 4.94.2 #2 (Red Hat Linux)) id 1qMnqJ-0012OT-JX; Fri, 21 Jul 2023 10:58:40 +0000 Received: from hirez.programming.kicks-ass.net (hirez.programming.kicks-ass.net [192.168.1.225]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by noisy.programming.kicks-ass.net (Postfix) with ESMTPS id 3024F3007AF; Fri, 21 Jul 2023 12:58:38 +0200 (CEST) Received: by hirez.programming.kicks-ass.net (Postfix, from userid 0) id E256F314E02ED; Fri, 21 Jul 2023 12:58:37 +0200 (CEST) Message-ID: <20230721102237.268073801@infradead.org> User-Agent: quilt/0.66 Date: Fri, 21 Jul 2023 12:22:37 +0200 From: Peter Zijlstra To: tglx@linutronix.de, axboe@kernel.dk Cc: linux-kernel@vger.kernel.org, peterz@infradead.org, mingo@redhat.com, dvhart@infradead.org, dave@stgolabs.net, andrealmeid@igalia.com, Andrew Morton , urezki@gmail.com, hch@infradead.org, lstoakes@gmail.com, Arnd Bergmann , linux-api@vger.kernel.org, linux-mm@kvack.org, linux-arch@vger.kernel.org, malteskarupke@web.de Subject: [PATCH v1 00/14] futex: More futex2 bits X-Rspamd-Server: rspam09 X-Rspamd-Queue-Id: 1875FA0008 X-Stat-Signature: brg9tfsioy4goxz8uf7t8jh3178ft58i X-Rspam-User: X-HE-Tag: 1689937129-584566 X-HE-Meta: U2FsdGVkX18P6Ym7HfmI7Zaf5DioNjkF0tE4gXhjV8hgCiVf8YwsSRL+DNSrR510G3N/M0QEotG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ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Hi, New version of the futex2 patches. These are actually tested and appear to work as expected. I'm hoping to get at least the first 3 patches merged such that Jens can base the io_uring futex patches on them. Changes since v0: - switched over to 'unsigned long' for values (Arnd) - unshare vmalloc_huge() (Willy) - added wait/requeue syscalls - fixed NUMA to support sparse nodemask - added FUTEX2_n vs FUTEX2_NUMA check to ensure the node_id fits in the futex - added selftests - fixed a ton of silly bugs --- arch/alpha/kernel/syscalls/syscall.tbl | 3 + arch/arm/tools/syscall.tbl | 3 + arch/arm64/include/asm/unistd32.h | 6 + arch/ia64/kernel/syscalls/syscall.tbl | 3 + arch/m68k/kernel/syscalls/syscall.tbl | 3 + arch/microblaze/kernel/syscalls/syscall.tbl | 3 + arch/mips/kernel/syscalls/syscall_n32.tbl | 3 + arch/mips/kernel/syscalls/syscall_n64.tbl | 3 + arch/mips/kernel/syscalls/syscall_o32.tbl | 3 + arch/parisc/kernel/syscalls/syscall.tbl | 3 + arch/powerpc/kernel/syscalls/syscall.tbl | 3 + arch/s390/kernel/syscalls/syscall.tbl | 3 + arch/sh/kernel/syscalls/syscall.tbl | 3 + arch/sparc/kernel/syscalls/syscall.tbl | 3 + arch/x86/entry/syscalls/syscall_32.tbl | 3 + arch/x86/entry/syscalls/syscall_64.tbl | 3 + arch/xtensa/kernel/syscalls/syscall.tbl | 3 + include/linux/futex.h | 14 +- include/linux/syscalls.h | 10 + include/linux/vmalloc.h | 1 + include/uapi/asm-generic/unistd.h | 9 +- include/uapi/linux/futex.h | 17 +- kernel/futex/core.c | 144 +++++++++++--- kernel/futex/futex.h | 96 ++++++++- kernel/futex/pi.c | 12 +- kernel/futex/requeue.c | 18 +- kernel/futex/syscalls.c | 221 ++++++++++++++++----- kernel/futex/waitwake.c | 80 ++++---- kernel/sys_ni.c | 3 + mm/vmalloc.c | 7 + .../selftests/futex/functional/futex_requeue.c | 100 +++++++++- .../selftests/futex/functional/futex_wait.c | 56 +++++- .../futex/functional/futex_wait_timeout.c | 14 +- .../futex/functional/futex_wait_wouldblock.c | 28 ++- .../selftests/futex/functional/futex_waitv.c | 15 +- tools/testing/selftests/futex/functional/run.sh | 6 + tools/testing/selftests/futex/include/futex2test.h | 39 ++++ 37 files changed, 777 insertions(+), 167 deletions(-)