Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp55306imu; Tue, 27 Nov 2018 08:58:39 -0800 (PST) X-Google-Smtp-Source: AFSGD/VJ04YHUwwcj21jJuxBb4BVWCJz/MHDpY5QkEqyE5bIziTzlnKnIErtRetc/m7sIwSXItb2 X-Received: by 2002:a63:e4d:: with SMTP id 13mr27803237pgo.369.1543337919165; Tue, 27 Nov 2018 08:58:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543337919; cv=none; d=google.com; s=arc-20160816; b=YAmGy5n9GdcbM/P/bkSQvcpVCXzy+rqp2up1jl42GzBzRkUY11B/fl3eLuvqwzgE46 lE2sP99v7PHAPnfTZhyaBDVKUDoR4/yZkBp69zYSRK9bANIO9+HNPdRGPXELkp8t8/Es x07jHfuiGCzzFzZi09WDk/sLGmAhMF4FGr/9OANsZm8c+1tLtEiNleWWyBSCODx48YaX mMygrmuI75P4uxYjoz2u5YfVg+jbl2pSp6/Lj6fomnfzKjrRwuEklhI/FzjNN0IoqvZA o1aLpGTqciKHCpB/k4g8TIGuWFD0WSMfwg+om9H1VfxnrUIxr8cVm6xJg1JpL9+Zmu// h9Ew== 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=QbqT3YHdbl84bVrpn8GOI0U7yhiICLnA2KX/6vZ63eY=; b=uTuu5C9tWu9JdWDNVJ8+LyANecF1gk6xRfpYhLe9tp8uSVw/Keg2vCv3rePoAt6sY5 AOgQpBxWrelotTB+T//cewP30gbSarDJrtB/V3j0uL85IjSJucxFS4z/BgXaWzPun8o3 NMCVB1C69cL4W7dBod7P61PPTnZDzPrDMqIy0p1CGD1E98qzrFGaZR+h09k3MZRetBHb 58Zt/zBNuwmLCnv0sA9A3SQ3GD7XXskDVo4M9KF656tlniXXIlMgPw0j7ehYkWqXQL2y LZo+fIHbyScrFO/69JlofsWVaVGC3sskQiqlwoNNoys+DTsoK7duLEBWWmnRrsYsCc4J UudA== 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 g62-v6si4324772pfe.186.2018.11.27.08.58.22; Tue, 27 Nov 2018 08:58:39 -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 S1731860AbeK1Dze (ORCPT + 99 others); Tue, 27 Nov 2018 22:55:34 -0500 Received: from mx2.suse.de ([195.135.220.15]:36058 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1730080AbeK1Dzd (ORCPT ); Tue, 27 Nov 2018 22:55:33 -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 8AEE9AF86; Tue, 27 Nov 2018 16:57:00 +0000 (UTC) Date: Tue, 27 Nov 2018 17:56:59 +0100 From: Michal Hocko To: Christopher Lameter Cc: Mike Rapoport , Matthew Wilcox , Hugh Dickins , Linus Torvalds , Andrew Morton , Baoquan He , Vlastimil Babka , Andrea Arcangeli , David Hildenbrand , Mel Gorman , David Herrmann , Tim Chen , Kan Liang , Andi Kleen , Davidlohr Bueso , Peter Zijlstra , Nick Piggin , pifang@redhat.com, linux-kernel@vger.kernel.org, linux-mm@kvack.org Subject: Re: [PATCHi v2] mm: put_and_wait_on_page_locked() while page is migrated Message-ID: <20181127165659.GC6923@dhcp22.suse.cz> References: <20181126205351.GM3065@bombadil.infradead.org> <20181127105602.GC16502@rapoport-lnx> <010001675613a406-89de05df-ccf6-4bfa-ae3b-6f94148d514a-000000@email.amazonses.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <010001675613a406-89de05df-ccf6-4bfa-ae3b-6f94148d514a-000000@email.amazonses.com> 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 27-11-18 16:49:47, Cristopher Lameter wrote: > On Tue, 27 Nov 2018, Mike Rapoport wrote: > > > > * @page: The page to wait for. > > > * > > > * The caller should hold a reference on @page. They expect the page to > > > * become unlocked relatively soon, but do not wish to hold up migration > > > * (for example) by holding the reference while waiting for the page to > > > * come unlocked. After this function returns, the caller should not > > > * dereference @page. > > > */ > > > > How about: > > > > They expect the page to become unlocked relatively soon, but they can wait > > for the page to come unlocked without holding the reference, to allow > > other users of the @page (for example migration) to continue. > > All of this seems a bit strange and it seems unnecessary? Maybe we need a > better explanation? > > A process has no refcount on a page struct and is waiting for it to become > unlocked? Why? Should it not simply ignore that page and continue? It > cannot possibly do anything with the page since it does not hold a > refcount. So do you suggest busy waiting on the page under migration? -- Michal Hocko SUSE Labs