From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-wm1-f73.google.com (mail-wm1-f73.google.com [209.85.128.73]) (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 DF182329E67 for ; Mon, 15 Dec 2025 09:55:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.128.73 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765792531; cv=none; b=utQ0XvEYWZ8VlDtI8j92JoBOFhrU34RsmxuvZ+HRJFITKPwxyxUGeB2z05DHlNIStfT+HQJc29IFJyDTBnyRVhuhY7SsdM/OcTSVYqM58ATqMrVsrCo6wD2NP31U/0sABZ5BNzIYXgU6j6Xzdqgq9sC3MH8iWG1fOpeoM36C15k= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765792531; c=relaxed/simple; bh=MErqbYG3hVSovTFjSQY3qFyCwp76vQn51NyQKwSvMfE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=rJWw138vdGxFf1GEnQI/BgjKgGKq/eglso56BGL9TGPoyA6/Qqe74wE+X+THL3fK80fr6lKi2fTQDh7cBF1EzvDORiuZ2ss0D8d3ldPP4cHT0TVKwKF8iDepv9n+bBZdB3j0BqB4esbMtLPEaIJOVZFpMwN4RiKOOxgKj2BDvR8= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b=1f5EmxaW; arc=none smtp.client-ip=209.85.128.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=google.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=flex--jackmanb.bounces.google.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="1f5EmxaW" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-4776079ada3so28033505e9.1 for ; Mon, 15 Dec 2025 01:55:28 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1765792527; x=1766397327; darn=vger.kernel.org; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:from:to:cc:subject:date:message-id:reply-to; bh=eXmkpglOgTRlWY6ZkKkXvIK9PamZymsXtf90xHcK+6o=; b=1f5EmxaWTdpPwCIPwvLlJSqXK3+c6NCzp+azUc4zNuYWtwlImsDbnWdmMGjnq27qDS SkvPrKt8N4BLYzNXR3jNbHHHrxjFejHODrmfN7GDHsI3Yco9dggG5AfeoETCTGexIP/t 9ABoQpusllmimh2hrytTIS8aUleYV2RmWqD/UsF151DkVmmiozkQfO5FROvxf0rikc5w t2JcgEhhQwtX7hSm1y5B/7f+jaghMI3yhFvLV30sQnIK5wFBJtQccGqhRB0hydS0aomi 5ExwM+2/3QIVmbmEsU7IclZEo3OxhSESfa4BJ71jr9e9h/A3AawSFRwzqkGG1jPnz6wS OAoQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765792527; x=1766397327; h=cc:to:from:subject:message-id:references:mime-version:in-reply-to :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=eXmkpglOgTRlWY6ZkKkXvIK9PamZymsXtf90xHcK+6o=; b=exx3BKPIHk5tt4u4wIFpFi7IGio8vzS7v6Rcoii3VR+MCx//NvlxWlg2T+YrCl0R7G P5hfbNxsY62y0zoK2msNi7BGmg/BpaDEOSp6Z50Z/VoxB18a5/y5ujeT0R0pABbVsST4 2ydVqUnx/om/Sq3443l5dMOD1ti8XtaiU/Vc+di1QymahhOpJmJlgVzMgciBs/5u20bY V0pR1YiK3zyYaxKtL/PKkIihmcD6cRf+dL4zADWmOAiFwnG0aQ3uOEjuAs20O7ROGRIk 5WKtE486ND3I69ybJhovx3VhRkmv/y0jBfrhWJ582x2JwMWtOgmW3vy9rbr5b2FW5TU/ Gp+Q== X-Forwarded-Encrypted: i=1; AJvYcCXEajjBowWjZZsJjzdYgQu+yGhQ27joh18bZqgfI71Alvbkh5PQdcXi6MYNBxOyz8UmqzATsGTFjhqkx5g=@vger.kernel.org X-Gm-Message-State: AOJu0YwfQzEHZlr2yH6A9912QYwyFYfKK9jpEdZ+3FiiSnYVvRRD1QbH rSnCPVrlrR3PnFotK1u1YLeXlG/7B+gzVtzKDwkCR0ij40pcebPeXTYkul7H3fOcZwlzcVlHJf/ NFn2MHJ87+iK+/g== X-Google-Smtp-Source: AGHT+IGJNUQ3yCE5dAMJ9tGmUAnyfo5RpFowfQkzScccNTMlw3Eak2tuYu3AGem3xCXRYZD9qM+KN+pYSar9uQ== X-Received: from wrp13.prod.google.com ([2002:a05:6000:41ed:b0:430:fcc8:d29e]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:6000:40df:b0:430:f68f:ee97 with SMTP id ffacd0b85a97d-430f68ff1b5mr5631418f8f.40.1765792526655; Mon, 15 Dec 2025 01:55:26 -0800 (PST) Date: Mon, 15 Dec 2025 09:55:26 +0000 In-Reply-To: Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 References: <20251212161832.2067134-1-yeoreum.yun@arm.com> <20251212161832.2067134-3-yeoreum.yun@arm.com> X-Mailer: aerc 0.21.0 Message-ID: Subject: Re: [PATCH 2/2] arm64: mmu: use pagetable_alloc_nolock() while stop_machine() From: Brendan Jackman To: Yeoreum Yun , Brendan Jackman Cc: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , Content-Type: text/plain; charset="UTF-8" On Mon Dec 15, 2025 at 9:34 AM UTC, Yeoreum Yun wrote: > Hi Brendan, >> On Sun Dec 14, 2025 at 9:13 AM UTC, Yeoreum Yun wrote: >> >> I don't have the context on what this code is doing so take this with >> >> a grain of salt, but... >> >> >> >> The point of the _nolock alloc is to give the allocator an excuse to >> >> fail. Panicking on that failure doesn't seem like a great idea to me? >> > >> > I thought first whether it changes to "static" memory area to handle >> > this in PREEMPT_RT. >> > But since this function is called while smp_cpus_done(). >> > So, I think it's fine since there wouldn't be a contention for >> > memory allocation in this phase. >> >> Then shouldn't it use _nolock unconditionally? > > As you pointed out, I think it should be fine even in the !PREEMPT_RT case. > However, in case I missed something or if my understanding is incorrect, > I applied it only to the PREEMPT_RT case for now. Hmm, I don't think "this code might be broken so let's cage it behind a conditional" is a good strategy. 1. It bloats the codebase. 2. It's confusing to readers, now you have to try an understand why this conditional is here, which is a doomed effort. This could be mitigated with comments but, see point 1. 3. It expands the testing matrix. So now we have code that we aren't really sure is correct, AND it gets less test coverage. Overall I am feeling a bit uncomfortable about this use of _nolock, but I am also feeling pretty ignorant about PREEMPT_RT and also about this arm64 code, so I am hesitant to suggest alternatives, I hope someone else can offer some input here...