Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp1425522pxu; Mon, 23 Nov 2020 22:57:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJxT0Y6c/utTPXEBjlYButRyAZM37OSuVyHUcngd0PXzHsRmIK9wGJAbGhUiBXpAzi4vDGq9 X-Received: by 2002:a17:906:fcc4:: with SMTP id qx4mr2902573ejb.5.1606201029621; Mon, 23 Nov 2020 22:57:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606201029; cv=none; d=google.com; s=arc-20160816; b=fliW6QI+l27JWpopFoN+6c3hj24PJGRCMQrr21zPxNkxPzo0rC5Yci+Neram+OeNmo zSGlGJ6voOLJOh8uk5f6WiZrkTsb2zNOdoMjK7y9mzYZ6Xr+sCA0AZDfi9T1g6cvKDvC dAT6uElvpDzaMEwlXRy5X2nYDmq7xNQTn2KyuJNRZASF1NYE8xnldTrsK7Gcp45VB3KQ h7zDHATLArvTAEP7VeldrGL1pq/+EjpPQ0XcH5teMDyRMmstl0Id1XgFk3xiWasEvsv/ oYp3gXt7oenrwZ1iTsWeqVKLnOc+ET+9QH+N31DMKpRk/1lG6mGYpCKsP9JiuQvhEGIN MG9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from:dmarc-filter :sender:dkim-signature; bh=pb2Z7JiP3zLsmtF+Oew5q4mjjn1yGyxWfKE6Z9aHwJo=; b=K1Nm+H4C5gRse2C/3i9PR96St5NXgzFcn6LRUf21K89rBqazPivGleEEAbKlj2ql6C vBvf2dHQtr7HHFnpJHWAXu1Zr6t06RPvd6r2/6o1+hUedfGshic3WMkvfMH1Jp9sf6tA QvrBHW7zylnur1a1TcY7eDyEuJUWj5gXX6sPdtKhoGFwInBL8rn6AVccwVfciRIoTRnT fPzaGiqJJiY3vxJCzxvsCHMuSkRvqt/o0RMiydZz+AdtAUpnwORiWLGw9ujMjcNAH9Cy 9fS5HZHMCbJIt9mC2u8An777nal/5unmfB/sgX2edl2Zb1cKkze8IPf6pVkO7jmxEhRF Gspg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@mg.codeaurora.org header.s=smtp header.b=R+okDV6K; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id me21si8065724ejb.454.2020.11.23.22.56.46; Mon, 23 Nov 2020 22:57:09 -0800 (PST) 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=@mg.codeaurora.org header.s=smtp header.b=R+okDV6K; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729850AbgKXGuK (ORCPT + 99 others); Tue, 24 Nov 2020 01:50:10 -0500 Received: from m42-4.mailgun.net ([69.72.42.4]:45374 "EHLO m42-4.mailgun.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729479AbgKXGuK (ORCPT ); Tue, 24 Nov 2020 01:50:10 -0500 DKIM-Signature: a=rsa-sha256; v=1; c=relaxed/relaxed; d=mg.codeaurora.org; q=dns/txt; s=smtp; t=1606200609; h=Message-Id: Date: Subject: Cc: To: From: Sender; bh=pb2Z7JiP3zLsmtF+Oew5q4mjjn1yGyxWfKE6Z9aHwJo=; b=R+okDV6KiK0xQPmok9TZMxh5uqepvixZoSFt2v0CMafCLwiqYTvNPHCfk4+b83D9SlI0RYXZ s213dVjqb0XTtGt4K0I3J1LcLelYWvf7ffz25T91KZSKXFgZxXwYsU9y54FOcQ2xHjdD1mTV zF9q2leqtwFl20RC0uHENH/xQoo= X-Mailgun-Sending-Ip: 69.72.42.4 X-Mailgun-Sid: WyI0MWYwYSIsICJsaW51eC1rZXJuZWxAdmdlci5rZXJuZWwub3JnIiwgImJlOWU0YSJd Received: from smtp.codeaurora.org (ec2-35-166-182-171.us-west-2.compute.amazonaws.com [35.166.182.171]) by smtp-out-n04.prod.us-east-1.postgun.com with SMTP id 5fbcad0ab9b39088ed020643 (version=TLS1.2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256); Tue, 24 Nov 2020 06:49:46 GMT Sender: cgoldswo=codeaurora.org@mg.codeaurora.org Received: by smtp.codeaurora.org (Postfix, from userid 1001) id 13FE1C43460; Tue, 24 Nov 2020 06:49:46 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-caf-mail-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=ALL_TRUSTED,BAYES_00,SPF_FAIL autolearn=no autolearn_force=no version=3.4.0 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 2AC37C43460; Tue, 24 Nov 2020 06:49:45 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 2AC37C43460 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: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, david@redhat.com, Chris Goldsworthy Subject: [PATCH] Resolve LRU page-pinning issue for file-backed pages Date: Mon, 23 Nov 2020 22:49:37 -0800 Message-Id: X-Mailer: git-send-email 2.7.4 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org It is possible for file-backed pages to end up in a contiguous memory area (CMA), such that the relevant page must be migrated using the .migratepage() callback when its backing physical memory is selected for use in an CMA allocation (through cma_alloc()). However, if a set of address space operations (AOPs) for a file-backed page lacks a migratepage() page call-back, fallback_migrate_page() will be used instead, which through try_to_release_page() calls try_to_free_buffers() (which is called directly or through a try_to_free_buffers() callback. try_to_free_buffers() in turn calls drop_buffers(). drop_buffers() itself can fail due to the buffer_head associated with a page being busy. However, it is possible that the buffer_head is on an LRU list for a CPU, such that we can try removing the buffer_head from that list, in order to successfully release the page. Do this. For reference ext4_journalled_aops is a set of AOPs that lacks the migratepage() callback. Laura Abbott (1): fs/buffer.c: Revoke LRU when trying to drop buffers fs/buffer.c | 47 +++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 45 insertions(+), 2 deletions(-) -- The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum, a Linux Foundation Collaborative Project