From patchwork Thu Feb 10 12:30:51 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Muchun Song X-Patchwork-Id: 12741871 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 F41D5C433FE for ; Thu, 10 Feb 2022 12:37:23 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 4B0EB6B0073; Thu, 10 Feb 2022 07:37:23 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 460786B0074; Thu, 10 Feb 2022 07:37:23 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 328BF6B0075; Thu, 10 Feb 2022 07:37:23 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (relay.hostedemail.com [64.99.140.25]) by kanga.kvack.org (Postfix) with ESMTP id 2504C6B0073 for ; Thu, 10 Feb 2022 07:37:23 -0500 (EST) Received: from smtpin02.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay08.hostedemail.com (Postfix) with ESMTP id CD48120CEC for ; Thu, 10 Feb 2022 12:37:22 +0000 (UTC) X-FDA: 79126820724.02.79F32E4 Received: from mail-pj1-f41.google.com (mail-pj1-f41.google.com [209.85.216.41]) by imf28.hostedemail.com (Postfix) with ESMTP id B7282C000B for ; Thu, 10 Feb 2022 12:37:21 +0000 (UTC) Received: by mail-pj1-f41.google.com with SMTP id k60-20020a17090a4cc200b001b932781f3eso1802638pjh.0 for ; Thu, 10 Feb 2022 04:37:21 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bytedance-com.20210112.gappssmtp.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CF7K12UiHyUD8RD1jeYY8SOUVycWdbyPt5EtzOn4lQw=; b=ISYayM7HD4PDDxgAQEj7ZxaBeXkg55hZEZUJ9/011NcLqiLDBvHYG1mZTewaXAZUZv XQc1oHESzLZ4AV83ol2dg4VBY+m9jxtkvSHSB1bsn0ery+gvLJ5v1WEZ9DKzm9uAWmC0 ap6bquUhRVZ15OZ9E9a4Lk1mt2faC5NcVRUHjgZblv5+2wynEIpVdsgpxlt6Ctcs4IZO aZn4J2LIneMvcK1HSfX/YPnefbwrR9NFaHw1/Oob9oTSMu3+YCA32I8tFatuOkDQqtC8 KhgJ+Itxj8o7a0bobjHFDD8tjoM6PUfeoSFJOi0safpm2XJ3qalHl52JE2q4LfhhpQA7 0opg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=CF7K12UiHyUD8RD1jeYY8SOUVycWdbyPt5EtzOn4lQw=; b=DRjaPMQjcHNWhOT97FwvP+rnjYSoql9p+slv/bTI2N6r1j7kGybdcnVKlxT4ofaaO5 gIQ6Q0e95Lf6XrHIDgozlAgJQOugu80NuZ4EWB9ajsRFUTpg+YnDCQ2m+PHBm3271Fto 7EXi4g0dxzjgo4CZktrtHMhhfcRWsyuKi2LQYm0otMlVOQaJBW9vp+G3+bDEgCZwuAZL BHLpRpRirGr2AXBSaBhLZXTMy42boEkWHGP3zUwIGzxEL6+K+ibWLEHXBricYfZo9kn7 CGNFoqK75aysBzEKD9z7JzZEtDod5xADm9174uu/hTIGkTQnC874dmNJx0ASFIkg8wK3 J+ew== X-Gm-Message-State: AOAM533OVtU18PrgfeIGEFMzioXWp3UXiF932Kadpx0kB/dhouO+CepP PYRmd7YMZlEQG3zTuEQMokoEeg== X-Google-Smtp-Source: ABdhPJyG+mucPIqcKKRI/wRmsnd43dnkXL7d4glLC3bKKaAKx8N+wgAmMc8TBF+kr2WM5lKjW9w/8w== X-Received: by 2002:a17:90a:4f04:: with SMTP id p4mr2592587pjh.180.1644496640426; Thu, 10 Feb 2022 04:37:20 -0800 (PST) Received: from FVFYT0MHHV2J.tiktokcdn.com ([139.177.225.237]) by smtp.gmail.com with ESMTPSA id i8sm11767812pgf.94.2022.02.10.04.37.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 10 Feb 2022 04:37:20 -0800 (PST) From: Muchun Song To: akpm@linux-foundation.org, zi.yan@cs.rutgers.edu, kirill.shutemov@linux.intel.com, rientjes@google.com, lars.persson@axis.com, mike.kravetz@oracle.com, ziy@nvidia.com Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, duanxiongchun@bytedance.com, fam.zheng@bytedance.com, Muchun Song Subject: [PATCH v5 0/7] Fix some cache flush bugs Date: Thu, 10 Feb 2022 20:30:51 +0800 Message-Id: <20220210123058.79206-1-songmuchun@bytedance.com> X-Mailer: git-send-email 2.32.0 (Apple Git-132) MIME-Version: 1.0 X-Stat-Signature: pstzbg615zy47rqw3yu3azmhmed54q3e X-Rspam-User: Authentication-Results: imf28.hostedemail.com; dkim=pass header.d=bytedance-com.20210112.gappssmtp.com header.s=20210112 header.b=ISYayM7H; dmarc=pass (policy=none) header.from=bytedance.com; spf=pass (imf28.hostedemail.com: domain of songmuchun@bytedance.com designates 209.85.216.41 as permitted sender) smtp.mailfrom=songmuchun@bytedance.com X-Rspamd-Server: rspam08 X-Rspamd-Queue-Id: B7282C000B X-HE-Tag: 1644496641-260177 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: This series focus on fixing cache maintenance. v5: - Collect Reviewed-by from Mike. - Fix mcopy_atomic_pte() and __mcopy_atomic() (Mike). - Fix shmem_mfill_atomic_pte(). v4: - Replace folio_copy() with copy_user_huge_page(). - Update commit message for patch 2. v3: - Collect Reviewed-by tag from Zi Yan. - Fix hugetlb cache maintenance. v2: - Collect Reviewed-by tag from Zi Yan. - Using a for loop instead of the folio variant for backportability. Muchun Song (7): mm: thp: fix wrong cache flush in remove_migration_pmd() mm: fix missing cache flush for all tail pages of compound page mm: hugetlb: fix missing cache flush in copy_huge_page_from_user() mm: hugetlb: fix missing cache flush in hugetlb_mcopy_atomic_pte() mm: shmem: fix missing cache flush in shmem_mfill_atomic_pte() mm: userfaultfd: fix missing cache flush in mcopy_atomic_pte() and __mcopy_atomic() mm: replace multiple dcache flush with flush_dcache_folio() mm/huge_memory.c | 3 ++- mm/hugetlb.c | 3 ++- mm/memory.c | 2 ++ mm/migrate.c | 3 +-- mm/shmem.c | 4 +++- mm/userfaultfd.c | 3 +++ 6 files changed, 13 insertions(+), 5 deletions(-)