Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2764072pxk; Tue, 15 Sep 2020 01:28:07 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz39JgJsaQqMm9jg9TwuGTg0PXEsJP9wqCcGcaPSQHk0SMyG7pT3BBoBWxhK3nmOAZ6kjLK X-Received: by 2002:a17:906:c8d2:: with SMTP id gc18mr19764644ejb.467.1600158487596; Tue, 15 Sep 2020 01:28:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1600158487; cv=none; d=google.com; s=arc-20160816; b=er9BwxMJMaD+wHnzsNdi+t5vecSMwW0ES0JJVIHvSILTzfO6YcuHtJi+i/3Bzjj5Jo vShdgP01nCEhDI9ZOSQfKNVA6hXE8Mlrz5qXTC+YQS8y+bRuq/MZJ6kWYmGgcDMyB3D7 RdzfoRNUjTy1+O+eOn4ZP2+3cOnGyxxs+olvx6F55AzbfTJVV9q/C5vfgCnV8arom30n P5NZcRgi5C8ryaGeY5iWmAIaM3P9ku6CJ+ENA6M7biTmMJY2tfD37eBiRiU+NBs4sVtt jj/syT91CmqZW1rKZCDiBeIB6tSj1H3C52eKQAMKXjw/L42+xedZUvhqJEwjdJBXoMf7 9iWg== 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=+JVatOz5/Dh/xyAg85UUTlc2Kova9GVo8Ydw6vbee8g=; b=ZsnSQjjZWiMAscTHZt1R8YYiu5KEVzj4+6+38Igozj+Tad0IcYGw+V5+qnBtpaX7wm ukczgtr5rOY1xiAAgFmYvAh6UYWdla1mcNkwDYIKHUOeTnRjKFBR8gJZ0yUuP4wzfwp7 Y7Ft6GOSkqeqILvgkSh5vC5MWSSuTBR2efK9HGDUboH47qX9qE03o8Ny94FaPXxlQ0+E A1Uc1OKamlzN1DORJavOJgqH1zAcy65QLH2uiEHWsJYs/gMvLoeirZU3vjV2qXin0xVF fkrKwJtaBjViS9ebw6CI0TzXLEH7ltionRGQnNs5Rul5IcHpgLfcuaXwlwZ2rT02bSDd +oqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nIyTzeIB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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. [23.128.96.18]) by mx.google.com with ESMTP id g12si2855673edn.403.2020.09.15.01.27.45; Tue, 15 Sep 2020 01:28:07 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=nIyTzeIB; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 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 S1726247AbgIOI0F (ORCPT + 99 others); Tue, 15 Sep 2020 04:26:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60172 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726252AbgIOIKU (ORCPT ); Tue, 15 Sep 2020 04:10:20 -0400 Received: from mail-qk1-x743.google.com (mail-qk1-x743.google.com [IPv6:2607:f8b0:4864:20::743]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AFB07C061788 for ; Tue, 15 Sep 2020 01:10:11 -0700 (PDT) Received: by mail-qk1-x743.google.com with SMTP id t138so3418958qka.0 for ; Tue, 15 Sep 2020 01:10:11 -0700 (PDT) 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=+JVatOz5/Dh/xyAg85UUTlc2Kova9GVo8Ydw6vbee8g=; b=nIyTzeIBrWUervNx+ZYSIQs3H/l6i7vwus2Ha3I8FVsJWME+6Q6zBuLHukcO1Xcij/ j5R4e/ZCmOxtNw9oAWHeZq7ZmEeuOE1wVGnjbF/JEFb/h3Gpyr0zY82TI5IU8HJa3iwt wI+5RRixk+oQKYUF3g9xUmcY8v+Lbh/cTzjxMNENwyG+h/fSBMLQK4/VS47P+Igi7oZ1 9UckvC1TShzWV6/MknJfpHzSm2rh16Zq6E3B4Oi9mvYBkd/oM5Ats+6fyFmiLQab2Du2 7pn/Dd1cLCSugZFKNESH19JPHq/CXBJqNAhX10PcHYs8QaZCnL/QDibmKOhKsKMRnISA U9IA== 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=+JVatOz5/Dh/xyAg85UUTlc2Kova9GVo8Ydw6vbee8g=; b=e5PjZ1NXRLw23e+3ykP0CVi7klVRWwxjXfn2708yq85yGz9pOmsqlYDoBkgLWGYiZS pAmoddPNvTGd0MXuxNZdAchM2v74XYuMG/Fj6bkXn/em4r3aI7jI08Bnxzjou+cSBlTI LX64+XuSySeIft0+tBeAwsv3ILAMMazNlb5rgGQezqw8jl7/y6tsnXQJgUePDR2n4sus 37FoNcLuXGhrgWOK89kj5um+ErxGJIhGJP4m2/oPfqlYiI+qrI3q2jOucyfht7izVm3V hxrWwOU1lpTUJn8snIhDFIoYaPdcOyN7Ee8qntZqLHlsLje2Av3tq92stE4X3dZT1RBB glqQ== X-Gm-Message-State: AOAM532wR11u9e+VlwhHu9JCVVG4jqMqvz+J8q6hDD8wvWbFEt0PYvPU bd/UvTKWpRa682m5/sCEoXqvSQ== X-Received: by 2002:a37:a602:: with SMTP id p2mr16652323qke.254.1600157410569; Tue, 15 Sep 2020 01:10:10 -0700 (PDT) Received: from eggly.attlocal.net (172-10-233-147.lightspeed.sntcca.sbcglobal.net. [172.10.233.147]) by smtp.gmail.com with ESMTPSA id u4sm15673927qkk.68.2020.09.15.01.10.06 (version=TLS1 cipher=ECDHE-ECDSA-AES128-SHA bits=128/128); Tue, 15 Sep 2020 01:10:08 -0700 (PDT) Date: Tue, 15 Sep 2020 01:10:05 -0700 (PDT) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: "Matthew Wilcox (Oracle)" cc: linux-mm@kvack.org, Andrew Morton , Hugh Dickins , William Kucharski , Jani Nikula , Alexey Dobriyan , Johannes Weiner , Chris Wilson , Matthew Auld , Huang Ying , intel-gfx@lists.freedesktop.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH v2 0/8] Return head pages from find_*_entry In-Reply-To: <20200910183318.20139-1-willy@infradead.org> Message-ID: References: <20200910183318.20139-1-willy@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 Thu, 10 Sep 2020, Matthew Wilcox (Oracle) wrote: > This patch series 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 and a new wrapper. > > v2: > - Rework how shmem_getpage_gfp() handles getting a head page back from > find_lock_entry() > - Renamed find_get_swap_page() to find_get_incore_page() > - Make sure find_get_incore_page() doesn't return a head page > - Fix the missing include of linux/shmem_fs.h > - Move find_get_entry and find_lock_entry prototypes to mm/internal.h > - Rename thp_valid_index() to thp_contains() > - Fix thp_contains() for hugetlbfs and swapcache > - Add find_lock_head() wrapper around pagecache_get_page() > > Matthew Wilcox (Oracle) (8): > mm: Factor find_get_incore_page out of mincore_page > mm: Use find_get_incore_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/shmem: Return head page from find_lock_entry > mm: Add find_lock_head > > drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 4 +-- > fs/proc/task_mmu.c | 8 +---- > include/linux/pagemap.h | 43 +++++++++++++++++----- > include/linux/swap.h | 7 ++++ > mm/filemap.c | 44 +++++++++++------------ > mm/internal.h | 3 ++ > mm/madvise.c | 21 ++++++----- > mm/memcontrol.c | 24 ++----------- > mm/mincore.c | 28 ++------------- > mm/shmem.c | 20 +++++------ > mm/swap_state.c | 32 +++++++++++++++++ > 11 files changed, 127 insertions(+), 107 deletions(-) > > -- > 2.28.0 I was testing mmotm today (plus the shmem.c and swap_state.c fixes that you posted, but I did not try the madvise.c one) - my usual tmpfs swapping loads (plus hyperactive khugepaged to maximize the THPs). It behaved well, no problems found. But I probably won't get to try your series of 12 for a few days. Hugh