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=-2.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_PASS,URIBL_BLOCKED,USER_AGENT_NEOMUTT autolearn=ham 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 C1D82C43A1D for ; Thu, 12 Jul 2018 13:42:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7BA0921479 for ; Thu, 12 Jul 2018 13:42:31 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7BA0921479 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.intel.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732363AbeGLNwG (ORCPT ); Thu, 12 Jul 2018 09:52:06 -0400 Received: from mga04.intel.com ([192.55.52.120]:23500 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726782AbeGLNwF (ORCPT ); Thu, 12 Jul 2018 09:52:05 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from orsmga006.jf.intel.com ([10.7.209.51]) by fmsmga104.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jul 2018 06:42:28 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,343,1526367600"; d="scan'208";a="57130606" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga006.jf.intel.com with ESMTP; 12 Jul 2018 06:42:05 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id E5E4D195; Thu, 12 Jul 2018 16:42:10 +0300 (EEST) Date: Thu, 12 Jul 2018 16:42:10 +0300 From: "Kirill A. Shutemov" To: Hugh Dickins Cc: Andrew Morton , Ashwin Chaugule , "Huang, Ying" , Yang Shi , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] thp: fix data loss when splitting a file pmd Message-ID: <20180712134210.d7kzlubl6runpfkr@black.fi.intel.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: NeoMutt/20170714-126-deb55f (1.8.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jul 12, 2018 at 12:48:54AM +0000, Hugh Dickins wrote: > __split_huge_pmd_locked() must check if the cleared huge pmd was dirty, > and propagate that to PageDirty: otherwise, data may be lost when a huge > tmpfs page is modified then split then reclaimed. > > How has this taken so long to be noticed? Because there was no problem > when the huge page is written by a write system call (shmem_write_end() > calls set_page_dirty()), nor when the page is allocated for a write fault > (fault_dirty_shared_page() calls set_page_dirty()); but when allocated > for a read fault (which MAP_POPULATE simulates), no set_page_dirty(). Yeah... Sorry. Reviewed-by: Kirill A. Shutemov -- Kirill A. Shutemov