Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp2071748ybd; Thu, 27 Jun 2019 06:19:36 -0700 (PDT) X-Google-Smtp-Source: APXvYqxqgYeQ/R+RTKKOq0PH9lbCskb0iWV7w4EmPHSt8J0nWcfXItbO/0+dUB11HGF6Cr7RXk7O X-Received: by 2002:a63:dc11:: with SMTP id s17mr3871229pgg.47.1561641576733; Thu, 27 Jun 2019 06:19:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561641576; cv=none; d=google.com; s=arc-20160816; b=MtZ8hU//W6KZ29Q0HFr3WHSmBfZIObOR2Gcoz2mzknE1Taj9QiK5rikW0RNa1zINKl gM0qnHSWMY6NdfysR/zBISMx1bwRncJIOUXnsvLXf/tG2TLTGoVSXhl024o3r0ySLsIb zpBfP4thCPF3Y1P4eiPIMt36u29zl24zGBrXlqd2TuYwUobl5S5h+wbUz/O6IkkMp9b7 FskQOzmtRfFk87yQE89eIk5thUSg8+3eDMalbg74nGzcze1VAN/96DQXbsoL10KsE5iO OBDtbh4Ndepm9JTPNFxJLia0wFPPR0KuIDzo8Yn17sr3lcuwdrlt/x7ZZqqeM++gTq32 RFsw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :in-reply-to:date:cc:to:from:subject:message-id; bh=Sa5PVO7TcYptMQVHIYjD2C29YDrST7pQ/fPpLfEiaaU=; b=AE64dG9TUt9YIlzsUyjqcNnF6i4LZ0axlELZ2XqT6N4mPk2e3jGu5LK/VH+61GRM7i dRY63bKgPyYso6l+EunnL+0KnTqvpA4F282Y+P9njX6+onHMlnekyCj/ryrTMW5sBuc6 gJSTEi78Ie1QOyfxqox/Vqru78G7NTv5t6CLmMPG0M8HQMzReAi9s57Q6npma4tcCpWQ RXN2AD6CUBq1G7aBrBTCzHn4ADtUEedPpZEgc2kKuEtFPbY7liRfqqhOjEMROQNY7Vdc et74sg8ZRBK4x4qN393j03xXqSVdbYz5IeyrZhR6BTO4aJcBRP7To8N4XIvkUpG3osFk b+AQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x14si2306733pgt.495.2019.06.27.06.19.20; Thu, 27 Jun 2019 06:19:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726834AbfF0NSm (ORCPT + 99 others); Thu, 27 Jun 2019 09:18:42 -0400 Received: from shelob.surriel.com ([96.67.55.147]:60164 "EHLO shelob.surriel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726059AbfF0NSl (ORCPT ); Thu, 27 Jun 2019 09:18:41 -0400 Received: from imladris.surriel.com ([96.67.55.152]) by shelob.surriel.com with esmtpsa (TLSv1.2:ECDHE-RSA-AES256-GCM-SHA384:256) (Exim 4.92) (envelope-from ) id 1hgUIO-0006Ad-1j; Thu, 27 Jun 2019 09:18:36 -0400 Message-ID: <8026a0341c83ceee69d04cbe55f1e0fa3d6cb610.camel@surriel.com> Subject: Re: [PATCH v9 6/6] mm,thp: avoid writes to file with THP in pagecache From: Rik van Riel To: Song Liu , linux-mm@kvack.org, linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Cc: matthew.wilcox@oracle.com, kirill.shutemov@linux.intel.com, kernel-team@fb.com, william.kucharski@oracle.com, akpm@linux-foundation.org, hdanton@sina.com Date: Thu, 27 Jun 2019 09:18:35 -0400 In-Reply-To: <20190625001246.685563-7-songliubraving@fb.com> References: <20190625001246.685563-1-songliubraving@fb.com> <20190625001246.685563-7-songliubraving@fb.com> Content-Type: multipart/signed; micalg="pgp-sha256"; protocol="application/pgp-signature"; boundary="=-WfH5iiK7XcqIOQRh+gpO" User-Agent: Evolution 3.30.5 (3.30.5-1.fc29) MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org --=-WfH5iiK7XcqIOQRh+gpO Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Mon, 2019-06-24 at 17:12 -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. >=20 > 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_last(), if the file is open for write and > nr_thps > is non-zero, we drop page cache for the whole file. >=20 > Reported-by: kbuild test robot > Signed-off-by: Song Liu Acked-by: Rik van Riel --=20 All Rights Reversed. --=-WfH5iiK7XcqIOQRh+gpO Content-Type: application/pgp-signature; name="signature.asc" Content-Description: This is a digitally signed message part Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNATURE----- iQEzBAABCAAdFiEEKR73pCCtJ5Xj3yADznnekoTE3oMFAl0UwisACgkQznnekoTE 3oNDZAgAhCigDJCHSHlL1abXwMFGGvkGQl64ICm1ia7nRSP9ppL9746ikxugPxnz oCURzm/HvLsSaR6w5Orpm9e/su04mjAOdax5Ab1+ZyVTAzRTY7353e12znTqSLBL p4ABWVBJ8LRquZvHJCD3XMUMtkyrfiA4pm10cP5irPZI7BEnmnpSR3FxhXOLJOxg DVvD5fo/0JRBgh18pLOaw1BdZXW4MlbRrnsEmkCr+cHP/oViU6S0LwKKnandYKoh y2s8zhUH4+aPl0lLLy3irNfXkXzPfnPDzBtwFaboLO/iUI1+bTrd8nax43O1pTxV AoHIzhfHDW7cPSs7GDBgvNa9PTgohw== =trnf -----END PGP SIGNATURE----- --=-WfH5iiK7XcqIOQRh+gpO--