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=-11.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham 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 1CF3DC433E0 for ; Thu, 11 Feb 2021 05:35:59 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id A57EB64E26 for ; Thu, 11 Feb 2021 05:35:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A57EB64E26 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 146FF6B006C; Thu, 11 Feb 2021 00:35:58 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 0F7456B006E; Thu, 11 Feb 2021 00:35:58 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 00C616B0070; Thu, 11 Feb 2021 00:35:57 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0190.hostedemail.com [216.40.44.190]) by kanga.kvack.org (Postfix) with ESMTP id DFE796B006C for ; Thu, 11 Feb 2021 00:35:57 -0500 (EST) Received: from smtpin10.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 9FDAB8249980 for ; Thu, 11 Feb 2021 05:35:57 +0000 (UTC) X-FDA: 77804875554.10.quilt45_16014b127616 Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin10.hostedemail.com (Postfix) with ESMTP id 773D516A0C3 for ; Thu, 11 Feb 2021 05:35:57 +0000 (UTC) X-HE-Tag: quilt45_16014b127616 X-Filterd-Recvd-Size: 4272 Received: from so15.mailgun.net (so15.mailgun.net [198.61.254.15]) by imf36.hostedemail.com (Postfix) with ESMTP for ; Thu, 11 Feb 2021 05:35:56 +0000 (UTC) DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1613021757; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=zBgnLWzyaqyNaAbtH+PNF19ZuNN+iKocqvFQdPi0B/M=; b=s7Kd+mCIe2iizeYvfAduVNnurCiAUBpc+G5zXmxuSeFvt4ctON6dXIVyedkUkRdeFGtAjqA9 xLb9NcPxQ8iTpVjlIDwaDfqJSTS/+0MVCR1f1D1QjWBRK4bBXgK6G3TFa/S8KZUUKLmNQ7nj 5DKO3U1vBN67f6d43RjkCxVIFhc= X-Mailgun-Sending-Ip: 198.61.254.15 X-Mailgun-Sid: WyIwY2Q3OCIsICJsaW51eC1tbUBrdmFjay5vcmciLCAiYmU5ZTRhIl0= Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n06.prod.us-east-1.postgun.com with SMTP id 6024c239e3df861f4ba9bdcb (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Thu, 11 Feb 2021 05:35:53 GMT Received: by smtp.codeaurora.org (Postfix, from userid 1001) id C209AC43465; Thu, 11 Feb 2021 05:35:52 +0000 (UTC) Received: from cgoldswo-linux.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-SHA256 (128/128 bits)) (No client certificate requested) (Authenticated sender: cgoldswo) by smtp.codeaurora.org (Postfix) with ESMTPSA id 3CDA3C433CA; Thu, 11 Feb 2021 05:35:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 3CDA3C433CA Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: aws-us-west-2-caf-mail-1.web.codeaurora.org; spf=fail smtp.mailfrom=cgoldswo@codeaurora.org From: Chris Goldsworthy To: Andrew Morton , Alexander Viro Cc: linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Minchan Kim , Matthew Wilcox , Chris Goldsworthy Subject: [PATCH v2] [RFC] Invalidate BH LRU during page migration Date: Wed, 10 Feb 2021 21:35:39 -0800 Message-Id: X-Mailer: git-send-email 2.7.4 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: A page containing buffer_heads can be pinned if any of its constituent buffer_heads belongs to the BH LRU cache [1], which can prevent that page from being migrated. After going through several iterations of a patch that attempts to solve this by removing BH entries inside of the drop_buffers() function, which in the worst-case could be called for each migrated page, Minchan Kim suggested that we invalidate the entire BH LRU once, just before we start migrating pages. Additionally, Matthew Wilcox suggested that we invalidate the BH LRU inside of lru_add_drain_all(), so as to benefit functions like other functions that would be impacted by pinned pages [2]. V2: Respond to feedback provided by Andrew, Minchan and Matthew in [3]. As suggested by Minchan, we're now doing the invalidate of the LRUs in a fashion similar to how the pagevecs are drained in lru_add_drain_all() [1] https://elixir.bootlin.com/linux/latest/source/fs/buffer.c#L1238 [2] https://lore.kernel.org/linux-fsdevel/cover.1611642038.git.cgoldswo@codeaurora.org/ [3] https://lkml.org/lkml/2021/2/2/68 Chris Goldsworthy (1): [RFC] mm: fs: Invalidate BH LRU during page migration fs/buffer.c | 54 +++++++++++++++++++++++++++++++++++++++++++-- include/linux/buffer_head.h | 8 +++++++ include/linux/migrate.h | 2 ++ mm/migrate.c | 19 ++++++++++++++++ mm/page_alloc.c | 3 +++ mm/swap.c | 7 +++++- 6 files changed, 90 insertions(+), 3 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project