Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp724901pxa; Wed, 19 Aug 2020 13:06:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwyIAa1ISX/3lWuPiyphDdCQJfaRSEu1cmD1rjOg7xlXdX4NUbo/ThW4vWXJwdaWckj4ACe X-Received: by 2002:a05:6402:33a:: with SMTP id q26mr27795793edw.8.1597867599399; Wed, 19 Aug 2020 13:06:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597867599; cv=none; d=google.com; s=arc-20160816; b=ZOSYov/m1cOsBqZmGFm8pCUwlsMFY0yDbQQ3H89G8WwVj8IgL/j3gyweE8/vAk76if FeYUhwhFY+ZqssL1deiXDT6SgR1n8FcB+aHj0eJ65NF2AQXzJEUJGx/03T3uhm1YyHpY zMvei7P/4pYeHW+YENnuAmiFTLzmqHkDyQeFc42tdYDCVmMB47HxJAQYyGkS2OuGCzSq CF9GHBwzxqV61bezLOP9tvueI6fls2Qn/auD1iArHd6dMwGiuZNjTGVPYXlOguyGPUa5 fbIBaz5l+8Gfx7VddZKlSBdgHagZi4i8mJzTDBxrhsuUgkZyUxZt0nioPlteXowgo0io cUwg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=Cdpirr9lxX1cW2wP5te3P9wIcKJmaaXGLyK4sEx1sqw=; b=UnfeOH0IBsGimbJ31Oyy/jlsv8IvJKIRk7RQ7dIemhB1xXzS8Z5oRxNuBcs2QFzybd CcbCqNJHsWgfd6rIt7TMCjAPmKd14AGDe37IC5fTiLY3FaLAZX52+3ijyrzZCWkpmtj/ 1T5SXD9QlEioqAkuqnJi77bIofZXrjHup1XrJ4euxI+j7afPt35UABpVQx5HCtp4jMen cBG8aMpEyOGSIoRsAF4AIOKdXN4UkVwn9i8tA7CTtoJiPnZ+YWLOoqCo5eVMYIqEAqvw PgYkhlh4nqlITITVspjwk/08avKO+NC76XNJc0HQRlk8WNz3cxzF295sTL0+n39gP7JG x3Iw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Jl7umYqy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id o24si16180264eji.60.2020.08.19.13.06.14; Wed, 19 Aug 2020 13:06:39 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=Jl7umYqy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726853AbgHSUFI (ORCPT + 99 others); Wed, 19 Aug 2020 16:05:08 -0400 Received: from mail.kernel.org ([198.145.29.99]:58468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726435AbgHSUFI (ORCPT ); Wed, 19 Aug 2020 16:05:08 -0400 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 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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?