From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.0 tests=DKIMWL_WL_MED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1,USER_IN_DEF_DKIM_WL autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 7ED43C4BA24 for ; Thu, 27 Feb 2020 01:47:35 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 323BF208E4 for ; Thu, 27 Feb 2020 01:47:35 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=google.com header.i=@google.com header.b="WipzyxYr" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 323BF208E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=google.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id D01276B0005; Wed, 26 Feb 2020 20:47:34 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id CB1B36B0006; Wed, 26 Feb 2020 20:47:34 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id BA00D6B0007; Wed, 26 Feb 2020 20:47:34 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0023.hostedemail.com [216.40.44.23]) by kanga.kvack.org (Postfix) with ESMTP id 9E6056B0005 for ; Wed, 26 Feb 2020 20:47:34 -0500 (EST) Received: from smtpin06.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 4FF6F8248D52 for ; Thu, 27 Feb 2020 01:47:34 +0000 (UTC) X-FDA: 76534220028.06.van59_7d52bea9f445 X-HE-Tag: van59_7d52bea9f445 X-Filterd-Recvd-Size: 4610 Received: from mail-pj1-f68.google.com (mail-pj1-f68.google.com [209.85.216.68]) by imf47.hostedemail.com (Postfix) with ESMTP for ; Thu, 27 Feb 2020 01:47:33 +0000 (UTC) Received: by mail-pj1-f68.google.com with SMTP id a18so420010pjs.5 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=FUc3Bj2G9C/LxJfXZ3b86hWMdo6K8ftN3S7zxxplA2lqgVEH9jiFL8OxgMwtXR3PAm ZpVY2lN4hk27OHuI1CkGquf2RY9+kM+031Xl7KDi+RFSIa3gr6pzI8eV4PCSLRAqarre IH9XTXVxOwGX3/L62EEokXoWiJdKG6/yhpaCRtuDzN966TkAfO/trrrUKWbuvTESQFZf AUkgyk8qzWKSaOHDcmZeQOQgzF8jz71qDwvp1dzS1Ech/nQLE8r87LZkNVgZdAKPoXOC ywSrM8/cRptuvSOWkZLudq3K5hYyec9GpkuI9niTbHKX+/8JGeGTFGMxJ35jftO2KlAg Cobg== X-Gm-Message-State: APjAAAVGFHRmQt3QhJz9eGZHaYVhp/TcexG3mhTFn3Nkw6fdxPdVpvhH 0X7GcjYR0wWI9iWhjEE8CDQmTw== X-Google-Smtp-Source: APXvYqzsL2huyAGMkpt+mb/l/fm0hl5JvyoDs1hla941bElVQ8Uin2dKH9hhhnr2w8Wq8KTtHlxCsQ== 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 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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