Received: by 2002:ab2:3c46:0:b0:1f5:f2ab:c469 with SMTP id x6csp153060lqf; Fri, 26 Apr 2024 02:36:23 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWxHszww36h/oeRVdEbvgfllLIsHBIzODCAmLioqilNi8XkGUVpVjKYYD2qj1HK0TBTTorCEQR7XfkkSzRAHHcgKAtqo3zQsIdutrljPA== X-Google-Smtp-Source: AGHT+IGnHJBwuwTTZmzRSUVI2C3UxAtHgMGN5LqRaV+dPIRWlo7c+lS0soatI/VMMsXyhN4oIjN5 X-Received: by 2002:a05:6a00:1151:b0:6ea:c2c7:5d6a with SMTP id b17-20020a056a00115100b006eac2c75d6amr2575257pfm.2.1714124182498; Fri, 26 Apr 2024 02:36:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1714124182; cv=pass; d=google.com; s=arc-20160816; b=0JqLKuKsAd4YZtEpBCUVjnQO93fCIuxtbMw9I6gFD+Q90/8oooFck9FQuw56VxKSfX +JK7h1b9NsAFubVoWrcpo+1LJSjDTZJcNIBTNUP+PVi2qaI/jSyVfL8A2gg+iaEZscnx PXEcMOZUIQbCFPeWpQfxMAk/9htJGKnGROaX5N933u/LKXRrycT4OsM/1ac5mZ1pjXHr J5Yqut3lWugDczVoyVAbQnDBM915P6yBJlGe+eDPaMH48adA1FbgS6SlFDOM+gDNstuj ZcP6ombauP1kPjbdwg13y4AWeofT2x7f+cTbSdKvz0HZ5Bi8kpAauY0Y6zgindP2EAQC cGlw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=cPuH+vBjv5eyQAgbcQ7abdv/zl57lH4J1QFyOBw4iiY=; fh=sYc+G6I2Q5g0y9X3ArGx9ROhbc9GTUfKQ5OCuHqERmU=; b=tUaWKCoUeKKiwpgYLSZu1O8if7dqMqTN79VD6HqtEBkZHZnyUUVaanqt4t9xdmO29F DEVczYinK9VrtHDf5crb9UujY12oqk6lpwxRupn0oSCVfR9/I7Okx4/r4IBeFZT2iwTJ n7/TOJTHwoAdnV5axEIQc5ayyb0oh0l+rzQXKSB79Vn0hVJlz0/NfrBw0qbim7ukfIMN tMdEwcLdAlnFqq25blOQjWWZTTsNcd4T4C47z/p1aNH0UUa4LSUcLWgCQmpHPaQ7O210 ah9toDuYAKGvBUCM09B7hLhjIO235athKDoQV8G3legPdBOkR3337TpaJqgnFBcNbHWJ FoXg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LHQIXMFT; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-159794-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159794-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id e2-20020a635442000000b005cdf8b03384si14574607pgm.805.2024.04.26.02.36.21 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 26 Apr 2024 02:36:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-159794-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20230601 header.b=LHQIXMFT; arc=pass (i=1 spf=pass spfdomain=gmail.com dkim=pass dkdomain=gmail.com dmarc=pass fromdomain=gmail.com); spf=pass (google.com: domain of linux-kernel+bounces-159794-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-159794-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id 26DBFB2335F for ; Fri, 26 Apr 2024 09:34:30 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 04E4E13F450; Fri, 26 Apr 2024 09:33:57 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="LHQIXMFT" Received: from mail-ed1-f42.google.com (mail-ed1-f42.google.com [209.85.208.42]) (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 B711413F436 for ; Fri, 26 Apr 2024 09:33:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.208.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714124036; cv=none; b=WeR5U9jn7+OTlnIhi5o/2g5qavn1Nb+LZoVFBRKZoOdFSMORHUoP3937ztPg4dduGd8nnaCb0AA+9Ux+0TrqkOlGZZ/RTOMPpV9e2Q/WJ5d79wJXQ2aUie4DlXt6TKtb4isuKu6UEa8TzJnCy17oV4//DOUgqvCCNM+nm/kQQik= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1714124036; c=relaxed/simple; bh=/pMH4enciC7L9Alrpd3tuEENkzHhRgIR4fDOAN+IbQs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=gpTDmEoBVZfBZmIH8wvZhMl07qh0coQYRbjuOiOWykqcWLbPKqyAwHQTURAejHZX2GjT1YExVbh8+niAmlKAEM3BYBkNz0s3ZVVYvMiJbYBHTcC3YlojO10K2S9Yn7iV3G4dYiZN6v5BG8YEiWkmwWi+6CDQg32VUAZTrBGAAh4= 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=LHQIXMFT; arc=none smtp.client-ip=209.85.208.42 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 Received: by mail-ed1-f42.google.com with SMTP id 4fb4d7f45d1cf-572229f196bso2358357a12.0 for ; Fri, 26 Apr 2024 02:33:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1714124033; x=1714728833; darn=vger.kernel.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=cPuH+vBjv5eyQAgbcQ7abdv/zl57lH4J1QFyOBw4iiY=; b=LHQIXMFTykhyOU7VZ1d2A7PPuEYRBLAUcT894E6Ixp+18A/jqro5yt62y4EWxT1KZN IobWW77dKwlSDwPnUPuZ4u0qh2tVj4xpUxHpgj7ou8RhAuq0BYpXYpLEloZynEE/edVQ IfvK2bPthJz7jPLhxqYECA7rB6p+R8ryp02hXGlNRWqRfY3T1yGL64uHjX3pGCrUzLYw TuK9uvDOgGiWCIEQCFDcr6ASWCThxgNTocOQgNOJqnpcfkfhlZN+sI1+r2SKr55KXoR7 0sY6WggSREywVnqEygN9P5OQrK+XZuzLLy7QNgzsUmHu0Xf/1rgN161Xx9JJ8nL4o8ra /VZA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1714124033; x=1714728833; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=cPuH+vBjv5eyQAgbcQ7abdv/zl57lH4J1QFyOBw4iiY=; b=YWN702T/QlnWrpwJPNXAL8jfRb2mHIiX6p3W/jtQxqnVGbRZiYAgFaMBoR5ZRwA8AJ xBOD6C1aFLIPVH+Yx7Vf/QSgVZSv5OcKYr1dDrcL1blnsM6fj8Xb1j64kdexoCrjxnrR BKqBwyG5o7Sj203LljZ5MSk25u++E/l0dCRWS2J50OxlDfJWD5zK58LLV6o7rQUlpGmZ CkU3yWJPMxdqkt3FlGIfSUqp0tIoSrd1qdKRT5CF6U1ZbJHGPu3tzbotPtV4HjiWkE3z d2AkOl72HDcbNxy0a/Aof3LB8H76v/3z8alMY5OGr6MqeqqqH69poP03CGYFRmyQneFJ jXYA== X-Forwarded-Encrypted: i=1; AJvYcCVLlAmAXCU0Q382M3RS9hToYuTKyv+7wH/I4Ee08vdd+f28Kxu+b0j3HWvezM9TxwI8wCgx1VX3AKCWRl/SIykIyYoCi+kanA0z6v/3 X-Gm-Message-State: AOJu0YzFx+e9Hbmd+SebWprctc5L9cDnZv8xHTsLxk+Ngoe6gQ57+ZZk ZT4buQtsiqbocmUrf4ro1w+J4/wbubZBXWoH+hNsPeYvEuWJNkvYqCLYfU3vRuX8MgEvS33NUNC vOktcvFYe3blBspRtxwHkWHQOc1oPItEz X-Received: by 2002:a50:950c:0:b0:56d:f47c:5308 with SMTP id u12-20020a50950c000000b0056df47c5308mr1351685eda.34.1714124032931; Fri, 26 Apr 2024 02:33:52 -0700 (PDT) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240425211136.486184-1-zi.yan@sent.com> <7c233278-1006-4449-81b2-d473b18a66ca@redhat.com> In-Reply-To: <7c233278-1006-4449-81b2-d473b18a66ca@redhat.com> From: Lance Yang Date: Fri, 26 Apr 2024 17:33:41 +0800 Message-ID: Subject: Re: [PATCH v4] mm/rmap: do not add fully unmapped large folio to deferred split list To: David Hildenbrand Cc: Zi Yan , Andrew Morton , linux-mm@kvack.org, "Matthew Wilcox (Oracle)" , Yang Shi , Ryan Roberts , Barry Song <21cnbao@gmail.com>, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Fri, Apr 26, 2024 at 4:26=E2=80=AFPM David Hildenbrand wrote: > > > > @@ -1553,9 +1557,9 @@ static __always_inline void __folio_remove_rmap(s= truct folio *folio, > > * page of the folio is unmapped and at least one pag= e > > * is still mapped. > > */ > > - if (folio_test_large(folio) && folio_test_anon(folio)) > > - if (level =3D=3D RMAP_LEVEL_PTE || nr < nr_pmdm= apped) > > - deferred_split_folio(folio); > > + if (folio_test_large(folio) && folio_test_anon(folio) &= & > > + list_empty(&folio->_deferred_list) && partially_map= ped) > > + deferred_split_folio(folio); > > And now I realize that we can then even drop the folio_test_large(folio) > check here! +1 Thanks, Lance > > -- > Cheers, > > David / dhildenb >