Received: by 2002:a25:c205:0:0:0:0:0 with SMTP id s5csp499806ybf; Wed, 26 Feb 2020 17:17:42 -0800 (PST) X-Google-Smtp-Source: APXvYqykUAGfj3BRFyMTTkNPoDQ7ae0np9KYm9SxRUkby69oqGucgcDukm2huvlttHhN2CLvQRmr X-Received: by 2002:a54:4010:: with SMTP id x16mr1570009oie.174.1582766262778; Wed, 26 Feb 2020 17:17:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1582766262; cv=none; d=google.com; s=arc-20160816; b=P2BDjpZ1L/OBQjgeHT3j1MrR2v9A+0I8DTvRUwuSFix3WD5KvPf0UO2rdDShPlCpht LSN/qpUEldQhQzdPLHIu8XijONwFk8594v2zpn6Fq4/TfUoom1yUJjLNsgzE1jqwj297 54P8pa8xQjBc9Daz2XPlL9ZHUAlhbhQw8J6mCs+XY+DzFsgSAEZ09OsG2lNZQiY1pcjv 3u24DDkHkpen4T365wxGmepfdSja31BtWGu65MdCVFnTvfM3JoUBg2CKMaOwxEKbE6kb t+3VFefLl//KXTQuvdp2MUH21UrEHTJvPnojyJJy2j1shEriEAd6Ot4MrjrbaCpChW7+ JQew== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=xzybkCZjTyLb0VqFQbFVRWtDGZw2aWyH8QFRYq4X5ek=; b=VMbCVOt37pfUVxov+L5L/7LvnpjY7optmLSWESCWvsgyYWIU0Kj5LAMXnNIboltSks 4MFHyOOa6RlhpeZtvYYsMTT2GsGUF1q8SVWqWYxX6B9k2ej6/ovjBtJYpqIL/m54hQ3E pKOEl/KN/g908DUGoL2s1+jKxH+kon23tA1tHnxwR6w6p5wQ+LAi8x7MV4Hd9e8+DmX3 u/qZJPUSfdqGtM/cc/g5cD6TV4jwtBpePKqpkESg58nsLMixnQHRAve/HTE/BZVEu5lQ PFn8VUx2tt9h0luFmSkoogme8IM+I1klghVLarVJ44Xszrv2Iqevi1lfLFY+IiWCT24b KwUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=AHnBLjn3; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id z7si405190oid.150.2020.02.26.17.17.31; Wed, 26 Feb 2020 17:17:42 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=AHnBLjn3; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728178AbgB0BRC (ORCPT + 99 others); Wed, 26 Feb 2020 20:17:02 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:59846 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727964AbgB0BRC (ORCPT ); Wed, 26 Feb 2020 20:17:02 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description; bh=xzybkCZjTyLb0VqFQbFVRWtDGZw2aWyH8QFRYq4X5ek=; b=AHnBLjn3kbXNGq+iIcAM/IqPeG JZYPRLDzH7mPdDTuloPqFSuLzcF3h5TA8TZ4QYrkW8bWechx/eIpBwyF1LJay4svFJHUuFA648xqX wXZAFNIqO7iCCPjs+rOzUQb6vxKMzXp1PoZO2AhjwRwn1XeYj0Z6L3t8I4z3UNu9F+P6Nfl85cGmN y18ZvmzNBv3xFkEHZADGZ80vlsuzY3W2PuItl54mWN2ZiRqTGmO1a6b3jxPNt+8//WDbPzLS7TWW/ lKx6yfrVHEpEa0aQKFGmANPhjbIdFBkBprRE9MrPO7uiMyYmJ/L4q26nIRVBhIHudGH8+KBXfyZ/u BDF+0EVQ==; Received: from willy by bombadil.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1j77nK-0003bv-44; Thu, 27 Feb 2020 01:16:54 +0000 Date: Wed, 26 Feb 2020 17:16:54 -0800 From: Matthew Wilcox To: Yang Shi Cc: 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 Message-ID: <20200227011654.GF24185@bombadil.infradead.org> References: <1575420174-19171-1-git-send-email-yang.shi@linux.alibaba.com> <00f0bb7d-3c25-a65f-ea94-3e2de8e9bcdd@linux.alibaba.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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.