Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp730172imu; Tue, 20 Nov 2018 06:09:24 -0800 (PST) X-Google-Smtp-Source: AFSGD/XCv0sQOAlJ3NlvP2EJy65X1TWzq0WJ88glOkfuzITDizN1JIn+gs/dGerJfM3LgA8tAtb3 X-Received: by 2002:a63:1e5c:: with SMTP id p28mr2069648pgm.376.1542722964856; Tue, 20 Nov 2018 06:09:24 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1542722964; cv=none; d=google.com; s=arc-20160816; b=da9/mfD4ahAV1U9pvLBE4ZPkJbDMwdG09Xbe26KbZK64qyAdL4YEutLEUbAyB3zxPp I03A1aVcX5Nx/4/xRYdTCuJn3+CTaawuXIk1PPryWgCDt/gN5KMPBolNkUorHsUZUOET NogbPoRyW0IvArw++8g1kZwvYDtEw3BoXOeFNZcSe+4LyVs0o4crHc1gXFjPYeNHlIZT K5Sw+hJqo8b8nDl+YKUttwNfzjROIgetq4cAh74HI57i/zN5xDkt5/Di0NDQbBxrclMN vSDi0BGTMTnHDtWG+rvb3IxsKrNf+pkbABGarloTLQqDuaRN10WiP6cwH1NKB9dfEwvQ 4KgA== 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:dkim-signature; bh=fOgWAi0O2tc9zB8aSd5VFAaRe8eYerzgVbt612r4NZ8=; b=fvl6wtDlPmli6he/2cfqIuybJLp/gN+BISkNKwM8tmu77u7v9/y28m16GFtwSP2Hor rn7eQt2BwFvGriL6tQL4S2YlWk7R7nhD97GewIGN0bmOXmYtuiQqdtx84loLsOlJikxd qVQSefKe8QwJTfAITPb8JP0bpZ7Vuh/6uUMHTm4zCep6TkPy7b9ocJ/2+oe0OnySKzPh 9M0RzEe+JnYS7aVqpbkZOTKU8Zud6KmukPdaJ9CbDck2ZlchW4IbWzZqYrrFCIPVZ0aE DtdVZLlK8fRxfTlrnD5CLSOKfMJYgDRFcbZ/FQTFrg7lGOOYSinSMvHUlXcnf6xQcqna 4bHw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=oIg8ANg7; 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 37si41379832pgs.447.2018.11.20.06.09.08; Tue, 20 Nov 2018 06:09:24 -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; dkim=pass header.i=@shutemov-name.20150623.gappssmtp.com header.s=20150623 header.b=oIg8ANg7; 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 S1729372AbeKUAgl (ORCPT + 99 others); Tue, 20 Nov 2018 19:36:41 -0500 Received: from mail-pf1-f196.google.com ([209.85.210.196]:43949 "EHLO mail-pf1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726005AbeKUAgl (ORCPT ); Tue, 20 Nov 2018 19:36:41 -0500 Received: by mail-pf1-f196.google.com with SMTP id w73so1042593pfk.10 for ; Tue, 20 Nov 2018 06:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=shutemov-name.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=fOgWAi0O2tc9zB8aSd5VFAaRe8eYerzgVbt612r4NZ8=; b=oIg8ANg7wQ/exYQkot06N8fRBsE2Ju++kbCxrDg/BSChoG5rt9BMuJwIyUJj917Eft XoHCYZXrsbdK1WtFNdxarLV5fq8CizUM3rPgFkYCmDXrKdmvfGigHJ2ziqyCVPl+1eFJ RYhz+jBcxyBQrclGgwSdFRobj6nzLfHG6Ex+Mly1pZ4tIAmNoErfOI5VwVMpXIstdiuK 8qvXr93EU6luYB7XqBCZN48JRD/cG5/ckm1vm5xR/HENr13VWdZ5UEN0EtIWH8h6zqV5 d4zZe7HTzVW5g76QO6wDpPZC3xiHTC4AsyrCAsxVKKg7XdObfBX5W18uzL+9oRpW1MCY aXmw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=fOgWAi0O2tc9zB8aSd5VFAaRe8eYerzgVbt612r4NZ8=; b=l0BMtdcfUHX0POk8nH6vE0o7Q03qDLwI+21bX+yPGth23OjZVLk3wt514ywiwNw5Fk BfdRNCW4fJl5VRUW/L5/UDE/WTTRbE2DfraK3r0Rw7zbkcYLLTv/g1wdPhxZMlhzwQLP +I6XA88XqK0z7lguU+sAceQx/mb6qj3otrxqatOtJTBwAxYOyI3DpMZxWxqeba7t22SF 40aYAAudhEUNe7ciZcyjmoqqS/xyo9cb5Tjwo5Rcjji3N1jZnlilPdseBUgsg/Vkgp8i SGro46c4ISkN41op8SFLlhqUJkz7/cOEUbQyZP/f0g3ARQhC+ukj804GarA+ihgBWRYo rrHA== X-Gm-Message-State: AA+aEWaahxXoqFq+UP3khvHG4XQz+AemFMvaQrJPc+VdOs7Ol/rSWsbc M1kbMlFJhlfVv/siuWFwp5Sn9w== X-Received: by 2002:a63:de04:: with SMTP id f4mr2008851pgg.292.1542722841869; Tue, 20 Nov 2018 06:07:21 -0800 (PST) Received: from kshutemo-mobl1.localdomain (fmdmzpr04-ext.fm.intel.com. [192.55.54.39]) by smtp.gmail.com with ESMTPSA id d6sm30886589pgc.89.2018.11.20.06.07.20 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 20 Nov 2018 06:07:20 -0800 (PST) Received: by kshutemo-mobl1.localdomain (Postfix, from userid 1000) id 64EBE302653; Tue, 20 Nov 2018 17:07:15 +0300 (+03) Date: Tue, 20 Nov 2018 17:07:15 +0300 From: "Kirill A. Shutemov" To: Michal Hocko Cc: linux-mm@kvack.org, Andrew Morton , Oscar Salvador , Pavel Tatashin , David Hildenbrand , LKML , Michal Hocko Subject: Re: [RFC PATCH 3/3] mm, fault_around: do not take a reference to a locked page Message-ID: <20181120140715.mouc7okin3ht5krr@kshutemo-mobl1> 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: <20181120134323.13007-4-mhocko@kernel.org> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 20, 2018 at 02:43:23PM +0100, 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. Looks fine to me. But please drop a line of comment in the code. As is it might be confusing for a reader. -- Kirill A. Shutemov