Message ID | 20241008135034.1982519-1-mathieu.desnoyers@efficios.com (mailing list archive) |
---|---|
Headers | show
Return-Path: <owner-linux-mm@kvack.org> 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 1503CCEF173 for <linux-mm@archiver.kernel.org>; Tue, 8 Oct 2024 13:52:45 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 997D86B0096; Tue, 8 Oct 2024 09:52:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 91B256B0093; Tue, 8 Oct 2024 09:52:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7E0AA6B0095; Tue, 8 Oct 2024 09:52:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id 5EE8E6B0089 for <linux-mm@kvack.org>; Tue, 8 Oct 2024 09:52:44 -0400 (EDT) Received: from smtpin07.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 63F1DACCBA for <linux-mm@kvack.org>; Tue, 8 Oct 2024 13:52:41 +0000 (UTC) X-FDA: 82650575448.07.91453A1 Received: from smtpout.efficios.com (smtpout.efficios.com [167.114.26.122]) by imf24.hostedemail.com (Postfix) with ESMTP id 4EDAD180025 for <linux-mm@kvack.org>; Tue, 8 Oct 2024 13:52:42 +0000 (UTC) Authentication-Results: imf24.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=V+pRK6MX; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf24.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728395536; a=rsa-sha256; cv=none; b=wYXGlUkLO/ITFyOTYsxx1tbn5U9K1PLK86y/H4X5Z0Gxavw8PiIJHKNzATAYWuyZBNJ1XH bpEHRbVk6jz1yJw0fua9BZzuk1AzOyGnR9w0/8qE/As+PLcpiKnXbsP5YRTtG06TQ/4NCD 0NhpiBQeyBUC9ZF/aL0AIgWOefbYY0k= ARC-Authentication-Results: i=1; imf24.hostedemail.com; dkim=pass header.d=efficios.com header.s=smtpout1 header.b=V+pRK6MX; dmarc=pass (policy=none) header.from=efficios.com; spf=pass (imf24.hostedemail.com: domain of mathieu.desnoyers@efficios.com designates 167.114.26.122 as permitted sender) smtp.mailfrom=mathieu.desnoyers@efficios.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728395536; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=wgV2+7MfZdUlRSibwZ/xMy3YdayQbJLzKgyLHwme9rI=; b=ACj00twkrFZym2MqrjFFgB/Y6csmjLjEvcmzmYdzDBLxP1yNa0eN64ImEXkOZAzBzfvH7h EA/PquPy3HQGlHGwu91ybzp1z5oezZBJJ62K0QHMkun3s5vLypF5Y8SMCo2+O1XDteFYto 3v5ArOqhxXOhirdDYi+tsn7lidRXwbk= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=efficios.com; s=smtpout1; t=1728395561; bh=FurOAuuDNyUm/lojkmHDOe6nk3DPDbcIuia0hHtIFVU=; h=From:To:Cc:Subject:Date:From; b=V+pRK6MX3xsgw8mxC5ocgt9ecpxOaeYcizHJSHxGqKPMB55/9+VVRyH9/BYKf0/WU XCehtZvwFLdGZX/66cztTUcV4wgveUeHlWDezPzi/wkbZchF1sV+l1th68dF/+I6aK llRpK/GzhQa6Pgsq+ofQZL/XxPGJ1rjsQSt7Q8ApI5LeDq7tlRP08bG20BL8U8e0pe yGz5e3/I1IgzfXIHWgrKByaJzrdjcVMQ9p2MMDjR1M0KPzpLVis9Zsq411lu97IUu9 cUmQLDT4zwhuwsGaE3W5RGABiDB9Dknne7FMg+T+41f8OLi3mgqe7puL+Qafdu257a FO7e4tun0B3mw== Received: from thinkos.internal.efficios.com (96-127-217-162.qc.cable.ebox.net [96.127.217.162]) by smtpout.efficios.com (Postfix) with ESMTPSA id 4XNHX8539XzLqn; Tue, 8 Oct 2024 09:52:40 -0400 (EDT) From: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> To: Boqun Feng <boqun.feng@gmail.com> Cc: linux-kernel@vger.kernel.org, Mathieu Desnoyers <mathieu.desnoyers@efficios.com>, Linus Torvalds <torvalds@linux-foundation.org>, Andrew Morton <akpm@linux-foundation.org>, Peter Zijlstra <peterz@infradead.org>, Nicholas Piggin <npiggin@gmail.com>, Michael Ellerman <mpe@ellerman.id.au>, Greg Kroah-Hartman <gregkh@linuxfoundation.org>, Sebastian Andrzej Siewior <bigeasy@linutronix.de>, "Paul E. McKenney" <paulmck@kernel.org>, Will Deacon <will@kernel.org>, Alan Stern <stern@rowland.harvard.edu>, John Stultz <jstultz@google.com>, Neeraj Upadhyay <Neeraj.Upadhyay@amd.com>, Frederic Weisbecker <frederic@kernel.org>, Joel Fernandes <joel@joelfernandes.org>, Josh Triplett <josh@joshtriplett.org>, Uladzislau Rezki <urezki@gmail.com>, Steven Rostedt <rostedt@goodmis.org>, Lai Jiangshan <jiangshanlai@gmail.com>, Zqiang <qiang.zhang1211@gmail.com>, Ingo Molnar <mingo@redhat.com>, Waiman Long <longman@redhat.com>, Mark Rutland <mark.rutland@arm.com>, Thomas Gleixner <tglx@linutronix.de>, Vlastimil Babka <vbabka@suse.cz>, maged.michael@gmail.com, Mateusz Guzik <mjguzik@gmail.com>, Jonas Oberhauser <jonas.oberhauser@huaweicloud.com>, rcu@vger.kernel.org, linux-mm@kvack.org, lkmm@lists.linux.dev Subject: [RFC PATCH v3 0/4] sched+mm: Track lazy active mm existence with hazard pointers Date: Tue, 8 Oct 2024 09:50:30 -0400 Message-Id: <20241008135034.1982519-1-mathieu.desnoyers@efficios.com> X-Mailer: git-send-email 2.39.2 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Rspam-User: X-Stat-Signature: zjggjh67taaww6aojfuwcztsk9jm7xtq X-Rspamd-Queue-Id: 4EDAD180025 X-Rspamd-Server: rspam02 X-HE-Tag: 1728395562-427292 X-HE-Meta: U2FsdGVkX19hThxAxVZEUEq8h+ftD4+e5wwuYfDi6NRuSryrri7UZFMWzxQX4w81lLojpXJOhtPv+xN1a4yJZhYUIIZQXmqxXZozJ4MutHKQptj1JhQkgbzNinIoqZKxcW2S1wqZhR1dJCbLlVWBetKUz/PWTmigdK+U4gOjcz6Gy530SLG4ENZUwumrVoytN3gxvzroGG9CvKBHJGBlJAeCKmsUQcl237mxVJoJmgkKdG+8XF0rpKR1oQ7a8d9M5DaTbL3Vr/uGEep2w74OLNpQPoMQV0mORYrq5gEy/s8o8puYBgS784wxI3UaJxzvS1UwQheGjFYGHPyuW6k1LFlLgVWoeZxvIEsqBTpkj4jysGBDJ9DZ7N+3n/3rWUoX039I0z0kpd/lIQhES++W8SSwRS9WJVhhi/9fGzlStPPf2sS/smJZqsyUhwa206095m1VW+xKL0yG0imlvYycuJIzjpsYUV9eXW10efR6MCl1KFMbiXZsWAmlCBqVf6559TeEmKm9ZTcQFibTlwEsCHpxTI4I97z+9QHR9a8BI5idStynIj2kMtQm0x9PSTkdQ/53jNS9syzSecumYmOe6Qcz8qYGqQXLqaX7TndFasgsNPGtclmRrj9+nrv0BfMGThBJ2T/upxuwcRX8S+qbezfIjPkijcdWYNdFyWI4ocxej/AwkHZvZhn4UO4+TWU3f5S7/XWATKXe1QAZXumFoFMo7YrR62OBcSAH/oDVN19GE3OTBshYRS+deRfR+tyRowm80V2Q3MEju9KGLFHzfd9sp9sSqBZNw+ddX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qOzGaFtAIj4XSCGgitAoGXK7rKHsYI6/ICS1ny9mT27RToljffZKUidc+EzcWpdkN4XBY1E7pdCyZd Cn/bpTvD 3IwYkkANtAY= X-Bogosity: 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: <linux-mm.kvack.org> List-Subscribe: <mailto:majordomo@kvack.org> List-Unsubscribe: <mailto:majordomo@kvack.org> |
Series |
sched+mm: Track lazy active mm existence with hazard pointers
|
expand
|
[ I'm posting a v3 taking care of feedback from Peter Zijlstra and Paul E. McKenney in case it can be useful to try hazard pointers with other use-cases, or for further benchmarking of active mm tracking impact. ] Hazard pointers appear to be a good fit for replacing refcount based lazy active mm tracking. Highlight: will-it-scale context_switch1_threads nr threads (-t) speedup 1 -0.2% 2 +0.4% 3 +0.2% 6 +0.6% 12 +0.8% 24 +3% 48 +12% 96 +21% 192 +28% 384 +4% 768 -0.6% This series applies on top of v6.11.1. Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Andrew Morton <akpm@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Nicholas Piggin <npiggin@gmail.com> Cc: Michael Ellerman <mpe@ellerman.id.au> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org> Cc: Sebastian Andrzej Siewior <bigeasy@linutronix.de> Cc: "Paul E. McKenney" <paulmck@kernel.org> Cc: Will Deacon <will@kernel.org> Cc: Alan Stern <stern@rowland.harvard.edu> Cc: John Stultz <jstultz@google.com> Cc: Neeraj Upadhyay <Neeraj.Upadhyay@amd.com> Cc: Boqun Feng <boqun.feng@gmail.com> Cc: Frederic Weisbecker <frederic@kernel.org> Cc: Joel Fernandes <joel@joelfernandes.org> Cc: Josh Triplett <josh@joshtriplett.org> Cc: Uladzislau Rezki <urezki@gmail.com> Cc: Steven Rostedt <rostedt@goodmis.org> Cc: Lai Jiangshan <jiangshanlai@gmail.com> Cc: Zqiang <qiang.zhang1211@gmail.com> Cc: Ingo Molnar <mingo@redhat.com> Cc: Waiman Long <longman@redhat.com> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: Vlastimil Babka <vbabka@suse.cz> Cc: maged.michael@gmail.com Cc: Mateusz Guzik <mjguzik@gmail.com> Cc: Jonas Oberhauser <jonas.oberhauser@huaweicloud.com> Cc: rcu@vger.kernel.org Cc: linux-mm@kvack.org Cc: lkmm@lists.linux.dev Mathieu Desnoyers (4): compiler.h: Introduce ptr_eq() to preserve address dependency Documentation: RCU: Refer to ptr_eq() hazptr: Implement Hazard Pointers sched+mm: Use hazard pointers to track lazy active mm existence Documentation/RCU/rcu_dereference.rst | 38 +++++- Documentation/mm/active_mm.rst | 9 +- arch/Kconfig | 32 ----- arch/powerpc/Kconfig | 1 - arch/powerpc/mm/book3s64/radix_tlb.c | 23 +--- include/linux/compiler.h | 63 ++++++++++ include/linux/hazptr.h | 165 ++++++++++++++++++++++++++ include/linux/mm_types.h | 3 - include/linux/sched/mm.h | 68 ++++------- kernel/Makefile | 2 +- kernel/exit.c | 4 +- kernel/fork.c | 47 ++------ kernel/hazptr.c | 51 ++++++++ kernel/sched/sched.h | 8 +- lib/Kconfig.debug | 10 -- 15 files changed, 358 insertions(+), 166 deletions(-) create mode 100644 include/linux/hazptr.h create mode 100644 kernel/hazptr.c