From patchwork Tue Nov 1 17:53:21 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Vishal Moola X-Patchwork-Id: 13027297 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id E5AECC4332F for ; Tue, 1 Nov 2022 17:53:54 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 646C66B0071; Tue, 1 Nov 2022 13:53:54 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5F6426B0073; Tue, 1 Nov 2022 13:53:54 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4E5276B0074; Tue, 1 Nov 2022 13:53:54 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0013.hostedemail.com [216.40.44.13]) by kanga.kvack.org (Postfix) with ESMTP id 3B23F6B0071 for ; Tue, 1 Nov 2022 13:53:54 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id 0C81B14090A for ; Tue, 1 Nov 2022 17:53:54 +0000 (UTC) X-FDA: 80085621588.14.CC80340 Received: from mail-pj1-f45.google.com (mail-pj1-f45.google.com [209.85.216.45]) by imf23.hostedemail.com (Postfix) with ESMTP id A457214000E for ; Tue, 1 Nov 2022 17:53:53 +0000 (UTC) Received: by mail-pj1-f45.google.com with SMTP id o7so10729281pjj.1 for ; Tue, 01 Nov 2022 10:53:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=T616rnlmF8gGpKRw2WeKaNrtP39/7G6HvF59mTmvBVA=; b=bnPVjS1B/4HTUkdEBkWa3ra8fQa70pnyxpgCSzvdkJWi36b6XnC9by2aLIVrilNPVn cvoX3p9xLVrKUGdJUXhp7rcYN4dwf8F7bGWleayA2dWJ3u1P5v2q+fsJDtnXhSaOqLqi 0cRjFkarEzgAJKJCX0dFtVauHeWnB9kHE0UVFwzvQbhtOR1a9dYYSLNuVDC7SiZS2u22 aTJMhodgdJ6pZ3yhqr4biboWA5O06Q/wh3YBDCfWA/HlwFkTGXHiNZf+ZErE1mvfBw47 0pwRQE5oXG5rucB23PyXBv6lTkb65BCi+kL8u9p6i0+vu7lo1ca/fwW0g9RH4dP18Tfv doTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=T616rnlmF8gGpKRw2WeKaNrtP39/7G6HvF59mTmvBVA=; b=JBwKrgkEsINwM5Jt5uFBLxRShiV3KrYb6fAVy6anKqPjO5ZxydIHWTdvRCJ3wcssxh ALAdw2JpvlXM0qTTTznb21G3QSQREp7bqAGfbcFNQoRTv8jTJFMyUbiYWcZJAMYbh4Ka 35VVT9+zSLs2zTExJo0Qqz0xZPTdXqg6JqKaYW/lcezoKQ22/zl4JkoTsh+YdFUO7KtE EW221R+WEOh1zq8axOYU67cc+2RRQWL5/nkgC7yZX0WwHag0zp1C5KBGBEPA2VCECXhg S4xYIA+OO5RLazlJvJKoxw4XvrYPqadtJIfG2WEdzIHzEqqI4cKzSjm2HnQ4rPp9HPFY XM0A== X-Gm-Message-State: ACrzQf21NZY7ywrwpkTJv4kpvHPripnkYk3V5fbEjB4l4RbDUyUNPosC 5FhP2bBo9ZEM+noRlOeLfSQeWedLLNrSiw== X-Google-Smtp-Source: AMsMyM5pRis2psFXZCe/ULdaya3CpiLSHEOZX7IOaQRnUoJQ004k/RC0rCEx/hilvIg1AJhCi23mjA== X-Received: by 2002:a17:903:247:b0:179:b5e1:54b7 with SMTP id j7-20020a170903024700b00179b5e154b7mr20496732plh.84.1667325232412; Tue, 01 Nov 2022 10:53:52 -0700 (PDT) Received: from fedora.hsd1.ca.comcast.net ([2601:644:8002:1c20::8080]) by smtp.googlemail.com with ESMTPSA id e26-20020a056a0000da00b0056b9124d441sm6797987pfj.218.2022.11.01.10.53.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Nov 2022 10:53:51 -0700 (PDT) From: "Vishal Moola (Oracle)" To: linux-mm@kvack.org Cc: linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, akpm@linux-foundation.org, willy@infradead.org, miklos@szeredi.hu, "Vishal Moola (Oracle)" Subject: [PATCH 0/5] Removing the lru_cache_add() wrapper Date: Tue, 1 Nov 2022 10:53:21 -0700 Message-Id: <20221101175326.13265-1-vishal.moola@gmail.com> X-Mailer: git-send-email 2.38.1 MIME-Version: 1.0 ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=bnPVjS1B; spf=pass (imf23.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667325233; a=rsa-sha256; cv=none; b=l6aR6j0m9dEdhRwCCNTDMwm1EhNn99ckE1WfZmBNhaTNBZDRzd97ciE7XQf5m3qa7BlRDa 8Uv+bSdNGuDzTMMzg1Ls7THXYGyDl/NOjrwcS9eAJepMrF5kBCiBdQGrIZk10mg3udVoCo WbjGhATpexckOsab90pS5rsgWfeZMuQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667325233; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-transfer-encoding:content-transfer-encoding: in-reply-to:references:dkim-signature; bh=T616rnlmF8gGpKRw2WeKaNrtP39/7G6HvF59mTmvBVA=; b=TVp8LzImW8KCIQGRW6Sgw1tXnFJxxQqFzSQ0tmfdKryrv8lFJT/zPiZFNUz8ND30ULkjm/ 8Jp0AtamPT1GWqz/crXeXyRrkk0ynjGmToFaQPJ9Ad2f6KpcCPOkOLO3YNl/xG2RdqJVpj ani8oaWQQvLlznk7j82yLN8pTV2iHx4= X-Stat-Signature: m61t1kyphik5r4zx5gdcc9xd1ea7didh X-Rspamd-Queue-Id: A457214000E Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=bnPVjS1B; spf=pass (imf23.hostedemail.com: domain of vishal.moola@gmail.com designates 209.85.216.45 as permitted sender) smtp.mailfrom=vishal.moola@gmail.com; dmarc=pass (policy=none) header.from=gmail.com X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1667325233-221957 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000019, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: This patchset replaces all calls of lru_cache_add() with the folio equivalent: folio_add_lru(). This is allows us to get rid of the wrapper The series passes xfstests and the userfaultfd selftests. I haven't been able to hit the fuse_try_move_page() function, so I haven't been able to test those changes. Since replace_page_cache_page() is only called by fuse_try_move_page() I haven't been able to test that as well. Testing and review of both would be beneficial. Vishal Moola (Oracle) (5): filemap: Convert replace_page_cache_page() to replace_page_cache_folio() fuse: Convert fuse_try_move_page() to use folios userfualtfd: Replace lru_cache functions with folio_add functions khugepage: Replace lru_cache_add() with folio_add_lru() folio-compat: Remove lru_cache_add() fs/fuse/dev.c | 55 +++++++++++++++++++++-------------------- include/linux/pagemap.h | 2 +- include/linux/swap.h | 1 - mm/filemap.c | 52 +++++++++++++++++++------------------- mm/folio-compat.c | 6 ----- mm/khugepaged.c | 11 ++++++--- mm/truncate.c | 2 +- mm/userfaultfd.c | 6 +++-- mm/workingset.c | 2 +- 9 files changed, 67 insertions(+), 70 deletions(-)