Received: from fanzine2.igalia.com (fanzine.igalia.com [178.60.130.6]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DD16B55887 for ; Mon, 27 Jan 2025 20:26:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=178.60.130.6 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738009599; cv=none; b=eTiMjKGBHAlWezFBs3RzK2eoRBjOhtLz9SyEVLHwrStG074//wV23AKxtnDvZ03VTLNmnw3CLXz6AtrMWkOTwuN5fMmF8KBw9OBlXRC0EVOh7OPeIn3oEKDpiT0y/v6sZszIGP5dbFlJHo0gqGAdlLsJSjcAP3Cfnj6tFMkKYjQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1738009599; c=relaxed/simple; bh=jWyKCZYsijhPS3g5GNZtXcFLojQuEhFiKjGCnzL8XQ4=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version:Content-Type; b=l84xJS/JJg62RwYE+b+/kVjbTba61GRfDTkUqlp4UoAUAefobaKXICBSXvey06UVggzw7QSBqLmh51iRe5izHjfZU0xZVL5EoDq3uC/y5UVh8b3yuC8M2ZSrov6e90ryNZpIxfATkdDfO/hNGoowCXq2ytqZhIWgJW4kKwRCxaY= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com; spf=pass smtp.mailfrom=igalia.com; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b=TMUoh3PQ; arc=none smtp.client-ip=178.60.130.6 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=igalia.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=igalia.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=igalia.com header.i=@igalia.com header.b="TMUoh3PQ" DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=igalia.com; s=20170329; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Message-ID: Date:Subject:Cc:To:From:Sender:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=QxGIMgkbxUbbAuqUmrNEAOh1G1LSeuq/m8twhsk9lh4=; b=TMUoh3PQ6cXetf+WBhUVFxGb/q gSI/XhpOrQa+TN1QKJ0LbES6ZbnnOLzFYia41L21kEJBds+byaNuL9I/sY8gMkr1nedKtvKT0FZX3 2SosN9e7XvVfs4mXGUWRiUyV8tSoL9qq+uBeJ5NtVpNIOi8VuVJ7P7TvBDUlvcYxpH8ul0p3wEHos gtLoEyKneJ4s9KkFTh+KNQbyPK1yN5Nhy1TsfqZMray5YagCMe5uUgSqHvfm0ihyT1CqjWPk89Isr 2E0m8r2ADkj4H5PIxtulTksTcKfGrYJ2sDGVajjTLPx2d7S++T77GM4prxLFP1LwyFXf6LRxKHRI/ oW21Yx+w==; Received: from 189-68-33-219.dsl.telesp.net.br ([189.68.33.219] helo=localhost.localdomain) by fanzine2.igalia.com with esmtpsa (Cipher TLS1.3:ECDHE_X25519__RSA_PSS_RSAE_SHA256__AES_256_GCM:256) (Exim) id 1tcVgX-003OPi-Mi; Mon, 27 Jan 2025 21:26:17 +0100 From: =?UTF-8?q?Andr=C3=A9=20Almeida?= To: Thomas Gleixner , Ingo Molnar , Peter Zijlstra , Darren Hart , Davidlohr Bueso , Arnd Bergmann , Florian Weimer Cc: linux-kernel@vger.kernel.org, kernel-dev@igalia.com, Vinicius Peixoto , =?UTF-8?q?Andr=C3=A9=20Almeida?= Subject: [PATCH v2 0/4] futex: Drop ROBUST_LIST_LIMIT Date: Mon, 27 Jan 2025 17:26:04 -0300 Message-ID: <20250127202608.223864-1-andrealmeid@igalia.com> X-Mailer: git-send-email 2.48.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit As requested by Peter at [1], this patchset drops the ROBUST_LIST_LIMIT. This is achieve by simply rewriting the processed list element ->next to point to the head->list address, destroying the linked list to avoid any circular list. Patches 2-4 create selftest for robust lists. Patch 2/4 creates helpful macros for futex selftests and 3/4 creates a bunch of tests for the interface (as I had submitted before at [2]). Patch 4/4 is used to validate the changes made at 1/4: - That the kernel can now handle a lock that is allocated in an index bigger than ROBUST_LIST_LIMIT - That the kernel can still handle circular linked lists. [1] https://lore.kernel.org/lkml/20241219171344.GA26279@noisy.programming.kicks-ass.net/ [2] https://lore.kernel.org/lkml/20241212210436.112076-1-andrealmeid@igalia.com/ Changelog: - Rebased on top of tip/locking/urgent (for 6.14-rc1) v1: https://lore.kernel.org/lkml/20250110200508.353290-1-andrealmeid@igalia.com/#t André Almeida (4): futex: Drop ROBUST_LIST_LIMIT selftests/futex: Add ASSERT_ macros selftests/futex: Create test for robust list selftests/futex: Create tests for long and circular robust lists include/uapi/linux/futex.h | 3 +- kernel/futex/core.c | 13 +- .../selftests/futex/functional/.gitignore | 1 + .../selftests/futex/functional/Makefile | 3 +- .../selftests/futex/functional/robust_list.c | 641 ++++++++++++++++++ .../testing/selftests/futex/include/logging.h | 38 ++ 6 files changed, 690 insertions(+), 9 deletions(-) create mode 100644 tools/testing/selftests/futex/functional/robust_list.c -- 2.48.0