Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1715032imm; Thu, 12 Jul 2018 06:44:25 -0700 (PDT) X-Google-Smtp-Source: AAOMgpdP6E1AfSv1dT1/AEJ6UVVA//q9f6qO7COO4rpSbvRiJrOqBzrSc4eEutczhE/i9n/YuoA7 X-Received: by 2002:a63:b40e:: with SMTP id s14-v6mr2220407pgf.9.1531403065438; Thu, 12 Jul 2018 06:44:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1531403065; cv=none; d=google.com; s=arc-20160816; b=FwFVLGgWBtvaYNCP0JZkzEaHLOQAWp5YwpB2f1x4MjoTbp8dR3CaJziUCfbKAanoQJ PIzX67tnHMlx9A+A62pfuMULCLdWFsBh0I+rA0epefJvkS3+Bd1CcKbktSdo858SNnEy F4uB7i6nmkB4nupBPt+4aRpBn9x61icA9iXjJJHfSWkU5b17rtgvAcAKKvJDI8ioTz5I SnchhRW8aRqS0j1sGCmWDWKVU3VYL3DD/44TTIFgHCUVaIVQAlW3RTN4/5veGyRwLTRo jpRASk/ErMQn9I7bVNuGN795bs2Q0q7zBpWhqEsxBqvRNT1AXvXVeRV4o4s2n+ayEpkP 1VGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:arc-authentication-results; bh=jV5fXeD/Jl2UGrQMMIrL40E//+nYwYE5D9zBzmdre7E=; b=WnQwt3x6Pa8CVxj9uz7OiiGeCIkUOselCavH4DNpbtIQ/aA3+/NOsBKz4CIazKtNcw qJgrVPIB3FDHKQ6FNxwmsjGId856vGojddO3RRT+4cfiTTLrDHbQe4eYS7oiZI/uqzXr dOduuM1kwIthT/7GxHFD8T3dNkTnjEDnLQeyhd92/RNI3jm/s17+JAOjKt9r3K8DObSH G/ON1L5uP2seQK8iA8i+//cMP+0U/wZB3o16fMOYKAe6MmyDvhWcq8Eg5Ea3coyq0sRx KKJtPV7sejbRpoK2cF4HxqT18uZAPoRFQNORYrfzZK9cxNQgx6z+OTBxd4Ai7r7hzaTB axzw== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t89-v6si23400373pfe.59.2018.07.12.06.44.09; Thu, 12 Jul 2018 06:44:25 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732359AbeGLNwG (ORCPT + 99 others); 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