Received: by 2002:a89:48b:0:b0:1f5:f2ab:c469 with SMTP id a11csp700387lqd; Wed, 24 Apr 2024 14:20:22 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCWEr8ChZBpcuPHDa3Geq4/uVxv60T0C+lSe/kGujXD2puTOAYWiZbuCpHao4l0EAqqh8QaoRY8t1Z8PFh96DjAqvsfRB2O2l4TmW3Mg0g== X-Google-Smtp-Source: AGHT+IGyyb5d41xcUn1q59nCQ/OOk+uAICNOauL6VKEnz0PRQo46cUKmUlvcQFJjnHPOYFCfbGf+ X-Received: by 2002:a17:906:7d3:b0:a55:a895:46ae with SMTP id m19-20020a17090607d300b00a55a89546aemr2262712ejc.63.1713993622470; Wed, 24 Apr 2024 14:20:22 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1713993622; cv=pass; d=google.com; s=arc-20160816; b=GSXbpBEsn+WHH4092Z1MF1dYblJhWtwsl7GAGdzr4+Kjz4HVRgwoO++44eBg0Oz8lu hI1w4xxFkvkFdIm6AbOPWQD2NyraTT8fBGcf1/OiwBvDRzejjpX+9Kgm5ml5VMRki8S6 MUkpzIdR+yQyZdZSKh38qsboJXB3zuoH26gNJk/3C9KOK/F76uaspWRayyCNz7LzJAQA i8g2KRLSMpkbxMhGsR/SLK4acfHu130Tnkzxd8C4BuWmDUuu3AuwpjfI1v7GCnWCDOKk 1udX04yBU+UR/xHTkWBPdeEoxWyczmrOkar3HIBr/VVpV83ONaaiCp+YKehpiK73XXsZ MRhA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :subject:cc:to:from:date:dkim-signature; bh=g5rokViQMI9btBvu2Lf/EwlosFOZS6MHZutrZA7aAhk=; fh=6zL2P5nU258H/cGsNDptmLpSQdIOMdUy7ut+gSWHANI=; b=zv2/OMq+WtImt129hZZW+oPcIOVg2H4KK1vNbv2p9OmwIrJnCB6nUgRkHS1PNebm9C NFEEG+f3oYoYbjC1mMxsQqC3Xr8XzxTEfybV/Iw7v/TwSg5XGHLolOwR/Oe2IPGiob3L wwO0HQWL9WqUrsv0FrfVGAls9oZ4q5H/ryQDqwKJCXPnqlR7Snn6eb5aOxjpxfDKAyXl uwLTg/4VbZahJ08RRZaS7CsfASwUtSL+qEoe4MxNoQT4wyN5gQnUAc8lLlOTyQhBBf2b +M81Nq8K6BkNSHkysy79plIxLXVEb6P00BFhlnsoNOGk++O/lTYX0u4bdLt4+GkEJekd FHmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=M8WWLQWq; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-157732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157732-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id gw10-20020a170906f14a00b00a52274f0257si8768477ejb.597.2024.04.24.14.20.22 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 24 Apr 2024 14:20:22 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-157732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@linux-foundation.org header.s=korg header.b=M8WWLQWq; arc=pass (i=1 dkim=pass dkdomain=linux-foundation.org); spf=pass (google.com: domain of linux-kernel+bounces-157732-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-kernel+bounces-157732-linux.lists.archive=gmail.com@vger.kernel.org" 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 am.mirrors.kernel.org (Postfix) with ESMTPS id 362D41F24482 for ; Wed, 24 Apr 2024 21:20:22 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 351F2156F37; Wed, 24 Apr 2024 21:20:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="M8WWLQWq" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 579E913C9DE for ; Wed, 24 Apr 2024 21:20:11 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713993611; cv=none; b=fe4W0182iOX+3NEnYRXXLVnaW/eRGkNjjQkVhLqwP18kZjceajCwlQJO14mhwPVTCJFle4LmFGqihSP2JV7SfJPQDgWUHMEw/zqkajQ3FmtFGwWnI8eI7H7gEKjp9e4D2VCcmSr437CwA7YxORcaCR3GVYPO3N8rirgn29g3QKg= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1713993611; c=relaxed/simple; bh=GrjNEdck+k+VpT+CPfrPUvz7/fnE4GeQWJaxKgyyI7Y=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=aP23N7qdme4xqUrKAb4XitcFWPlMiY+g0a8qNE5qj4sMOoSSytAR26PZpBwaehjYxs8kVXS7Sb9hGNnqlb4kWJnqM7MkBYrRJkXaVjPW96BacLjPQ0QPL+N6Dccy0bjFytlwhBEz7SR12im/32ddJBb7+AdKhuHAwpTZdzX84oA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=M8WWLQWq; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id E9D60C113CD; Wed, 24 Apr 2024 21:20:09 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1713993610; bh=GrjNEdck+k+VpT+CPfrPUvz7/fnE4GeQWJaxKgyyI7Y=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=M8WWLQWqXAGC5AJWDe0qHoNDaRU9IdxcFIfG2aL6YAUWd30ejte+TtJWWSE88qtJ3 AFiACzTGRSUgx/NraUv6oh9V7pvfQnkLZksYEP/Y4xPD3mi56ORmSnVPxS37oPBa6p WrcBJ6ufW+tUtZEDuL3sEjWZCPe0zEYeByuKo56s= Date: Wed, 24 Apr 2024 14:20:09 -0700 From: Andrew Morton To: Lance Yang Cc: Matthew Wilcox , maskray@google.com, ziy@nvidia.com, ryan.roberts@arm.com, david@redhat.com, 21cnbao@gmail.com, mhocko@suse.com, fengwei.yin@intel.com, zokeefe@google.com, shy828301@gmail.com, xiehuan09@gmail.com, wangkefeng.wang@huawei.com, songmuchun@bytedance.com, peterx@redhat.com, minchan@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 1/1] mm/vmscan: avoid split PMD-mapped THP during shrink_folio_list() Message-Id: <20240424142009.149eb988cca33822ce0fd0f1@linux-foundation.org> In-Reply-To: References: <20240422055213.60231-1-ioworker0@gmail.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) 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=UTF-8 Content-Transfer-Encoding: 8bit On Wed, 24 Apr 2024 23:46:59 +0800 Lance Yang wrote: > On Wed, Apr 24, 2024 at 12:15 PM Matthew Wilcox wrote: > > > > On Mon, Apr 22, 2024 at 01:52:13PM +0800, Lance Yang wrote: > > > When the user no longer requires the pages, they would use > > > madvise(MADV_FREE) to mark the pages as lazy free. IMO, they would not > > > typically rewrite to the given range. > > > > > > At present, PMD-mapped THPs that are marked as lazyfree during > > > shrink_folio_list() are unconditionally split, which may be unnecessary. > > > If the THP is clean, its PMD is also clean, and there are no unexpected > > "If the THP is clean, its PMD is also clean" can be confusing - sorry. It should > be modified to "If the THP and its PMD are both marked as clean". I made that changelog edit.