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 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8E086C433F5 for ; Mon, 4 Oct 2021 20:26:42 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 297656124C for ; Mon, 4 Oct 2021 20:26:42 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 297656124C Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 5A62194006F; Mon, 4 Oct 2021 16:26:41 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 5566594000B; Mon, 4 Oct 2021 16:26:41 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 4446A94006F; Mon, 4 Oct 2021 16:26:41 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0184.hostedemail.com [216.40.44.184]) by kanga.kvack.org (Postfix) with ESMTP id 3550694000B for ; Mon, 4 Oct 2021 16:26:41 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id EB29A28DCE for ; Mon, 4 Oct 2021 20:26:40 +0000 (UTC) X-FDA: 78659888160.19.B310851 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf09.hostedemail.com (Postfix) with ESMTP id 90D133002E78 for ; Mon, 4 Oct 2021 20:26:40 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id AC61A61425 for ; Mon, 4 Oct 2021 20:26:39 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1633379199; bh=+j6iW1HJ6VNM1YovE/pabuUcnQL+weiXJ3J12Bf98GM=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=AJcsjhVdLRB4SVDPJhhG+zDZBQz92Z3XXDlMGnR5BkEitF1ffSPJj9sReHbAdcxbh C5CARdKNsuMKfwPSViirE9uxpZfVHoI7xAp/NlQdZvdKaTkwzzGIXkoMTYR4Uyxq0z 6fr8PUMnbDeUvXpVySxFdz4f8ijXZrStfxxyw9T8b7SAYCmfMYWvlDv4GpsdG5XaJl RL5H7K3/zpPbuYqsqCgyD2xb4JLz44NQd1BNl21ZZ4gkZXiG6nkqt3V83vemmEterX 2igeUpdOzBCREK4Sb4l7H9BpWGA66QkXGZMg+P5KVhfYNGGPlk9XqksFYTZHe7oZku pi1oG1NEjgf3g== Received: by mail-lf1-f43.google.com with SMTP id m3so75823582lfu.2 for ; Mon, 04 Oct 2021 13:26:39 -0700 (PDT) X-Gm-Message-State: AOAM532q1dvvhnKVSPw/SsJP7HUyolc8/Iu8tceOgyQ4zq/CZUdPabw0 VVjENINnFSY3DPuqg3+tyBWKslhufI79f5mb1Fo= X-Google-Smtp-Source: ABdhPJwNYjngyoyIQvFka4I+W59Xe0gV4hu9BjHZ8BwMzckuI+GmD7/CAgeUK6oarsdN14IcqWiO+5bCXk+2hmmVngE= X-Received: by 2002:a05:6512:39c4:: with SMTP id k4mr16294730lfu.14.1633379197973; Mon, 04 Oct 2021 13:26:37 -0700 (PDT) MIME-Version: 1.0 References: <20210923194343.ca0f29e1c4d361170343a6f2@linux-foundation.org> <9e41661d-9919-d556-8c49-610dae157553@linux.alibaba.com> <68737431-01d2-e6e3-5131-7d7c731e49ae@linux.alibaba.com> <8d8fb192-bd8d-8a08-498d-ca7204d4a716@linux.alibaba.com> In-Reply-To: <8d8fb192-bd8d-8a08-498d-ca7204d4a716@linux.alibaba.com> From: Song Liu Date: Mon, 4 Oct 2021 13:26:26 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 1/2] mm, thp: check page mapping when truncating page cache To: Rongwei Wang Cc: Matthew Wilcox , Hugh Dickins , Andrew Morton , Linux MM , Linux Kernel Mailing List , William Kucharski Content-Type: text/plain; charset="UTF-8" X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 90D133002E78 X-Stat-Signature: eewjwuwrguc3nfhhuuxe13yog8k5jawp Authentication-Results: imf09.hostedemail.com; dkim=pass header.d=kernel.org header.s=k20201202 header.b=AJcsjhVd; dmarc=pass (policy=none) header.from=kernel.org; spf=pass (imf09.hostedemail.com: domain of song@kernel.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=song@kernel.org X-HE-Tag: 1633379200-866287 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: On Mon, Oct 4, 2021 at 10:26 AM Rongwei Wang wrote: > > Hi, > I have run our cases these two days to stress test new Patch #1. The new > Patch #1 mainly add filemap_invalidate_{un}lock before and after > truncate_pagecache(), basing on original Patch #1. And the crash has not > happened. > > Now, I keep the original Patch #1, then adding the code below which > suggested by liu song (I'm not sure which one I should add in the next > version, Suggested-by or Signed-off-by? If you know, please remind me). > > - if (filemap_nr_thps(inode->i_mapping)) > + if (filemap_nr_thps(inode->i_mapping)) { > + filemap_invalidate_lock(inode->i_mapping); > truncate_pagecache(inode, 0); > + filemap_invalidate_unlock(inode->i_mapping); > + } It is mostly suggested by Matthew. If the patch goes that way, you can add Tested-by: Song Liu