From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qv1-f44.google.com (mail-qv1-f44.google.com [209.85.219.44]) (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 BCE4238D6A9 for ; Fri, 21 Aug 2026 18:42:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.219.44 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787337726; cv=none; b=XJbe5SILUaXZCRRygZq4MjSwb9fNqr1jzY10CHibWfcC89IqkC6hkUJLq+EO2I52oL04pFkc17bsW0VA8q2ADiKWtCzCjEfocUuh0khAQ3MF5vQ05lPryV60+cQCOlzV98nZZtwrNIKtEgP9z5UTb+8xE31e24iiScfa2BW8lZo= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787337726; c=relaxed/simple; bh=hTIoOtWtA8d6EV5F3JHyodXKF6W9f4HNlqXGlHgFBEY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=IRboKSRCGtbHZvdTxWF6IL+5xnHiWXIIKTJalLDu4U3RLhE4wKYnBElaT5CpW4ta6LT6u1yVoKYqWjzjoCQmjCzSfz/MZkwqCArr3b7HiQv/KRp7G/twH35XX6pXMXBXnh2ddszmhttde2NGD/OsaxrkB4vY5WJx9vynvqpV/bw= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net; spf=pass smtp.mailfrom=gourry.net; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b=rUD8Aax4; arc=none smtp.client-ip=209.85.219.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=gourry.net Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gourry.net Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gourry.net header.i=@gourry.net header.b="rUD8Aax4" Received: by mail-qv1-f44.google.com with SMTP id 6a1803df08f44-8f1a8e914a9so9989746d6.1 for ; Fri, 21 Aug 2026 11:42:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1787337723; x=1787942523; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=7ZJ1gDUH+GzGBn6NOh4hEOLkLDX+Z7WrRip/EASVTmE=; b=rUD8Aax4avR5lYQDBnElQsRtCd88jfGeUpUxblg9T/1+rlIBYLRHE3xbwF4DWqk/tq 60UnKl6V/QpHjcEVn1YPl8R668Wz1nS/BCYZiumfxQZed4frQi6ThVrGB8i5c8nOQrlV smyFSXbQyurRggeeAzYpBNWOqP4QMYkD7e06YzwNbizvTnixkIt/wti1tPGR/rntfOvH lbmtlOfIN7js0Dqeg0Zsaz/6l9FUy8Rvpzx82aamPSwA3gclcAr0pvCJogGr3WYDoxbe vBedWNTLuaptrtOAP1EWontYSoMRpl863godU7BQLdkaMsOYrbRwNQxBYRYPYonR5sUh ASGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787337723; x=1787942523; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=7ZJ1gDUH+GzGBn6NOh4hEOLkLDX+Z7WrRip/EASVTmE=; b=qq1ISCN9FdQZ5fmpt/QneTpdLqMkb71ukfsvNizOtzFw6Jyp+MdZyVmir7tEi3u5ky WGAFvyKswxhfyH4mTLO7kke4AsPjtG9o/YQnZfez4yYwU4YMlm2Nw6dVLqNagw+e/+2N w0Cjs0Ah9MY1y7so8B5gWVjIdRCwyGnDTLHhffWwZhuYzgSxHo8oRXO2QajL/YAb3FQo WsWcuXyn8d2daNe8ETayfjbPLw+ytSuqGNo2vguldKcKuYrRQEtM5mWbi+p23LwnnOAm KP/6WGRtsHH00+xLTV1eOwdvS40dBwz/VyVoXC64ng12Lzm/i4UK9I+/u5ulypkOUEdx iYTA== X-Forwarded-Encrypted: i=1; AHgh+RrG1Tl3cHdei3nZIy5uOx7wQ/Mcmfb4haBUojZ1lXXTbBNHbJAmKfOYTWfpxKhkLnx3ju92EedsJOSYHVE=@vger.kernel.org X-Gm-Message-State: AFuF++ly8ZKKojXdK3JWllketK/4JFEjORWN+/j94prwESSePGSFw1mU rMxCuw0SoMefF4R6C5/0ZPXMbwqUiUfNAaFej86jEEihwOf7apvUiFAa0dtYZ8A4l6E= X-Gm-Gg: AR+sD11CgkDrtLeRUq2RS00ZHFLv5Nvy/A3Lwt+qyZ0cAJXBN45tARKtcA25t1J3YvS Z5lecIN4w1iy4rU5S0vxKeHUNoxu3YxH2XaM3uyOBihCL9ncUqS0H5kc3iPZ6XPy8VWHZO3DJy8 cuJRpyyiBQtxb09+YyISw+WU8p+Vof4mb7HUvz2YYmiDGHZAs3dP7CUlZqEjGzvNIzsFoGZiLwt D4xrujNmtw1rNVl4F7K4hg0b1DNuVvRIqLSQPOYU/ENcbJ7H+065dLEPs6xjGEHAbhMyjLCRkzE KLpRsTtrT8/hcWGfbK4G6EnGh8k/tGqh3vQTVtDu3Y+z4NafEiGSZDOvB29xEe1eEA+26IqtFyU oypLJKT2GZVXbojvzTblhy7NrX+RnfqYnSnvON444zCFNazwG3GbbsxiB/TGboLeNn3iPcjkWRM zXcFJF/+Qy8E/SBGziinEBAP2wT34ohT7JdIPZx2z0/PzJBZ83Lu6XfNUnKv7h/6Tbw/t5MIv3O HdOe9T1vPn24DQqd4mcIEX47vr6ULuoh01E/7AOz5ef X-Received: by 2002:a05:6214:f21:b0:907:5cea:2f00 with SMTP id 6a1803df08f44-90c809444cbmr84527006d6.5.1787337723325; Fri, 21 Aug 2026 11:42:03 -0700 (PDT) Received: from gourry-fedora-PF4VCD3F (pool-173-79-60-52.washdc.fios.verizon.net. [173.79.60.52]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-90c5f2a2d62sm68350656d6.38.2026.08.21.11.42.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2026 11:42:02 -0700 (PDT) Date: Fri, 21 Aug 2026 14:42:01 -0400 From: Gregory Price To: "Lorenzo Stoakes (ARM)" Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, kernel-team@meta.com, akpm@linux-foundation.org, liam@infradead.org, david@kernel.org, vbabka@kernel.org, jannh@google.com, sashiko-bot Subject: Re: [PATCH] mm/madvise: use folio_trylock() in the cold/pageout PMD split Message-ID: References: <20260821150912.183976-1-gourry@gourry.net> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Aug 21, 2026 at 07:23:34PM +0100, Lorenzo Stoakes (ARM) wrote: > On Fri, Aug 21, 2026 at 11:09:12AM -0400, Gregory Price wrote: > > I am _so_ glad to see an actual reproducer used in a sashiko bug fix. THANKS. :) > fwiw i try to produce reproducers on all my sashiko submitted fixes, i've just been dumb about including them in the changelog. Trying to fix that from now on. > > + if (!folio_trylock(folio)) > > + goto huge_unlock; > > Doesn't this violate lock ordering? > > From rmap.c: > > folio_lock > ... > mm->page_table_lock or pte_lock > > So now you hold the ptl lock _before_ you obtain the folio lock? > > I'm not sure if it being a trylock gets us out of that particular situation? And > I'd be reticent for us to violate it... unless I'm missing something :) > This was the thing i was least sure about, but the deadlock condition should only happen if we tried to spin on the folio lock right? It does look weird, so it would be wrong of me to say i'm 100% confident this is the best change. ~Gregory