Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1663901imu; Tue, 20 Nov 2018 23:25:46 -0800 (PST) X-Google-Smtp-Source: AFSGD/XvVUIE9N6+LlBj0XgPd+J07MAGoE3rSEZi30SjyvqtG/0Xk2OzalQAkdf+fiakdgxqoAxw X-Received: by 2002:a63:2b01:: with SMTP id r1mr4866753pgr.432.1542785146206; Tue, 20 Nov 2018 23:25:46 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542785146; cv=none; d=google.com; s=arc-20160816; b=y7FRsYZnfmWR7tgb6+XwhXREkM8meMpn4wMWZRqO812L1YSxAr6vke30T/XdMCuf5J XabwlAsL8Uu5eYoAy75/QRVKgyfNqKAJVrrwzTVPNE8Dt6/F+I+UF+3hPilRos8U5k1q 6STW43cm+fqV1t9AzOrdKUOxJYiy6e2qJX7oDxIF827ZDedBnoSg1UFirldUaEbaKZv/ vL5P2pg+cdCuqdOjkvhHtqHZjxb+gK6FsXLy2NKclm4qy6o5J0yQuNTmG36gW+ts1dxA fpVU9l1PJsxBeEEDZyfo42dtGj7JwPRGvlYvaKyn6zSx9nOuTdifevn2LnNYpTW9rWeo e13w== 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; bh=BZ/lzAH2Dyo7AFIXA57b2pZ3Zeyou+V0RdEaR/tZ4Hs=; b=k63NY5zxhLDQhNdoJF5GEHxLNfAsEvPX3Y1aUNuxZXnHNrkGCR7DcCVxfkW0hLovs3 R2aXIZ+Uf+KkeyNqibCr/BdwzwIgFX43TNujTZy5XA5uTf4tiSTX2j4G92Wv6iq8bdme VrGS16U+SndHf00QwuorMbLhvpjcne0vP/IVmFrNNd7boO9WhymtpItwhsYL0W0mSUex SUt1oY8tfzFbDuA21/CKPX1vL88gCQR2CnU4wyo3Rhtom+UjSQgI/tmXyhKjCVmX+3oX 5Gwf0+TfsK0UNO4yaKwjk66fPGdZxgzZIjhIOq2JYCHAOCAQdysUS+mevvqQtrPjJtun WSiA== 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j193si43538480pge.332.2018.11.20.23.25.32; Tue, 20 Nov 2018 23:25:46 -0800 (PST) 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726862AbeKURox (ORCPT + 99 others); Wed, 21 Nov 2018 12:44:53 -0500 Received: from mx2.suse.de ([195.135.220.15]:58608 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725999AbeKURox (ORCPT ); Wed, 21 Nov 2018 12:44:53 -0500 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id C5845ACB4; Wed, 21 Nov 2018 07:11:33 +0000 (UTC) Date: Wed, 21 Nov 2018 08:11:32 +0100 From: Michal Hocko To: Hugh Dickins Cc: linux-mm@kvack.org, Andrew Morton , Oscar Salvador , Pavel Tatashin , David Hildenbrand , LKML , "Kirill A. Shutemov" Subject: Re: [RFC PATCH 3/3] mm, fault_around: do not take a reference to a locked page Message-ID: <20181121071132.GD12932@dhcp22.suse.cz> References: <20181120134323.13007-1-mhocko@kernel.org> <20181120134323.13007-4-mhocko@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue 20-11-18 17:47:21, Hugh Dickins wrote: > On Tue, 20 Nov 2018, Michal Hocko wrote: > > > From: Michal Hocko > > > > filemap_map_pages takes a speculative reference to each page in the > > range before it tries to lock that page. While this is correct it > > also can influence page migration which will bail out when seeing > > an elevated reference count. The faultaround code would bail on > > seeing a locked page so we can pro-actively check the PageLocked > > bit before page_cache_get_speculative and prevent from pointless > > reference count churn. > > > > Cc: "Kirill A. Shutemov" > > Suggested-by: Jan Kara > > Signed-off-by: Michal Hocko > > Acked-by: Hugh Dickins Thanks! > though I think this patch is more useful to the avoid atomic ops, > and unnecessary dirtying of the cacheline, than to avoid the very > transient elevation of refcount, which will not affect page migration > very much. Are you sure it would really be transient? In other words is it possible that the fault around can block migration repeatedly under refault heavy workload? I just couldn't convince myself, to be honest. -- Michal Hocko SUSE Labs