From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f46.google.com (mail-wm1-f46.google.com [209.85.128.46]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 22DD52848AA for ; Tue, 19 May 2026 19:04:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=pass smtp.client-ip=209.85.128.46 ARC-Seal:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779217500; cv=pass; b=kta93Se6uwoVIXH1WjNR6LdGfmTkujhsdnzoLOIei6DLORHKp+uxrZehAR8YvCwJAwQgx5FwUHs1+Rgxhq6g5D3ZCfu8fdHKtZESJKkjY0A0g9WRmyUheOXWtAbtXGKX8UGQBiSQ37aLTAlpLvkRJ/5N97mg0SeqaWiW+abMzFw= ARC-Message-Signature:i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779217500; c=relaxed/simple; bh=cojGRWW/Ex1hiO5wrDav3feItUxRSAUPq9EN/ARWbRI=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=PrSem9tDsISlmIow/6FZvFYrAZ8AMeD5eKJ/uop41NTVG0MPFNnFWeZIenOFA6sx8KPzYm+oZ7OABMn0egXoquTroAonKnTsFnBwnZo9EJMQT4nABcMDVL/XywLRDA3dwhWeO6VdybRhNZ0VgZXR+ewKmIfeNUPV7DlquTFMC7A= ARC-Authentication-Results:i=2; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=rTDWqukJ; arc=pass smtp.client-ip=209.85.128.46 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="rTDWqukJ" Received: by mail-wm1-f46.google.com with SMTP id 5b1f17b1804b1-488af9fdaa7so19607925e9.1 for ; Tue, 19 May 2026 12:04:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1779217495; cv=none; d=google.com; s=arc-20240605; b=WFr8jVQ3jfoAzRfCJoOedBdAl/fm0Cj1cpJ6Fkwhpp2Jh8VZbM0AzUHPdvQsopSvze sYTyXkwz8r4kA9Qw2RgIwrIROPLTcJmhKzpYPyD4ZhO+CRYQMlJ+VsZ2pLpVOEztHH/K Pf1ChCB2aqYB1AIxtcITLP1kXvWwyxVpLcYtjTP1+Kq+Oi1d4Kn8UrpyT2qPtwRoQc3j oirFliEjsRYybwucgslml+bfAxnERtwsyVMkq4ynz3/Lu3Pqfu/I/5UvrhnJD7ncgXzk eI7jYmE/kLGHu3R/iJHyX2aQBM5313H2ihB8QcG7yLUDuEZhGRly4XK1pW2aGyt1PiKu bNbg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=cojGRWW/Ex1hiO5wrDav3feItUxRSAUPq9EN/ARWbRI=; fh=gniiSa9j5Cg0mOYwfT/2w7TOa//0e6nIjiHFrcsJ5FE=; b=QOKKOciWGwdxjFn3a6yUuuKn1NyWsScxPSyYUiw4mrWnW39adKR2790Y2srIg3Vd1n L8fF4PMbrjjy/VIoY61hoQVqQrKFH6bMc7qRJfkySnXvzC4e6foyO5EqSpl4Z9xMZqox /+2VCuRvHU0kDIqJ48WtSudhuzGewC4aFfCWVJkWzyG9C7Ip8etTikOxc5+pvyma4YiL x8uXLi0mWAMWcjuHBc+ax2tNLO9gXOBQeI97Y14djrjaxmaUV02LFKXi6I93jjWZCkXk ryI70s9yW99AIJ+1cepOHKp0ldMDfiwefOZ8oHLjwLsYHcFIqRDODmIFtFXpRR9IzF93 MWig==; darn=vger.kernel.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779217495; x=1779822295; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=cojGRWW/Ex1hiO5wrDav3feItUxRSAUPq9EN/ARWbRI=; b=rTDWqukJeTDZ7t38KtbZw4zVQHbIdfeYLw3OF3x8yrqkQEWaPIfDBIe3QYrVX8rXjj uHeC/39wulGFephxOlPFndI3R5MKZCHSw8umYUiDMmPKQBFo1J/y5ymMdxsuiAd5tRhU xGMkG7efHZJXWzV01UVKJGYBzbbI/aQsMc/xyEzuGNpEVXBMtbLN0ZLKoQ7k0VhtifX6 yi8lPNoepp5uCds28ByVdLKvXMk3OCXiLDhAVRH+F8+sjeBSA0/30PRFLcnlq49G7wiY cciaT7WIMIafXRyp5q6xHQWJXYCou8LUqA5pSQjvJ3XMycvTX4eyIVZqaLVYn8mAfg56 2Qtw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779217495; x=1779822295; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=cojGRWW/Ex1hiO5wrDav3feItUxRSAUPq9EN/ARWbRI=; b=pGhnM6EFGY3oZnc5dkkP5byx7KT5WJKLsW/YaJenJUv8NdVXlvuWZh8lzV0wA2RPF7 RjD387jsyUMda3lYHevhk7pSFlV4cS2tzY9p9w1rQLcYuu/iuYJqlLmgGTvZ4aVf4G7H 27CGohGtjwKgKVSY6M3Q9A8MttfeqQ1NFwX13tve/rqCNiswtyc/2KqcdHfkcW0xxnQj jZC50Pz3ua/7ylxXKt4axj0+BHiZiVEjLomRbkjoDx+nQxNKlyVSrbSQxQeARrteNzWF 6fbmqO0iydpyBO8DdYPHu3ODRPtYsu4JgvxE7qspOiDm71jAYwYbrchX29GFeaNa0wXj Fzkg== X-Forwarded-Encrypted: i=1; AFNElJ/T+0vxuh+J/JKeJka/zoj/MztjW7TQARFpl76hFrjLjrlNxgG1srNoe7HutRmwzKqoo+L+fy+7l66FcdQ=@vger.kernel.org X-Gm-Message-State: AOJu0YwAt8/nh2JirBjlAqCsuomPVEJ7YCJoBr7i4RyA870hU66Cgwbh TW0Edgyj+vnF9gm6pmp2T3IPL6zSlhn3IkPxPfx4WsKYNZW1AJJvNTJyfInUWWzwaEiwVn+PxyJ q2M2Lf04PDQNuQiwR4Oz5LU/8lUDoG/I= X-Gm-Gg: Acq92OE9E/dWa/kdsR9uTJj7xSYCqiiuLAo4HizoKBPnMk9j5qyD9wF809YcU//Fihu bSOw6UFtEolSwcmAMu/4yyB6f2iZsnb6Tr3298s8FAkhXFnRsGOCrLRK1bM1xYsbX9sdd0BkHjN ZNj2SMM3CugYez+ITtnQIVPh69lSf7wjlQ67pZXb4qwxNov+QHkmxXUWYsq5Pt7uRhsnrEnMzdM SHV6DpEKqxzKGgqnopyPgEWepZQtuavDRIg7IM1/W8foaU0qObVIWXMrNE1w72HzIxBz5ecFKLO FLBEKgw+h+InmzzEGK+xM2wmE7pC32dA86z+kFTDcRx0uV7lLn5usWLJbCH/+IFd6IL2jiQ= X-Received: by 2002:a05:600c:a00f:b0:48a:5301:bb5c with SMTP id 5b1f17b1804b1-48fe63263dfmr337569515e9.16.1779217495209; Tue, 19 May 2026 12:04:55 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20260517211232.1670594-1-tj@kernel.org> <20260517211232.1670594-2-tj@kernel.org> <9ba50fd2-077e-4291-9276-9adb18186873@kernel.org> <2f02d90d-cdc9-48ef-abe3-99e00f22595f@kernel.org> <297658c4ae2d6e7103f5968efc936224@kernel.org> <04b03066-86d3-4c0b-b077-307fd0f3bc9c@kernel.org> <5590fd3d-dae1-4070-b52f-bc40982ac678@kernel.org> In-Reply-To: From: Alexei Starovoitov Date: Tue, 19 May 2026 12:04:36 -0700 X-Gm-Features: AVHnY4KnCVsDx1rhJ5Rhju09kIJne6tHjry-aCcLnmL6aRppUmxM6vRJAa3dciI Message-ID: Subject: Re: [PATCH 1/8] mm: Add ptep_try_install() for lockless empty-slot installs To: Tejun Heo Cc: "David Hildenbrand (Arm)" , David Vernet , Andrea Righi , Changwoo Min , Alexei Starovoitov , Andrii Nakryiko , Daniel Borkmann , Martin KaFai Lau , Kumar Kartikeya Dwivedi , Catalin Marinas , Will Deacon , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , Andrew Morton , Mike Rapoport , Emil Tsalapatis , sched-ext@lists.linux.dev, bpf , X86 ML , linux-arm-kernel , linux-mm , LKML Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Tue, May 19, 2026 at 10:11=E2=80=AFAM Tejun Heo wrote: > > On Tue, May 19, 2026 at 11:40:48AM +0200, David Hildenbrand (Arm) wrote: > > On 5/19/26 11:05, David Hildenbrand (Arm) wrote: > ... > > >> The only requirements are that the kernel doesn't oops and the > > >> violation gets caught. Beyond that, behavior at the address is > > >> unspecified, and which installer wins the race doesn't matter as > > >> long as kernel integrity holds. > > > > > > You'll have inconsistent TLB state. > > Wouldn't it still be either or with both cases being okay? > > > > I really don't like that approach. > > > > > > We should really try to just take the lock, and remove any code under= the lock > > > that could trigger such unpleasant deadlocks. > > > > > > Is that feasible? > > > > ... or can we run into similar problems with kprobes? (I am obviously n= o bpf > > expert ...) > > Yeah, I mean, that was just the first TP I found scanning the code. Any > kprobes or other TPs in the path would behave the same. > > When this fault triggers, the BPF program has already malfunctioned, so i= t's > not going to be a high frequency path and performance isn't a primary > consideration. So, anything that can ensure that the kernel doesn't crash= or > lock up would be fine. Any better ideas? As you guys already figured out the trylock is not an option. The fault handler has to install _some_ page and let kernel continue. Scratch page or arena page doesn't matter. Potentially different CPUs will see different page. It's not a concern at all. bpf prog is buggy, but the kernel will continue to work without a glitch. bpf runtime will disable and unload misbehaving prog.