From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f176.google.com (mail-qt1-f176.google.com [209.85.160.176]) (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 38E102D9792 for ; Fri, 21 Aug 2026 20:38:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.176 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787344740; cv=none; b=kBB/xM0HqZ+iOZbzcdt4zhIjy6UbTrFusxWOtEf6QkSc18N0xX0qdVkdzFNLMW+CddbWFGcVKeZaH1XWmTX28XTAhsuq5Mcvvo24j5LbPb3Yp81wK/oR/yGxKJJC7wzMbenjOwciSNkZqVCKYWLenpyZSexAz3/FZyYLguXgXNY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1787344740; c=relaxed/simple; bh=Pu9os0W/SRWrUlHks8Q+PYp/1hdu/ceedFM76LQOvRQ=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=iVDI+vY/EpCpcyF5eh8Iycm1uBjkS+8BwwYEa1LF9QU7Az+Y7KEs+u5bSAoq6jqLWWBPh6OP40s43fOF33r+bAd4HCDZZgd/iwzTmBopM89V/fn23fxskG+6S0NVr8mIZROxDi7dZWGNH3M4TawzkpqYWYHSKV6pTI8rLMBJRGA= 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=JHEzUwRQ; arc=none smtp.client-ip=209.85.160.176 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="JHEzUwRQ" Received: by mail-qt1-f176.google.com with SMTP id d75a77b69052e-5276d598b96so7636221cf.3 for ; Fri, 21 Aug 2026 13:38:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gourry.net; s=google; t=1787344737; x=1787949537; 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=hPUCAwEXwmsDm1Y08aAC+83jadz2wtDI/6cWny3G4v4=; b=JHEzUwRQSAJc3n4sArtsZO+PB4r0FeYXjF+QHYWmyi2z22P5M3aKc/eeYOIMTO1AJD ooid2DcXdki3tEyp14XGhkLUa+u6xu25UfwMTAxi/DjsVoJorFrUCeOPe54GUkJoS/hd CtUxuur7oCyfJPUmbjlQVFy2f+Sb2c3TwXv1SVryao0pA874wNHEMPIZC5um330B+H7G 6GkCpsYlKNPGqYNKgs49BwByRiA5hVfbkk+qOYYF+7xl8Ghyl1rEqrucI+E/P6ukTuXO +I4/IeyQKAgIGTAG/HsLwod88q59GzmyvDmvHj2Xbn1JG+ftDFJIPaJE7db86PVtbzU8 2sTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1787344737; x=1787949537; 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=hPUCAwEXwmsDm1Y08aAC+83jadz2wtDI/6cWny3G4v4=; b=PdRBwR8q9B5Obb+iDGW8Q1Wr90DKriRtdDnvMm70vjC/BtPxadomzHC6Q2yFjCTZhS 0EeL7F1zGwYPukEjG5miQi6XKqwPEc0vcJfrxxPm6bwWtk1mYGPp0hT2xjkd4N2dckxD XQfj+MwKXZ/kbIk7qMcDY1TrkGURj0IeG52cOCdOvzo1OPe1GFUJdi5hyX2mC8DBplDE qexA2HYh6zXIXncZxcwttgYEE4tFiBsvayAuE7aK85St1/bovfvjo8t+eKqfPo1EdZ7H nh/T8zjJDReQ/v4zvmsJm7QcxOvU4HVqdeLJpuDuyb8r2y+uLmczy+KS+gQHfyH6Nglj dJ8A== X-Forwarded-Encrypted: i=1; AHgh+RoGBeHPQ248utpQD5wHzRrH5hrwilOkk1nkow65spR8lTc+07HKUXTbd+EpUzJRVB9Ngt/h1HADGntAYn0=@vger.kernel.org X-Gm-Message-State: AFuF++mSvTS2/cQcWJY0cHPLWZyIjcm3PFBR7phOlc5fxPIbRC6ODFwe nA2rIgiUp5F0tYKNklNwU9KZ/242WIWa5eWUCKT/z8n1fxsfmEB6CZP+dqhbl7Kv+x0= X-Gm-Gg: AR+sD12OlCoFLxVzi9i6iAXJeBN0RNYhWmq/Vs0cChKIs6gtM4RojTO4eRueY/Txl38 TObnmPzTFLdckKhtM3wNYLbfBnIyJ1Ilo3osTJppIqnwTCmzA0EnvbqQXU6TeRygCjKitAbi/Wz PYFTtbXc2W5bj5griSiMftFyw6l3D/LHKEvw+UK2k0kDXWi8N5OfpTi9HPeY5nB+h+jjn2Ur8eN TMv92Mt7eZGW5BthPRTEbpbs+ec66nekanBs5umRTrkr1wRbBXMZ159HNH6i5zAeH6CJRj0SnL1 MfoD5+Wq0cn0e8VGXkCiEzvNGWShlOppPLgfSXx/lYPCMOQSQGgm5WLRwPK7rJy/OwwUig77E/0 HB8Hs44dyuavRb7ExgYSHJbbvEZR/wmjfNCRQVEaRio+OdTXY1Nhcr1T7QOh8iKiaennMPx7RbI PXJZuSovLqpnLjzCfvq+Hv3xezcblZizWb81lZig67+l+tohKEf3vnsnjNF6bbWjCGfOVIZU+fT V6hEarFJcQvg6bi4q5fF1q623Qn0VAwH8TAgvGWtlStfJ4y0X4LSFA= X-Received: by 2002:a05:622a:991:b0:51c:f3:34e3 with SMTP id d75a77b69052e-52df5a34145mr94885981cf.28.1787344737418; Fri, 21 Aug 2026 13:38:57 -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-90c5edb45besm71093336d6.2.2026.08.21.13.38.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 21 Aug 2026 13:38:57 -0700 (PDT) Date: Fri, 21 Aug 2026 16:38:55 -0400 From: Gregory Price To: Matthew Wilcox Cc: "Lorenzo Stoakes (ARM)" , 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 08:48:12PM +0100, Matthew Wilcox wrote: > On Fri, Aug 21, 2026 at 07:23:34PM +0100, Lorenzo Stoakes (ARM) wrote: > > For the task running on CPU 1, yes. But the folio does get split rather > than probably both failing. > Which, thinking about it, this patch actually solves non-spurious (but exceedingly rare) failures as well, since prior both CPU0 and CPU1 can fail. After this patch, one of them is guaranteed to succeed. The inflated failure count otherwise are the spurious ones. > We couldn't quite make that work here since the whole point is to _never_ > get the refcount on the folio if somebody else has the lock, and once > we've dropped the PTL, the folio might have been split and thus not be > the folio we want any more (indeed it may have been freed, reallocated > and now be a pointer to a tail page instead of a folio). > Makes me wonder how many more of these conditions are peppered around THPs just eating cpu time. ~Gregory