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 X-Spam-Level: X-Spam-Status: No, score=-5.1 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 50F2FC433E4 for ; Wed, 19 Aug 2020 20:05:10 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 131782086A for ; Wed, 19 Aug 2020 20:05:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=kernel.org header.i=@kernel.org header.b="Jl7umYqy" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 131782086A Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 8DF276B00BB; Wed, 19 Aug 2020 16:05:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 890DF6B00BC; Wed, 19 Aug 2020 16:05:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 7A8296B00BD; Wed, 19 Aug 2020 16:05:09 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0093.hostedemail.com [216.40.44.93]) by kanga.kvack.org (Postfix) with ESMTP id 601136B00BB for ; Wed, 19 Aug 2020 16:05:09 -0400 (EDT) Received: from smtpin04.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay02.hostedemail.com (Postfix) with ESMTP id 175E2362A for ; Wed, 19 Aug 2020 20:05:09 +0000 (UTC) X-FDA: 77168397138.04.crowd90_061628e2702a Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin04.hostedemail.com (Postfix) with ESMTP id E0FBE8002944 for ; Wed, 19 Aug 2020 20:05:08 +0000 (UTC) X-HE-Tag: crowd90_061628e2702a X-Filterd-Recvd-Size: 2487 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf11.hostedemail.com (Postfix) with ESMTP for ; Wed, 19 Aug 2020 20:05:08 +0000 (UTC) Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 5C8ED2078D; Wed, 19 Aug 2020 20:05:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1597867507; bh=nHvO1R7E8eeOWRO2eO6KSxIkz2fBZXkK0YHHMyZRSqg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=Jl7umYqyumTDMpKdpoG92h4Mf6HK5k7wSr58hk2CAQAkROWv674x3zbTl44cuiiU2 kiuo+rWzm3cSdrH4mF5JCzQu5aOtfNX38MJUSEaKszfk7OTdVdZAY2vEbq9hFLJghq e0Yvii9cPFQyhO+kGRr2qsnps2HDIjJsg+kUlAHQ= Date: Wed, 19 Aug 2020 13:05:06 -0700 From: Andrew Morton To: Gao Xiang Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Rafael Aquini , Carlos Maiolino , Eric Sandeen , "Huang, Ying" , stable Subject: Re: [PATCH] mm, THP, swap: fix allocating cluster for swapfile by mistake Message-Id: <20200819130506.eea076dd618644cd7ff875b6@linux-foundation.org> In-Reply-To: <20200819195613.24269-1-hsiangkao@redhat.com> References: <20200819195613.24269-1-hsiangkao@redhat.com> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Rspamd-Queue-Id: E0FBE8002944 X-Spamd-Result: default: False [0.00 / 100.00] X-Rspamd-Server: rspam03 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 Thu, 20 Aug 2020 03:56:13 +0800 Gao Xiang wrote: > SWP_FS doesn't mean the device is file-backed swap device, > which just means each writeback request should go through fs > by DIO. Or it'll just use extents added by .swap_activate(), > but it also works as file-backed swap device. This is very hard to understand :( > So in order to achieve the goal of the original patch, > SWP_BLKDEV should be used instead. > > FS corruption can be observed with SSD device + XFS + > fragmented swapfile due to CONFIG_THP_SWAP=y. > > Fixes: f0eea189e8e9 ("mm, THP, swap: Don't allocate huge cluster for file backed swap device") > Fixes: 38d8b4e6bdc8 ("mm, THP, swap: delay splitting THP during swap out") Why do you think it has taken three years to discover this?