From patchwork Wed Aug 19 18:48:42 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Matthew Wilcox X-Patchwork-Id: 11724899 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4F839739 for ; Wed, 19 Aug 2020 18:49:18 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2E3D820758 for ; Wed, 19 Aug 2020 18:49:18 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=infradead.org header.i=@infradead.org header.b="ZmtYcgiZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2E3D820758 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=infradead.org Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=intel-gfx-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 954426E5C1; Wed, 19 Aug 2020 18:49:17 +0000 (UTC) X-Original-To: intel-gfx@lists.freedesktop.org Delivered-To: intel-gfx@lists.freedesktop.org Received: from casper.infradead.org (casper.infradead.org [IPv6:2001:8b0:10b:1236::1]) by gabe.freedesktop.org (Postfix) with ESMTPS id C2A096E5B2 for ; Wed, 19 Aug 2020 18:49:06 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=casper.20170209; h=Content-Transfer-Encoding:MIME-Version: Message-Id:Date:Subject:Cc:To:From:Sender:Reply-To:Content-Type:Content-ID: Content-Description:In-Reply-To:References; bh=w+HVqr4efGoD6sO5rh6jBUm19i4nXIWL4lYqxm6m+Dw=; b=ZmtYcgiZ5LdbDSIKoVXUG1ouFg /hfkSHtfH3uHd26x5DjGqRysCKmmFZ9MCgamFq9q3hfGzI8pECzDcZV9/Nq4ICmOUp0D4/9zRsJb8 kIixebqo4HfYXJGK7bYVSwORjoUKlHeD68WpP+Yr8GaLfd+gblrSY+C7I1H2PGW/bbSx3NAW72duE uDBfPYyqJ3SL/9LtMwu4H1SAx5sI40Rrelt5nfF+kX0367TC4hz0v++1/aFxyPDIhEFDv+Y0HyOG3 XX9Uttsq1ZrFRlbcEGnwRwLXA1c1OOi5+STQo4WqHMNi0W+Hl0c7U82skzW23ti+d3yK6kof329hs 9846SOKg==; Received: from willy by casper.infradead.org with local (Exim 4.92.3 #3 (Red Hat Linux)) id 1k8T8m-0006Sk-C1; Wed, 19 Aug 2020 18:48:52 +0000 From: "Matthew Wilcox (Oracle)" To: linux-mm@kvack.org Date: Wed, 19 Aug 2020 19:48:42 +0100 Message-Id: <20200819184850.24779-1-willy@infradead.org> X-Mailer: git-send-email 2.21.3 MIME-Version: 1.0 Subject: [Intel-gfx] [PATCH 0/8] Return head pages from find_get_entry and find_lock_entry X-BeenThere: intel-gfx@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Intel graphics driver community testing & development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: intel-gfx@lists.freedesktop.org, Huang Ying , Hugh Dickins , linux-kernel@vger.kernel.org, Chris Wilson , William Kucharski , "Matthew Wilcox \(Oracle\)" , Johannes Weiner , cgroups@vger.kernel.org, Andrew Morton , Alexey Dobriyan , Matthew Auld Errors-To: intel-gfx-bounces@lists.freedesktop.org Sender: "Intel-gfx" This patch seris started out as part of the THP patch set, but it has some nice effects along the way and it seems worth splitting it out and submitting separately. Currently find_get_entry() and find_lock_entry() return the page corresponding to the requested index, but the first thing most callers do is find the head page, which we just threw away. As part of auditing all the callers, I found some misuses of the APIs and some plain inefficiencies that I've fixed. The diffstat is unflattering, but I added more kernel-doc. Matthew Wilcox (Oracle) (8): mm: Factor find_get_swap_page out of mincore_page mm: Use find_get_swap_page in memcontrol mm: Optimise madvise WILLNEED proc: Optimise smaps for shmem entries i915: Use find_lock_page instead of find_lock_entry mm: Convert find_get_entry to return the head page mm: Return head page from find_lock_entry mm: Hoist find_subpage call further up in pagecache_get_page drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 4 +-- fs/proc/task_mmu.c | 8 +---- include/linux/pagemap.h | 16 +++++++-- include/linux/swap.h | 7 ++++ mm/filemap.c | 41 +++++++++++------------ mm/madvise.c | 21 +++++++----- mm/memcontrol.c | 25 ++------------ mm/mincore.c | 28 ++-------------- mm/shmem.c | 15 +++++---- mm/swap_state.c | 31 +++++++++++++++++ 10 files changed, 98 insertions(+), 98 deletions(-) Reviewed-by: William Kucharski