From patchwork Thu Feb 16 16:05:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yin Fengwei X-Patchwork-Id: 13143461 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 1BFBFC636CC for ; Thu, 16 Feb 2023 16:24:02 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 7DBB86B0073; Thu, 16 Feb 2023 11:24:02 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 78B556B0074; Thu, 16 Feb 2023 11:24:02 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 652DD6B0075; Thu, 16 Feb 2023 11:24:02 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0014.hostedemail.com [216.40.44.14]) by kanga.kvack.org (Postfix) with ESMTP id 517A76B0073 for ; Thu, 16 Feb 2023 11:24:02 -0500 (EST) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay05.hostedemail.com (Postfix) with ESMTP id CD00840711 for ; Thu, 16 Feb 2023 16:24:01 +0000 (UTC) X-FDA: 80473676682.14.19719D9 Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by imf23.hostedemail.com (Postfix) with ESMTP id 68A99140022 for ; Thu, 16 Feb 2023 16:23:58 +0000 (UTC) Authentication-Results: imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=iDGa4NrL; spf=pass (imf23.hostedemail.com: domain of fengwei.yin@intel.com designates 134.134.136.20 as permitted sender) smtp.mailfrom=fengwei.yin@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1676564639; a=rsa-sha256; cv=none; b=vnUIgiX8r6BNJ6vOlGvyJPEk5BqmXpOuvm8K0paDBVw8IeVVDrrZ5SurCevJ5NOn5GgSI8 /RNZ2C6j7uBaM5Q6HUGYOcB5+ZFkdEtQq1AH7tNusiKIZqduB+DSV1s9iHPUrb93Cvexqr nnT1sWNX3OdEOOXoB5fb6L3hA7lN/HI= ARC-Authentication-Results: i=1; imf23.hostedemail.com; dkim=pass header.d=intel.com header.s=Intel header.b=iDGa4NrL; spf=pass (imf23.hostedemail.com: domain of fengwei.yin@intel.com designates 134.134.136.20 as permitted sender) smtp.mailfrom=fengwei.yin@intel.com; dmarc=pass (policy=none) header.from=intel.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1676564639; 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=AVb1iFaZu7Xzx3+22qnNpaobnuZ2q/LwY7G/rbDFBmI=; b=gObHA4nxjPZocqJ403uzHKGx4Ybgjy7oieSpD66JHkvIIpGqwLQgjDIz4iibqs5GxVRQIn /ypfR/uoiI+YJF2oHfP6GNFHiU36sIGCKPUs9cMAjw6KdRp5xzNKngQZhRBo9BppEV9Xl/ lt2p8DKEk779qmsVXbV4wyiPCb7eT8Y= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1676564638; x=1708100638; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=4T2csO59wziLzFJYOhgWjblggN1UGu3XCtPs1jSYOx4=; b=iDGa4NrLP8zgRwNd4NgO4WJxERaOKku0hrjb5/e1RhywRKUflMMhM9gI 3zBNFUjHxEXKUlhARh2s9ki3l+yU2A/dS1UWI85b0jMMatakSWoKw3f9z MQEhbMEkbe/cMhRvs7ptjmMAfXoIDlE2ObpQzQgQhdtxUWm0WqlXqnU7Q +kG6sJ7/g4u+jrpvTuJmHXv59ORkkfwkVS8vjwtoE+d0WfFXUQjeC6+Sj j/07fx4kjnzT6so2U/sVfUTX38uM7Uq9n7CXuAMJU1FiJVTsy4nP+QhOn rge0S/wg9yKf8937+tuhzNUIksLo/ZGHnRyGpULvTmTqf/RMT3nlyohkf A==; X-IronPort-AV: E=McAfee;i="6500,9779,10623"; a="319841094" X-IronPort-AV: E=Sophos;i="5.97,302,1669104000"; d="scan'208";a="319841094" Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Feb 2023 08:04:00 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10623"; a="794069848" X-IronPort-AV: E=Sophos;i="5.97,302,1669104000"; d="scan'208";a="794069848" Received: from fyin-dev.sh.intel.com ([10.239.159.32]) by orsmga004.jf.intel.com with ESMTP; 16 Feb 2023 08:03:59 -0800 From: Yin Fengwei To: willy@infradead.org, linux-mm@kvack.org Cc: fengwei.yin@intel.com Subject: [RFC PATCH 0/2] minor cleanup of usage of flush_dcache_folio() Date: Fri, 17 Feb 2023 00:05:26 +0800 Message-Id: <20230216160528.2146188-1-fengwei.yin@intel.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Rspam-User: X-Rspamd-Queue-Id: 68A99140022 X-Rspamd-Server: rspam01 X-Stat-Signature: w5bhe31smygpf1cb78y9ntc7whk9qza8 X-HE-Tag: 1676564638-360042 X-HE-Meta: U2FsdGVkX186pGB11IQ7kPChBGFFhK2wY0T+F1+TToRHdaIIJdQJBy4wqJj6ikkf8G5G8FHw0ikvaxlLr6K/WfBHZaOU+CBEFB5k4TXbMNfd7eL0CmV7bj8Zu/hMVddqB5ilPizVkuKFjKfLB2jtLimJ+RFuPQVvnwfqq5t+s3AfWxlGtRvTIkRVpONop3mZwjuJ9pqTkzET70hMpvd7sGST7KBU10DO35t8kZ3pB3/lTOtKHm8Xz9mp6HuqN9dOT6QtoQgOA2PdK8PFHjiJ9GYoVqBhJJ89sehwxe5S/Bx1zavUx8/DpBIiPF2Ms1qsh6YkGOKE2g/hpCztBLx3E6H3hJDzr1cz9tINvP7b0HlneMccg/cO/cxY7AdF1GqZ4jmY0br49fm2pGt0VEE9UxhB6rfPBZNXYZvt0vT8F9i8g9opkN4RnsuMobAPNv0tgNMJ1kKPLUCl09bBETcmELXDOqEv1aQfsuM4ChGACJw/kmNhFKU37Xq1GD0XrSTKnNT6U1hicJtTGBTSIsz2/tGriLNHGlrPZjD0sLKbYX/s+XR1e1/7m8rb1s18H6qy3x6RfXLhRccQQJtrrXfxBcfIIOqlxLf5ueOx3jGebgKJQil+SvaCpTJiKwPt92YHnONsB1Y7l5+m3YZtZvKWYxi/abU3wE4Ycb4SJrJY+EcJMy2ginB0YO92kQRUNEopjH+t4dVassvezURXbWaKmPT8HMnrxzNIvI6jfJzRzpDJCggDO1fpPvQwn/JdjPY0QAkwf6TJPirHN9yhx/Wfy1E0tygy+ArJ9+7s7+j11FaSGe1IOoPqOFmd5NoLmlNwWZo7/Kw3Re2lcq+6EvdWJJswAU43F9yIefJb2Crj0R/sqpf4BjPmdEAp/jHa/fcGMH/QxE0WLTAcLY+HsR2ZJbGas6w2fV+w+RAEsgv+xY4FhbwXUNTJ2WXlOwbd5IWSFCs0Vvsw6vgtU6JQUB5 v2O5cXn7 RC4XaY9P+19UmJeI86bf0aJtYJo+wlAdNI504c+JmrKWWsWZMmbAdm/9dinujWpVSvTvGl1gKAPGco/BKTNB6aTojqiE0fPz3n2I5gO+2DJt8m1krX9X2J+ifuXCZAdKBDZcDIy0PXgiSWAkbfpUfPA3jWnM6awQrcRhD70hhBl26W4Uyo/dtcrRHpNytnL4Hv3AK 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: When tried to review the usage of flush_dcache_folio(), noticed several unnecessary call to flush_dcache_folio(). Patch1 removes them. Patch2 adds zero_user_folio_segment() which has same function as zero_user_segment() but with folio as parameter. And use flush_dcache_folio() to flush cache instead of loop call flush_dcache_page(). Test: Boot and run firefox/email/editor with Qemu x86_64 system. The base is next-20230214. Yin Fengwei (2): mm: remove duplicated flush_dcache_folio() mm: add zero_user_folio_segments() fs/libfs.c | 1 - include/linux/highmem.h | 26 +++++++++++++++++--- mm/highmem.c | 53 +++++++++++++++++++++++++++++++++++++++++ mm/shmem.c | 7 +----- 4 files changed, 77 insertions(+), 10 deletions(-)