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]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id E049EC43458 for ; Fri, 3 Jul 2026 11:43:53 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id D9ABE6B00C0; Fri, 3 Jul 2026 07:43:52 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id D4BE26B00C1; Fri, 3 Jul 2026 07:43:52 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id C62436B00C2; Fri, 3 Jul 2026 07:43:52 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id A0E8F6B00C0 for ; Fri, 3 Jul 2026 07:43:52 -0400 (EDT) Received: from smtpin17.hostedemail.com (lb01a-stub [10.200.18.249]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 33F868E7A5 for ; Fri, 3 Jul 2026 11:43:52 +0000 (UTC) X-FDA: 84947281104.17.BCE21F5 Received: from out-170.mta0.migadu.com (out-170.mta0.migadu.com [91.218.175.170]) by imf19.hostedemail.com (Postfix) with ESMTP id C04BA1A0005 for ; Fri, 3 Jul 2026 11:43:48 +0000 (UTC) Authentication-Results: imf19.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=axBe2JTE; spf=pass (imf19.hostedemail.com: domain of brendan.jackman@linux.dev designates 91.218.175.170 as permitted sender) smtp.mailfrom=brendan.jackman@linux.dev; dmarc=pass (policy=none) header.from=linux.dev ARC-Seal: i=1; a=rsa-sha256; d=hostedemail.com; s=arc-20220608; cv=none; t=1783079030; b=AHiwIC6teTpxFKfhAd8myOxcMwg5RJ3oG2UtnBuIKYd/P4SZCjnAR0tsVM2M3EnS3FdsAC yV6s+0EVaL8nhKRBo7j+tGl+GqLmAtbaeULPDN3n3hNCwdBVt2MsfArk9P/S7Qq9krUhzC sy6zfeh3l5hQIoVx34Q0HzMI0c59tao= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1783079030; 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:dkim-signature; bh=VSetS396SrH76litqhz6V0tLsyOUbEp17iVMUlqbZ0A=; b=ND1x1nWY4WvdjUwfvBPAiZdmd87xJEoOVynu9qqKE9Lasf45QHbMF6c7mIDIKRzYZAG7R/ oz9FYNcd2MVX4rzZVdIT3z8FOzd7YuK1xFJXCkqOVVcphX+RLzfo6hpnNcbgCGDWgQXCrJ mMS1tgJP9HvVoBPyk78VLTPqEigR6v8= ARC-Authentication-Results: i=1; imf19.hostedemail.com; dkim=pass header.d=linux.dev header.s=key1 header.b=axBe2JTE; spf=pass (imf19.hostedemail.com: domain of brendan.jackman@linux.dev designates 91.218.175.170 as permitted sender) smtp.mailfrom=brendan.jackman@linux.dev; dmarc=pass (policy=none) header.from=linux.dev Mime-Version: 1.0 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.dev; s=key1; t=1783079024; h=from:from: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=VSetS396SrH76litqhz6V0tLsyOUbEp17iVMUlqbZ0A=; b=axBe2JTE4wy9jYDVh/aDcxlWFqplgDs/zl2EfbLtmG9mqQTYZV5rPg/mysAbrTIYroHQun imD73iN1OFVJuv2JTbrfrEOVOfWxT3+/GG9kaJQRW5kMdQ8aqP0fGcDHhwBu9Ypv9V+6iW 7YqnlKUsRosMN4yi746SiqKn2nh99fI= Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 Date: Fri, 03 Jul 2026 11:43:39 +0000 Message-Id: Cc: "Harry Yoo (Oracle)" , "Gregory Price" , "Alexei Starovoitov" , "Matthew Wilcox" , "Hao Ge" , , , , , , "Yosry Ahmed" Subject: Re: [PATCH v4 18/18] mm: factor out can_spin_trylock() X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. From: "Brendan Jackman" To: "Vlastimil Babka (SUSE)" , "Brendan Jackman" , "Andrew Morton" , "Suren Baghdasaryan" , "Michal Hocko" , "Johannes Weiner" , "Zi Yan" , "Muchun Song" , "Oscar Salvador" , "David Hildenbrand" , "Lorenzo Stoakes" , "Liam R. Howlett" , "Mike Rapoport" , "Matthew Brost" , "Joshua Hahn" , "Rakie Kim" , "Byungchul Park" , "Ying Huang" , "Alistair Popple" , "Hao Li" , "Christoph Lameter" , "David Rientjes" , "Roman Gushchin" , "Sebastian Andrzej Siewior" , "Clark Williams" , "Steven Rostedt" References: <20260702-alloc-trylock-v4-0-0af8ff387e80@google.com> <20260702-alloc-trylock-v4-18-0af8ff387e80@google.com> <1e162a97-1594-495d-b48e-7dafaa0a6d82@kernel.org> In-Reply-To: <1e162a97-1594-495d-b48e-7dafaa0a6d82@kernel.org> X-Migadu-Flow: FLOW_OUT X-Rspamd-Server: rspam07 X-Rspamd-Queue-Id: C04BA1A0005 X-Stat-Signature: c6xq9amt3cyyfbhcrt1pzmw876a95d9h X-Rspam-User: X-HE-Tag: 1783079028-343645 X-HE-Meta: U2FsdGVkX195rtcpClgek1elPRjjhW1uKjcHOcnx8dlGGFtItCqrdkE50viByoH0uwUNxFvF3/D/RpjA9y6H5k/ywtefte6/1dsVRO01k/w/7DLp4l9GlgsM4qBYQVG9fCgtJFr2+YfddJtFQdvzCMkRWX3asvuSEoIjdmHguTi0au8AO1IjHh+Z9PqDv3ln5mQdfol7X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YH7ahZMsxkuMO77uhJ8FUX04tdBMlp8C6JDMcYaWAn8Ln7v5R7UFSapURM9jNMH61+3x6g9v0= Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: List-Subscribe: List-Unsubscribe: On Fri Jul 3, 2026 at 9:32 AM UTC, Vlastimil Babka (SUSE) wrote: > On 7/2/26 11:49, Brendan Jackman wrote: >> Deduplicate checks for whether the current context is safe for >> spin_trylock(). >>=20 >> Does this function really belong in mm/internal.h or is it generic? Not >> sure. If someone ends up duplicating this logic elsewhere in the kernel, >> that would be a shame. But goes in some generic header, someone treats >> it as documentation about where it's guaranteed safe to spin_trylock(), >> and then it emerges that there are other subtle preconditions that >> didn't affect the mm usecase, that would be worse. So, just be >> conservative and keep it local. > > Agreed. We could even use page_alloc.h ? Would be nice to shrink the scope but I think it would be "wrong" for slub.c to get it from there. It's not to do with the page allocator.