From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) (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 BB4DD317176 for ; Mon, 18 May 2026 09:50:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=193.142.43.55 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779097851; cv=none; b=oEyGmWRCNm46ex3f+PFmAli7JpFfWrL1Fdvqrlu4bVB+iKprtgXO0J/RghWbMBfazSUqzwt3sonXwUlWNM1KoIUf9zjxTgtlBu/RBICBrDfYwT4Xq7DQdie6O2sdH3w+AA+6qwPzVJvqYdUMm5OC0VKt9dJT9nIC3kl2cWEb4HA= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779097851; c=relaxed/simple; bh=0zXHqSeNUIBIVrYc7bD9J1+5HtgWSthRguzPQhf5gAQ=; h=From:Subject:Date:Message-Id:MIME-Version:Content-Type:To:Cc; b=usA+/sE1eMmfCvg/XdsPVvAw06j+ZCR6AKEW6d/qnYwrr48cgkTO0ZH7s2H3zh7+5hpsnQqqVRzU09qTkf//xZyHttEmDtci+nRnYB8IlNJRr5p/hgcsfIlvgE0CvBrwKzQECihlfHiRZPK88HG+I96tqAuVhO2XngVRaSnlkNU= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de; spf=pass smtp.mailfrom=linutronix.de; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=DLPO4Hsr; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=8zp6C0gF; arc=none smtp.client-ip=193.142.43.55 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=linutronix.de Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=linutronix.de Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="DLPO4Hsr"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="8zp6C0gF" From: =?utf-8?q?Thomas_Wei=C3=9Fschuh?= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1779097848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WT4Vm66KOVZA0RJFOAYxcv97dwxUA3fg020L2O5ssYs=; b=DLPO4HsraKrv0CNLdYLCbcXFua4ZvZ+bgAgNB+fzdu2euU0wMVDczxB+PYVOyDdv7h4a+V eFjwwkxC38gTKAv95wjIbir4RNitUNyIjgUqf23DsOXGvUixPLfDJn9gg8K8SU8u4A0c85 HpHEfBAKp5Ocuu+UOnffGZIpXVumujJJ1zuO7PE+4X72WzTLjhTEUnTcgN7tISKCwNEvUQ KEy6VmDNmYM+lAPJ4O+u6lQeUn2SV1VUHih29JBZ7CjAoX5Fm3h4FpbcSKcMWtKKWrllXT g8dCYr3aykcKOhVmooqWx4yTWvhINMkH0bFO5kEuA7mwZ1CGvX7CadDNfhmUwQ== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1779097848; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=WT4Vm66KOVZA0RJFOAYxcv97dwxUA3fg020L2O5ssYs=; b=8zp6C0gFfT2+D1S3juoWOO/FMEv0GYmtBjXb+ValBp4F1Qfj/xkTe2/+l/r2gAx3N2siK+ UfTvlz9KUQSw/SBA== Subject: [PATCH v3 0/6] vdso/datastore: Allow prefaulting by mlockall() Date: Mon, 18 May 2026 11:49:38 +0200 Message-Id: <20260518-vdso-mlockall-v3-0-bf4f2af2b41f@linutronix.de> 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 X-B4-Tracking: v=1; b=H4sIAAAAAAAC/13OTQ7CIBCG4asY1mJgKP1x5T2MC2jBTqxgoJKap neX1oVJl++XzJOZSTQBTSTnw0yCSRjRuxzieCBtr9zdUOxyE2AgWQWcpi56+hx8+1DDQIuSay0 EMKk5yTevYCxOm3e95e4xjj58Nj7xdf1JNYedlDhlFGzRaFW1tubNZUD3HoN3OJ06Q1YtwV9o2 P6XBFkoaytVaZkQhdwLy7J8Aac0vl/wAAAA X-Change-ID: 20250721-vdso-mlockall-461bb33205b1 To: Anna-Maria Behnsen , Frederic Weisbecker , Andy Lutomirski , Vincenzo Frascino , Thomas Gleixner Cc: Nam Cao , Sebastian Andrzej Siewior , linux-kernel@vger.kernel.org, Andrew Morton , David Hildenbrand , Jason Gunthorpe , John Hubbard , Peter Xu , linux-mm@kvack.org, Lorenzo Stoakes , "Liam R. Howlett" , Vlastimil Babka , Mike Rapoport , Suren Baghdasaryan , Michal Hocko , =?utf-8?q?Thomas_Wei=C3=9Fschuh?= X-Developer-Signature: v=1; a=ed25519-sha256; t=1779097846; l=1806; i=thomas.weissschuh@linutronix.de; s=20240209; h=from:subject:message-id; bh=0zXHqSeNUIBIVrYc7bD9J1+5HtgWSthRguzPQhf5gAQ=; b=l3Dr4NlNLgiqNc5YpVdG1q2JycHDC0fvdJHxa5UVnK2S7voNV37yAdTPOkPzgsMBJyWieL327 D7CWUdPdl/lB2ROSIRf81cbcnxYpKT+i6hNSMeXy+UHruHEmESAuN4E X-Developer-Key: i=thomas.weissschuh@linutronix.de; a=ed25519; pk=pfvxvpFUDJV2h2nY0FidLUml22uGLSjByFbM6aqQQws= While mlockall() is meant to lock page *memory*, effectively it will also create and lock the corresponding page table entries. Latency-sensitive applications expect not to experience any pagefaults after calling mlockall(). However mlockall() ignores VM_IO mappings, which is used by the generic vDSO datastore. While the fault handler itself is very fast, going through the full pagefault exception handling is much slower, on the order of 20us in a test machine. Since the memory behind the datastore mappings is always present and accessible it is not necessary to use VM_IO for them. Signed-off-by: Thomas Weißschuh --- Changes in v3: - Rebase on v7.1-rc1 - Stop using zero page, which can not be mapped in this way - Link to v2: https://lore.kernel.org/r/20250901-vdso-mlockall-v2-0-68f5a6f03345@linutronix.de Changes in v2: - Stop using nth_page() which is being removed - Link to v1: https://lore.kernel.org/r/20250812-vdso-mlockall-v1-0-2f49ba7cf819@linutronix.de --- Thomas Weißschuh (6): vdso/datastore: Rename data pages variable vdso/datastore: Map pages in terms of the faults pgoff vdso/datastore: Map zeroed pages for unavailable data vdso/datastore: Explicitly prevent remote access to timens vvar page vdso/datastore: Allow prefaulting by mlockall() vdso/datastore: Simplify the mapping logic for VDSO_TIME_PAGE_OFFSET kernel/time/namespace_vdso.c | 7 ++--- lib/vdso/datastore.c | 65 ++++++++++++++++++++------------------------ 2 files changed, 32 insertions(+), 40 deletions(-) --- base-commit: b0f603a5e7c076c7e424b5a621022b3bec16225b change-id: 20250721-vdso-mlockall-461bb33205b1 Best regards, -- Thomas Weißschuh