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 619C6480955; Tue, 7 Jul 2026 21:54:54 +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=1783461296; cv=none; b=AXT5B80XitGrEDlkxFeMqFkr4ZNtLAhiJIiJX1olMWH68l31XTRrAL1WlsvtBdbfKSrmoClPHWwnQz7vk6Vf88LdD+TnRGWP/w8GryYoiy8jA2AmMU33ZWMl6vExOKkJJR8dIcYuiw3tvmvSAd+JBtZaaSwRhNh8KgDvsZHgM5I= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1783461296; c=relaxed/simple; bh=bF7LHT37WqbYlGFt6VsWNo4se2vyRu5qhlVZ9ItvZ3o=; h=Date:From:To:Subject:Cc:In-Reply-To:References:MIME-Version: Message-ID:Content-Type; b=LanyWvfgOZrMXWgNDqzrq9/IalpPNEBzIck4qfdQ3tDQV2Jg/HObBH+mcfuALyArETp2Bgi1RD1rIt3WENQlfQxzER6/0QJXTEYO8MT0lV/SPlMJdGiriwACEs/UaARbY7yPrGWdzGs7eeh27ARotSgzyMdw6leHq5kwEjRHIm8= 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=uqoCKS25; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b=6J+cNcSd; 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="uqoCKS25"; dkim=permerror (0-bit key) header.d=linutronix.de header.i=@linutronix.de header.b="6J+cNcSd" Date: Tue, 07 Jul 2026 21:54:51 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1783461293; h=from:from:sender:sender:reply-to: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: in-reply-to:in-reply-to:references:references; bh=7Kf0BxM4/mCqO1eQ9aCSr5R4hIduTtLgEvAgv+0VqVc=; b=uqoCKS25ax+jCf5NvXwNoDgwQCHEgNkz5pgu8uZJ3j4nTjtbf4nXBOEnb7FU3irS7TJrhc SPe1BqarbdGNXPQ1Hj7jdQ86QBCRnIMFxg7lR/+on071AvlMp51vKjSOCBapNhNRdtxJ9l h0/AIDeqrakpX4EXvoLuH0HparH36/D38oACVS0uvMD4C2XUVHyQZHPTaDMZk+3WI5S+Q0 wQ945XZBEYTjxvQ6XH1xLFLyaGqW4uEGrXGmao2W0PeYtFy7CJJp1fan1Qb+N/NKYgJDSR yRpUxTTDviPHAAQ/hSGLyNBdEm/g16JTIomQ+GaRicePz7cNjHk9cQS28jCPiA== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1783461293; h=from:from:sender:sender:reply-to: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: in-reply-to:in-reply-to:references:references; bh=7Kf0BxM4/mCqO1eQ9aCSr5R4hIduTtLgEvAgv+0VqVc=; b=6J+cNcSdJ1t00nmZGQs1uCf51ziPJ7BL0maJXOsl4mtPEHM2nY31Qe1b2f9DT+KlNGujjw RKoSoPBiNi7gwADQ== From: tip-bot2 for Thomas =?utf-8?q?Wei=C3=9Fschuh?= Sender: tip-bot2@linutronix.de Reply-to: linux-kernel@vger.kernel.org To: linux-tip-commits@vger.kernel.org Subject: [tip: timers/vdso] vdso/datastore: Allow prefaulting by mlockall() Cc: Nam Cao , thomas.weissschuh@linutronix.de, Thomas Gleixner , x86@kernel.org, linux-kernel@vger.kernel.org In-Reply-To: <20260630-vdso-mlockall-v4-5-6c93708ce723@linutronix.de> References: <20260630-vdso-mlockall-v4-5-6c93708ce723@linutronix.de> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Message-ID: <178346129159.744054.975961566705759196.tip-bot2@tip-bot2> Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails Precedence: bulk Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable The following commit has been merged into the timers/vdso branch of tip: Commit-ID: c27e727c9a60e6303088a956eea45b6b5c02cef3 Gitweb: https://git.kernel.org/tip/c27e727c9a60e6303088a956eea45b6b5c0= 2cef3 Author: Thomas Wei=C3=9Fschuh AuthorDate: Tue, 30 Jun 2026 09:31:59 +02:00 Committer: Thomas Gleixner CommitterDate: Tue, 07 Jul 2026 23:52:52 +02:00 vdso/datastore: Allow prefaulting by mlockall() 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. The data page mapping is now also aligned with the architecture-specific code pages. Some architecture-specific data pages, like the x86 VCLOCK pages, continue to use VM_IO as they are not always mappable. They will require their own special handling later when the general approach has been agreed upon. As a side-effect this will allow GUP on these pages and allow more ways to access the data in them. This is fine, as all data in this mapping is globally visible anyways. Either because it is mapped into all tasks, or in the case of the time namespace pages, can be read from procfs. Regular mlock() would also work, but userspace does not know the boundaries of the vDSO. Reported-by: Nam Cao Signed-off-by: Thomas Wei=C3=9Fschuh Signed-off-by: Thomas Gleixner Tested-by: Nam Cao Link: https://patch.msgid.link/20260630-vdso-mlockall-v4-5-6c93708ce723@linut= ronix.de --- lib/vdso/datastore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/vdso/datastore.c b/lib/vdso/datastore.c index 0ca4396..d7ab077 100644 --- a/lib/vdso/datastore.c +++ b/lib/vdso/datastore.c @@ -125,7 +125,7 @@ const struct vm_special_mapping vdso_vvar_mapping =3D { struct vm_area_struct *vdso_install_vvar_mapping(struct mm_struct *mm, unsig= ned long addr) { return _install_special_mapping(mm, addr, VDSO_NR_PAGES * PAGE_SIZE, - VM_READ | VM_MAYREAD | VM_IO | VM_DONTDUMP | + VM_READ | VM_MAYREAD | VM_DONTDUMP | VM_MIXEDMAP | VM_SEALED_SYSMAP, &vdso_vvar_mapping); }