From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-pf1-f181.google.com (mail-pf1-f181.google.com [209.85.210.181]) (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 9E1472AD35 for ; Mon, 20 Jul 2026 04:35:48 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.210.181 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784522149; cv=none; b=FTDI+dW0HnFmhneu1TAIG1f4KARAkKpaCqP+76wVvKpLfxV/9tv8f+crW41yRtqrClHFt6Zw2WecJBFIbP8gsO6pvFQcG0AdsRwEJ6762+6ZAFZEovmDlaz0nBdHrN/b0dWVVcxvmHiKvq16r9DbU2eh92ndTdMF/rDQnw/HqFU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784522149; c=relaxed/simple; bh=BXVQ4sPuBVkEzNaRP3g2fl9gM9PDXqBht0OqTZ3O7Ms=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=DBuAW0Sx2Nt75A85QnIycQP0myL4/vTs+hcZQdXX7U9Ra5CjecVs8fnVhGh4LHIlsYq4J7C/ESCsY9JGrXHJDDXVktFchAIi7eCK1X7Xv8BxWWDvJSgw3Ruh9zFT6LPi+tNpDzejzrH9rW5rtNqdoCUR+yIkSgqJn/47zkJsMXE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=C/sAL+Zu; arc=none smtp.client-ip=209.85.210.181 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="C/sAL+Zu" Received: by mail-pf1-f181.google.com with SMTP id d2e1a72fcca58-8423f236418so4804445b3a.1 for ; Sun, 19 Jul 2026 21:35:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784522148; x=1785126948; 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=mdWX6Ff2gVM1G5blx3T+Y3zQJjFhvHV4u/q40zy5x+8=; b=C/sAL+Zu/T1KyfyQzEQiMioqUeg03d7Lm1/1pgKgNqYQPIP5Ix86cdMgKSP2ny6PgZ b+fMAABdvS3yj6S21ILLfQcAaBE59In01VLsAuq40FAPCoiFIT7E195b6duUIhkmDnLR i4UvtnbGAlT44ax0RgEZP7JnK6KMDWUhE62i63CP11L6Z9Hzaz3o5zwHEnGgKnBIq5zg P44PLRbitLdFiduhPqVL/50qs2VUyS1k9lISnMlflAUnpvtaXtYdeZrHkkYqgBMxidCt NAsW9Zt9t7QdyOV2hY/lyro6EKYisDoD177I+xj+J1o7MHnhVq661SUCdWRw6V8ECSMW 01Lw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784522148; x=1785126948; 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=mdWX6Ff2gVM1G5blx3T+Y3zQJjFhvHV4u/q40zy5x+8=; b=Qp0tb9/QMnW4qiHJhbuz7242HTYQfzQVj/4BLOQyHE0ABX8BoavYR9/Y9MsfKI9E0z tjbyMT+IDr+zLtGKsm+RESOYSlbWYq+zTcClZ/DXQSZ5yymFIJ1H6ZKOd/KuLZvEVwe9 ov9yfXleRqbe55daBvWgC1ICNYCrgTUzjipJwPeDStiFzJfkH1w/H8dqx0+/iO9c89RC H6PyeRNX+GzpXq2WhJA53flC4x9AFgwopIrEPrynWaXVLOXt3uUNSqh4auRDMy82ywxU Botf0e7uCN4mJ/qU/VVmJkZg7lxKvHEl+/coE8ml+AmprIiZSAOwoeospV817tH8vAyu 597A== X-Forwarded-Encrypted: i=1; AHgh+RojyrStyouDs9FIbLHUpb1LyUuHWhlHO+nPvovVC2+nLwZCnrg8a4KLHkisYgzexMVjUz60mSFKeoEfrQs=@vger.kernel.org X-Gm-Message-State: AOJu0YzrsiVoRyjJE6USCHVK22Jxa4ybwhLSfIDaPCLCcUfuMIkCIQJD ttuGibE8X56+jOH57pkHhS3AZgPkquXLju/unlsMKlRkLFFjx0i0iiYJ X-Gm-Gg: AfdE7ckMJT3m0mFPc0mEpXLsQOPOyl0hwlBhbFrCaGIcCcuwHpmE6EtN2yZxQWmm5nn ZszFvwg6LzYFY7zft5IxTP1p5IQxC/onuUzNn/Bz5AUSTRzMDYUBCJm/ajW+Gvs4MV3GfZqmn4y 04X1oLaKZmfozn1TQ7+IpuSINIIR/GUhQ7Mc+qfHEAEes7GVe+SPoMggtw9pRxn301t0eoWm3tc 8valgcwwb/EpaaIDCTriN3LOlBAZUo3xYyBaDxpdbgmI1cEN3KIEuJBTSb/9hwH7jdtWLraBec5 UFNZujC9qTAa+A4ZMKySDK5beSyRJfqTioMrOaJeVHzJJDDyLC3p5BxltxKCJEpK4UoPN65wQP5 2bSQYvFDUfy4Ie5HOI8SL2OOg5nn1rTCDxTtAfKFcJt27KIPen16I46PqFHoM8Uh90NaUiaDwRo CyO72teh1gXAiasJl2mw1NTyxjoI+alQXfc69glBAzpr7002c= X-Received: by 2002:a05:6a00:3e29:b0:848:7fea:93aa with SMTP id d2e1a72fcca58-84c292a0ec9mr11937266b3a.21.1784522147429; Sun, 19 Jul 2026 21:35:47 -0700 (PDT) Received: from KASONG-MC4 ([43.132.141.24]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-84c2adcaa0bsm4970874b3a.20.2026.07.19.21.35.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 19 Jul 2026 21:35:46 -0700 (PDT) Date: Mon, 20 Jul 2026 12:35:40 +0800 From: Kairui Song To: Matthew Wilcox Cc: Andrew Morton , Kiryl Shutsemau , David Hildenbrand , Lorenzo Stoakes , Miaohe Lin , Naoya Horiguchi , Zi Yan , Baolin Wang , "Liam R . Howlett" , Nico Pache , Ryan Roberts , Dev Jain , Barry Song , Lance Yang , Usama Arif , Hao Zhang , Hao Zhang , linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kiryl Shutsemau (Meta)" , stable@vger.kernel.org, Kairui Song Subject: Re: [PATCH v3] mm/huge_memory: unlock i_mmap_rwsem before releasing after-split folios Message-ID: References: <20260716095424.471052-1-kirill@shutemov.name> <20260717195851.609269e143b4b9eb857f2a6a@linux-foundation.org> 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 Mon, Jul 20, 2026 at 04:34:37AM +0800, Matthew Wilcox wrote: > On Fri, Jul 17, 2026 at 07:58:51PM -0700, Andrew Morton wrote: > > (why is mapping_set_update() a) a macro and b) undocumented?) > > commit 62e72d2cf702 > > So make madvise(..., MADV_COLLAPSE) also call xas_set_lru() to pass the > list_lru which we may want to insert xa_node into later. And move > mapping_set_update to mm/internal.h, and turn into a macro to avoid > including extra headers in mm/internal.h. > > Take it up with Kairui. And whoever it was added that patch to > linux-mm. Right, I initially wanted to make it a inline helper, since this function were a macro and later become a static helper, so it should be super cheap in the hot path. That requires to include extra headers in internal.h and that looked a bit more uglier and every internel.h user will have extra header dependency. Moving it to pagemap.h also looked confusing along size other mapping_set_* helper, they are completely different things, and this help should stay in mm/. So I just partially restored how it was before b64e74e95aa6, It was never documented though. We can make it a function for sure, open to suggestions on this.