From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id 75F07E77180 for ; Thu, 12 Dec 2024 15:48:17 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 115B16B0082; Thu, 12 Dec 2024 10:48:17 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0C6B96B0088; Thu, 12 Dec 2024 10:48:17 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id EF6D66B0089; Thu, 12 Dec 2024 10:48:16 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id D060B6B0082 for ; Thu, 12 Dec 2024 10:48:16 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id 7AA6BADE42 for ; Thu, 12 Dec 2024 15:48:16 +0000 (UTC) X-FDA: 82886737878.24.F5DABEC Received: from nyc.source.kernel.org (nyc.source.kernel.org [147.75.193.91]) by imf07.hostedemail.com (Postfix) with ESMTP id F11414001E for ; Thu, 12 Dec 2024 15:47:45 +0000 (UTC) Authentication-Results: imf07.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf07.hostedemail.com: domain of "SRS0=Hv4s=TF=goodmis.org=rostedt@kernel.org" designates 147.75.193.91 as permitted sender) smtp.mailfrom="SRS0=Hv4s=TF=goodmis.org=rostedt@kernel.org" ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1734018471; a=rsa-sha256; cv=none; b=dZKROPLPegGb28z30E5Q0Zg9AYcBmHQu+bi5JfoPcNPP7Bvd/6rq7/+sRQcmiWpOX2qe+Y GuIB5UdVx662eg1pH2zQvkK4LHj4J52qJTs1xEEwuhMBuJb5JPaOTdTi9zL7LuNliocl+M F5xjujUxdfSMkwR867/CKfYvGj6R5qw= ARC-Authentication-Results: i=1; imf07.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf07.hostedemail.com: domain of "SRS0=Hv4s=TF=goodmis.org=rostedt@kernel.org" designates 147.75.193.91 as permitted sender) smtp.mailfrom="SRS0=Hv4s=TF=goodmis.org=rostedt@kernel.org" ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1734018471; h=from:from:sender: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=JX8SHwmmwKGHeVuKS8zehWjTTaIB0FRtjcRkXRsuWHk=; b=Qd/GprzPqsZtilEDzydUQruRjbvoVCDxvGDOU4mH6X4y57+47+UV3Ry6qnRpqdDKTp18Xq AjT+yeAMJzBiVQS4Wunw1KOvndH1jy6HizjylCfu2n1PHtkHJVVUE9hp8Cx50Sh4BghUF8 WwT1wLXzRFX/y1uixfCD2rztA35jVKo= Received: from smtp.kernel.org (transwarp.subspace.kernel.org [100.75.92.58]) by nyc.source.kernel.org (Postfix) with ESMTP id B8ECAA4210D; Thu, 12 Dec 2024 15:46:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E479AC4CED0; Thu, 12 Dec 2024 15:48:11 +0000 (UTC) Date: Thu, 12 Dec 2024 10:48:09 -0500 From: Steven Rostedt To: Sebastian Sewior Cc: Michal Hocko , Alexei Starovoitov , Matthew Wilcox , bpf , Andrii Nakryiko , Kumar Kartikeya Dwivedi , Andrew Morton , Peter Zijlstra , Vlastimil Babka , Hou Tao , Johannes Weiner , shakeel.butt@linux.dev, Thomas Gleixner , Tejun Heo , linux-mm , Kernel Team Subject: Re: [PATCH bpf-next v2 1/6] mm, bpf: Introduce __GFP_TRYLOCK for opportunistic page allocation Message-ID: <20241212104809.1c6cb0a1@batman.local.home> In-Reply-To: <20241212153506.dT1MvukO@linutronix.de> References: <20241210023936.46871-1-alexei.starovoitov@gmail.com> <20241210023936.46871-2-alexei.starovoitov@gmail.com> <20241212150744.dVyycFUJ@linutronix.de> <20241212153506.dT1MvukO@linutronix.de> X-Mailer: Claws Mail 3.17.8 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable X-Rspamd-Server: rspam04 X-Rspamd-Queue-Id: F11414001E X-Stat-Signature: 1iy1tu76n3rojpgjjjjpnze8qx1ufnz3 X-Rspam-User: X-HE-Tag: 1734018465-55588 X-HE-Meta: U2FsdGVkX19rMODkH6wtXjIOmeb4sYk0KQ1li/LoaDJHAGp9MbUtysJ1bqvVNRVsXMaAHCa9LBuWT9VpiOkzUKleEovqTMXOGKShdgn75hJC0JlFwHM6u5APRQoJo4Drs8WM78Rn1rmRbkv1H6lO7Y7DCVk+OySfYpnvygDwXaDRmaAn+2R7JdDi5cLoibrr6FzWP1AGrr0OoT46btRTZwLXXnIK0l5g+hSkTzWO68BERecOExOeCFrwcGwXe88vR1uEvEfpURjdKrOad3oBkgJiiien5aLQNKqZG6EYBf0wnRE+4+PjUJwQRBnjGD8b9Cr6IPH85cqtyvX2iG28r2Zt52VDH+wbXcemI/hWUwwdpYae7T/TdzpPi24sde5/3MQni1SyanuuiIKAv9JJW/MXBNvhz9A7Jfg61e+jVA5CBS/5wb/Q5PqrbfP5Pp04bZVAZgW4vilt5LVhN2oB6vMeBrjMVEq5MzBVvfQKltXOVMbS+1UrctkJjiHCbbWtIhxgJ9fQl0yXZO20ZVQRXUFQcWU2IvlSYPAc9XPDM8MYXGLHZrOfCGVpflpaO99H/eycwo2jRMb5FjramxcgxIMnaPqh7mK+QKV1qOtmcKyS3Vwf0XidwgrnLEsC5RfW2VWYCpQfXhcy5TjCI/ThV0kVixhtx6UjQ+7kJZNufpxwD5hpvFK86ug4Uy9kFqSOzlrmF1UgAhHIsqSKmwB6G/1+GMOP2qxY4vbuIZ6kI4uT5oZVhnuwgNJrbSesdaRiH0ty+X6RiFo2+tNZC06Y1xsvJuRFu5RX4FoFnHfknZGNtrCniyAZe13f0OKLbZSga1M/guY/AQErCr+gGxIBhYmZGZnJ4KPtHPiLSWITtrTbc22wGN8WDPdMkfhKNvmvqRyFcdtfHcWf0NU7dASonoEHW/z/Zr3P5EtkiUi09XPQo1RO37eq/lo7jtcsDRG2lqe8w6G2RxribQmbPIu TQoO9LMt 1I6OdnhcnRG3CsQc/DglZLRpOf8fHdIFwAfji9wpHtg5paBI+JVoEBY7NSlk44LHLgy8Pdno32KYB4GnGyZGdyDuO9CDiibgbVZx9DRcBmGweEYmPRPMgoQUyz+nsGoRjchlLITtK7UzCNcAqA128nVHgYLptpSuWb1kt5wNDX5KV6dMNlH9LjaDA1yVJp2IskjoeAEWDEzkyvSUnvvMtvfMe+wJlC+2Ca32smEnJtUeYZ0uTPUtqYv38F+ItxBwgJiipMWRECa4rNIou702rfciZEZMfys8QMxsoSuWxoxSBG433Yp+DZAqySdmhIDG7t+kLFzsi60kz+wrY5gYwRDQ5fVZbO1/prrp8Ena6Q5vOwq+R9wRybQDCiA== X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Thu, 12 Dec 2024 16:35:06 +0100 Sebastian Sewior wrote: > If NMI is one of the possible calling contexts, yes. >=20 > One thing I am not 100% sure about is how "good" a spinlock_t trylock is > if attempted from hardirq (on PREEMPT_RT). Obtaining the lock und > unlocking is doable. The lock part will assign the "current" task as the > task that owns the lock now. This task is just randomly on the CPU while > the hardirq triggered. The regular spin_lock() will see this random task > as the owner and might PI-boost it. This could work=E2=80=A6 Looking at the unlock code, it and the slowtrylock() appears to use raw_spin_lock_irqsave(). Hence it expects that it can be called from irq disabled context. If it can be used in interrupt disabled context, I don't see why it wouldn't work in actual interrupt context. -- Steve