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 84D302D8796 for ; Tue, 16 Dec 2025 10:10:48 +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=1765879850; cv=none; b=GaMQPVCu9dq/21TBN0pI/ClAGbCorxRihrmYlqiMgAde3dr81kUOuh54et1oB1m/1LgeCfIkL0RXUxVVNyH28Jf4nKJpfZ1WUNlA3igeA/MP8XaeBJnAfc7Da+fkanaUbb8Dqz1xWeZNdgTs2h16yPiY9lFAoSThLC9RghAMFbQ= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1765879850; c=relaxed/simple; bh=t5rEzB0XfV2HhggtoY+1nXODslnee9LcIT7edg43TyE=; h=Date:In-Reply-To:Mime-Version:References:Message-ID:Subject:From: To:Cc:Content-Type; b=I9leAeLT/oSMad/wvgLTXk6t6t1V4AMlMJBnSyv4kw6pic6OXgMo4ZrXHc+bWiSBS43U4tOw7CaEyDAK7ceb/arzswmpT1B/1W8AXikZeliJ5j/KOmRWcYMFQGN6xBx7bqW7HARx1d/3Kl9/8osuqJT5b6Q/P36BNfSN/8HB+BY= 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=fTn3imK4; 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="fTn3imK4" Received: by mail-wm1-f73.google.com with SMTP id 5b1f17b1804b1-477a0ddd1d4so30061705e9.0 for ; Tue, 16 Dec 2025 02:10:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20230601; t=1765879847; x=1766484647; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:from:subject:message-id:references :mime-version:in-reply-to:date:from:to:cc:subject:date:message-id :reply-to; bh=t5rEzB0XfV2HhggtoY+1nXODslnee9LcIT7edg43TyE=; b=fTn3imK4WN596VrpvXlde7uqQuEB5lbWeGDN50/aOdyI+oOvQvN+J1BYFdk+or8Jd7 O9VlJxWalbWrYGMpZ5bkArfPZ6R+fDQpQCjaj9hnsfguiiOTxA2Z086+qMCfgOLcabd9 FgKkDmewYtMl12uEoUdt4Igs6hqHqzWVYToJ4AYZNVfNXww5cr4Hllfc+lcHOps8SnTA 4c3EyCDTqofvVQIt3gN7KZHzCxbDmNH6Ga+qa2cO2C1qc84mOMY2Gm9QwgDegQMnelJF U7qc0SwmL5/fiFnGCfPzYNbEebpUfWPC4/zN3O+ko+vgLsJQ6QgIuftc+kyuExjWHJzL vlEw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1765879847; x=1766484647; h=content-transfer-encoding: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=t5rEzB0XfV2HhggtoY+1nXODslnee9LcIT7edg43TyE=; b=tyFCL3eKt+eObnoraUi0GfPMjhpu61Y/kWGSStFX3HbhjVePCeAjpUvEAATqcKSDWI LGdr0Kyi5Dm8zcA6drYOsrLe27sJqokbWr8AR2sloiF0e1aE7xkI7zsumho2NWDDjyfn UbrB/82kmyICOR2s5/dgdpEq6TgTbWFSbDTl0x6c6IQ1po3DyHoQivKy3QeA9jc7NVh6 63CMWVicfn2Xfr0KHfCJ/gJ8jxSnAYz2su++oXGoV3WKTcKTw7Os33v2pp7T6buqBAZ3 0F5G89PLY9w/2ceIene0se7VsItMn2O5SAa7JnsrqpRNTjC98yUx1XgJMgSsTue3E3he 08fw== X-Forwarded-Encrypted: i=1; AJvYcCXrbEO2nvkHUPbaOgY2/ukiY5ZvFfgUWrCS3li43GKnKvImEQZg9Rr5CDLbiPAYt07bJutCwzo1n/ZZzu8=@vger.kernel.org X-Gm-Message-State: AOJu0Yzcu+LSRPPl8ZuUioXn67/v58OyaY7A5cI1XUsLeMFFeYI6PSVz Z53nAwuhgVIKMyr0B+NRmYVwGaOVJqhfGW3zqmksUkStee+GIUBwJMvy/Jf6TDHTlzsHiDoBLs+ 12+/B0NkqNM40/w== X-Google-Smtp-Source: AGHT+IEd1DtqS9iGujKBf5Wl3HxnREueKAOxGRaJlybjiAz1XyBUCEjyQ5pN21ilTcLVd3HJFgAC3/iwKoa2lQ== X-Received: from wmbd22.prod.google.com ([2002:a05:600c:58d6:b0:477:632b:1238]) (user=jackmanb job=prod-delivery.src-stubby-dispatcher) by 2002:a05:600c:3104:b0:479:3a86:dc1a with SMTP id 5b1f17b1804b1-47a8f9155fcmr137796355e9.36.1765879846765; Tue, 16 Dec 2025 02:10:46 -0800 (PST) Date: Tue, 16 Dec 2025 10:10:46 +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" Content-Transfer-Encoding: quoted-printable On Mon Dec 15, 2025 at 10:06 AM UTC, Yeoreum Yun wrote: [snip] >> 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... > > I understand. However, as I mentioned earlier, > my main intention was to hear opinions specifically about memory contenti= on. > > That said, if there is no memory contention, > I don=E2=80=99t think using the _nolock API is necessarily a bad approach= . > In fact, I believe a bigger issue is that, under PREEMPT_RT, > code that uses the regular memory allocation APIs may give users the fals= e impression > that those APIs are =E2=80=9Csafe to use,=E2=80=9D even though they are n= ot. Yeah, I share this concern. I would bet I have written code that's broken under PREEMPT_RT (luckily only in Google's kernel fork). The comment for GFP_ATOMIC says: * %GFP_ATOMIC users can not sleep and need the allocation to succeed. A lo= wer * watermark is applied to allow access to "atomic reserves". * The current implementation doesn't support NMI and few other strict * non-preemptive contexts (e.g. raw_spin_lock). The same applies to %GFP_N= OWAIT. It kinda sounds like it's supposed to be OK to use GFP_ATOMIC in a normal preempt_disable() context. So do you know exactly why it's invalid to use it in this stop_machine() context here? Maybe we need to update this comment. Or, maybe actually we need to fix the allocator so that GFP_ATOMIC allocs are safe in this context?