[<prev] [next>] [day] [month] [year] [list]
Message-ID: <20190812203829.GC15498@cmpxchg.org>
Date: Mon, 12 Aug 2019 16:38:29 -0400
From: Johannes Weiner <hannes@...xchg.org>
To: Song Liu <songliubraving@...com>
Cc: linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, matthew.wilcox@...cle.com,
kirill.shutemov@...ux.intel.com, kernel-team@...com,
william.kucharski@...cle.com, akpm@...ux-foundation.org,
hdanton@...a.com
Subject: Re: [PATCH v10 7/7] mm,thp: avoid writes to file with THP in
pagecache
On Thu, Aug 01, 2019 at 11:42:44AM -0700, Song Liu wrote:
> In previous patch, an application could put part of its text section in
> THP via madvise(). These THPs will be protected from writes when the
> application is still running (TXTBSY). However, after the application
> exits, the file is available for writes.
>
> This patch avoids writes to file THP by dropping page cache for the file
> when the file is open for write. A new counter nr_thps is added to struct
> address_space. In do_dentry_open(), if the file is open for write and
> nr_thps is non-zero, we drop page cache for the whole file.
>
> Cc: Johannes Weiner <hannes@...xchg.org>
> Reported-by: kbuild test robot <lkp@...el.com>
> Acked-by: Rik van Riel <riel@...riel.com>
> Acked-by: Kirill A. Shutemov <kirill.shutemov@...ux.intel.com>
> Signed-off-by: Song Liu <songliubraving@...com>
Acked-by: Johannes Weiner <hannes@...xchg.org>
Powered by blists - more mailing lists