Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp4320216imm; Wed, 30 May 2018 03:30:19 -0700 (PDT) X-Google-Smtp-Source: ADUXVKIm1svjUmhf4kpFEzlqb0IDdQgwo/g1ktNEWBj4t9JE6CYHmTEO/vmcRlywb/0v2l304h8Y X-Received: by 2002:a63:384d:: with SMTP id h13-v6mr1769466pgn.209.1527676219842; Wed, 30 May 2018 03:30:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527676219; cv=none; d=google.com; s=arc-20160816; b=o6FdQzTcT+7N2AcFF+b/oXw3LLO0jOvvGfQo6/eQJe1f6Ev3nohH933NZtOeoOs5zu fC+jcGnv9p6PNDJ8QcjsJi7rjN8++HhMYyl6jVbgpQZOXLOgnSo33IVHxlmokytZ5+0C AJMb2XhNAw0bvlymtPecWEeArloUIlBK2Rg8/fC7gg3YAQ9yGZcXxSbTjlf7MRXeeMLO O81qpZamZnb6Iaebk09YQZdiSa4JYIWgPgK2x4Q3K3NGFElVOXFyjvTrRVfIRS+BK5Rd jYflDzIG2+5b7TgrhwbgDbletTB/qR8SV6yJtOYffA+gSP6aGGoUZZd8ShfGlp6tdnpI MyKw== 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=D+ymnNN1/5Q9szUvPx1P9USWJ9drMg6aRzDMHmu8vu4=; b=d4OKofEpvRibarUbqOgyqExZPvKU45HRLcsT9FwUSYWUsaJz8v3uEcqZ653VZ5ZWOw bNhtxqV0Be96aJf1aruyloiZYvecF89J2y2BDE4fkhsbLkNNDTFtRxE1D18G6O1BfwK/ uqwv0ihSNmoHojKnkcoq9F1Ylw5jSC5KYfyi59ACaMCdg3tPVGYTsDlYVyqUULj4AQsb Gjv7kw5NNnTKTxdlVSrchkBVyDT1ZfVJyOKMUJTMXV5hLExvuCGjjRmqUm04oB0bLeiU cXPsJbvsIub5+MV0OAi177UXT/P3yiCODIxMhtB4gt9uNV83KKpaSbFidFb2zs23z/Z1 kk0w== 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 j65-v6si27106889pgc.552.2018.05.30.03.30.05; Wed, 30 May 2018 03:30:19 -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 S1751637AbeE3K1z (ORCPT + 99 others); Wed, 30 May 2018 06:27:55 -0400 Received: from mga02.intel.com ([134.134.136.20]:22904 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751204AbeE3K1y (ORCPT ); Wed, 30 May 2018 06:27:54 -0400 X-Amp-Result: UNSCANNABLE X-Amp-File-Uploaded: False Received: from orsmga002.jf.intel.com ([10.7.209.21]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 30 May 2018 03:27:53 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,460,1520924400"; d="scan'208";a="62848470" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga002.jf.intel.com with ESMTP; 30 May 2018 03:27:51 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id 0ED64F5; Wed, 30 May 2018 13:27:50 +0300 (EEST) Date: Wed, 30 May 2018 13:27:50 +0300 From: "Kirill A. Shutemov" To: Hugh Dickins Cc: Andrew Morton , Konstantin Khlebnikov , Nicholas Piggin , linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCH] mm/huge_memory.c: __split_huge_page() use atomic ClearPageDirty() Message-ID: <20180530102750.6mmlmypt35w4xaei@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 Wed, May 30, 2018 at 01:50:22AM +0000, Hugh Dickins wrote: > Swapping load on huge=always tmpfs (with khugepaged tuned up to be very > eager, but I'm not sure that is relevant) soon hung uninterruptibly, > waiting for page lock in shmem_getpage_gfp()'s find_lock_entry(), most > often when "cp -a" was trying to write to a smallish file. Debug showed > that the page in question was not locked, and page->mapping NULL by now, > but page->index consistent with having been in a huge page before. > > Reproduced in minutes on a 4.15 kernel, even with 4.17's 605ca5ede764 > ("mm/huge_memory.c: reorder operations in __split_huge_page_tail()") > added in; but took hours to reproduce on a 4.17 kernel (no idea why). > > The culprit proved to be the __ClearPageDirty() on tails beyond i_size > in __split_huge_page(): the non-atomic __bitoperation may have been safe > when 4.8's baa355fd3314 ("thp: file pages support for split_huge_page()") > introduced it, but liable to erase PageWaiters after 4.10's 62906027091f > ("mm: add PageWaiters indicating tasks are waiting for a page bit"). > > Fixes: 62906027091f ("mm: add PageWaiters indicating tasks are waiting for a page bit") > Signed-off-by: Hugh Dickins Thanks for catching this. Acked-by: Kirill A. Shutemov -- Kirill A. Shutemov