Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp524708ybf; Wed, 26 Feb 2020 17:48:26 -0800 (PST) X-Google-Smtp-Source: APXvYqwNVkMY9wBzhQxNSjZ7BfGiWhU1IsDIZ5vQDEQlyg5/+iSKfhXvyY5QeKxvBIe9TqPw8Dix X-Received: by 2002:a05:6830:114f:: with SMTP id x15mr1369677otq.291.1582768106483; Wed, 26 Feb 2020 17:48:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582768106; cv=none; d=google.com; s=arc-20160816; b=nbQX/2kcCq7JoXljBEb7+hnMsz1OQMR9ARk6MdWJuzVh5n+BSD5fT+NZTlmFx83aNg IoPWHJIdoriaBlqTKw1yMXS0/VXpc66RY0cZfmC83/IZxbgjDEOQNCJhJ/+GV86l29J5 l4ZUFtlJnN4rwCFdikrNxVEbhdKZdHnx8V48cA8bWtc6xQ01KL0/R5XxycXP+uICzW3l Qb3Aub5dR/QQ2t7owHZ4Cj0w5UX9ZklIU/FoegWRWsqxDW3/UF8Z4ryyXK9BkZBpMQhg 19Q4V/I3GpH5X8U942pmVkx1A7SMmIUb/c0l+6fGQZzOH/+ISFPOTd1Byv+fF0/8pZ7n vm9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=AE6889q2qb8rpie85RPam0pI5EqkhHNnHAqyKfAYF6g=; b=EjPOywReWt4SlAjH6FXQhQJIFpyq70rJTOOr97mqwiaZu4jp5dRF0sjxNDfTvD1maN C18aUX+34ZhjrXSByKG+tqeNRfr13TJlZGHWK9RrUKfYyW9bXvAM/+hlgAW95Qn5D4Zo JX/0xqRNKHSXhUonApjsQpD6Nfm0xDMBUD+O9QvqLyqsJyl3wjwJMjziUGo6YT9Qze1F V1vV3jALJcpa7pebL+NUSykxsjEyxvOhIwlMz1jRNbXdPH39LndMAFgAJ1AJhL75obhE siMsyhKrBiVqs3lmy+0CxFH/r0Hae2qoRJatAMElQdZBH+3RkJbPqdkXR08cjb/TERSY WFLA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WipzyxYr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 7si487570oij.29.2020.02.26.17.48.14; Wed, 26 Feb 2020 17:48:26 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=WipzyxYr; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728241AbgB0Bre (ORCPT + 99 others); Wed, 26 Feb 2020 20:47:34 -0500 Received: from mail-pj1-f67.google.com ([209.85.216.67]:39127 "EHLO mail-pj1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728091AbgB0Brd (ORCPT ); Wed, 26 Feb 2020 20:47:33 -0500 Received: by mail-pj1-f67.google.com with SMTP id e9so441419pjr.4 for ; Wed, 26 Feb 2020 17:47:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=AE6889q2qb8rpie85RPam0pI5EqkhHNnHAqyKfAYF6g=; b=WipzyxYr6BpGAd3Fs5g7ugMep4T529oPKLg3EHu7DidhKJzzpQyR7O6iM3OuPa1P1Q 4vufBh0VEUSWsF6Nm0B049A+EKJ1ek3nyzvIFDyrsaxcahNuLUQUgymD3lVotHe1C4ij 21wZlxLBJNWqrW6ajkLFAe+GhCxdvgT1ljLxyz1iNrTLaZGgQS1DaQY/EYbdXPYzEZEb cvHpnSGrZ4ABTn1EkmtHbqzi6y+ermUVTHPjIo7NH3Os6a3UCfgNnApIXHPrFUcr3ZYg h1+gESfWpcGIxn/VLhppFZmTxXpxF1DuLI+vF6As93owBNIboO0EKGt7GRwrSgZZallJ vLGQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:in-reply-to:message-id :references:user-agent:mime-version; bh=AE6889q2qb8rpie85RPam0pI5EqkhHNnHAqyKfAYF6g=; b=bMy1VDWnhsS7BKiySmOTDeFQshLLjTLMLcRnCVjiG2ouK0F8IppuaVBylRzIu1vLSm 2yVy71T9s/4KgK/ffMDN+wUckS7Er9lWQBXXdGyRymf88g5uQCSqTU2LKVU6BQATawfx 4zLnfLXj/Ly5PGmsEe8tkVnb3wE9Q+GTEIWQuik4D/GkugwVUQ9Vzq+2hurJYbR1KcCV NbCgyVMBEgwv0PdXFV6zKIQOqeoY7x/hgG6XtnNy+5Cifb8JFl6TQ5M5xbaRJEOUILOt bTnalngLSGrzs9M6aUgL0n8SCPouFPZfvrJFk+N4DpSmZkl08fHc5WDD2uygmh0TzD+q x9UQ== X-Gm-Message-State: APjAAAX7tFhvtzie6+RlGTSJVQ08HKMYgwSiLblMCb3ZpUHUfmFmnzNB jRW9TE3VFwqwyWH1x8y30ePM7Q== X-Received: by 2002:a17:902:c509:: with SMTP id o9mr2160608plx.112.1582768052287; Wed, 26 Feb 2020 17:47:32 -0800 (PST) Received: from [100.112.92.218] ([104.133.9.106]) by smtp.gmail.com with ESMTPSA id l12sm3983547pgj.16.2020.02.26.17.47.31 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 26 Feb 2020 17:47:31 -0800 (PST) Date: Wed, 26 Feb 2020 17:47:16 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Matthew Wilcox cc: Yang Shi , Hugh Dickins , kirill.shutemov@linux.intel.com, aarcange@redhat.com, akpm@linux-foundation.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [v2 PATCH] mm: shmem: allow split THP when truncating THP partially In-Reply-To: <20200227011654.GF24185@bombadil.infradead.org> Message-ID: References: <1575420174-19171-1-git-send-email-yang.shi@linux.alibaba.com> <00f0bb7d-3c25-a65f-ea94-3e2de8e9bcdd@linux.alibaba.com> <20200227011654.GF24185@bombadil.infradead.org> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 26 Feb 2020, Matthew Wilcox wrote: > On Wed, Feb 26, 2020 at 09:43:53AM -0800, Yang Shi wrote: > > > No. The pagevec_lookup_entries() calls from mm/truncate.c prefer the > > > new behavior - evicting the head from page cache removes all the tails > > > along with it, so getting the tails a waste of time there too, just as > > > it was in shmem_undo_range(). > > > > TBH I'm not a fun of this hack. This would bring in other confusion or > > complexity. Pagevec is supposed to count in the number of base page, now it > > would treat THP as one page, and there might be mixed base page and THP in > > one pagevec. But, I tend to agree avoiding getting those 14 extra pins at > > the first place might be a better approach. All the complexity are used to > > release those extra pins. > > My long-term goal is to eradicate tail pages entirely, so a pagevec will > end up containing pages of different sizes. If you want to help move > in this direction, I'd be awfully grateful. But I wouldn't say that's > in any way a prerequisite for fixing this current problem. You're right to be moving in that direction, but yes, that is a larger task, and I think both Yang and I have to decline your awful gratitude :) Hugh