Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp357723imu; Mon, 26 Nov 2018 11:55:16 -0800 (PST) X-Google-Smtp-Source: AFSGD/VDJKKTpHOFoXwOiXcXAg5wJI1fFs3h/1IH1bDBcdN0umlitwIMjzUutbXNtYjvRfi2kaEh X-Received: by 2002:a63:8f45:: with SMTP id r5mr25875011pgn.222.1543262116149; Mon, 26 Nov 2018 11:55:16 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543262116; cv=none; d=google.com; s=arc-20160816; b=a1nTsTb7jgDt1J89AIiGhOsAV7oKQI6m1UYs+bDgAoRaGJB8zykxzW3GlIAwnKD7k2 jFD/A1iUEWbDbE3Q3G6Yx7fPqkalbIql+WeLb1UyBTHZU3oKBC7vrFM7H9EH2KErieIF f3ZSnIWo8tGjZxtDsLK8qD6ahEJPKT8YvBp7czI8kskvKPhWIvrs2my2USukz0Lj20HG CxfdYk9hVDGDObpOBUrosEs+3CQiP+PlcsvS2Ksny15Z3A7SOaYthmPFrgyEZ1GCflvO WQ3dmsFbuShBIDIPYNgolx5Kr+rxz1mRFAZWXHcYVdNInO+bnEh81hten3u1A7ALh3aJ tAeQ== 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=8H17nrb049UodFg5JnCp4gmn2oDrtvXJJ9x0WGmI0qQ=; b=UJGzxvS+xa1ZqJSqtODE6cTUv+tquXX+e89U09nsqZqEU8Nr/ejVO6P7VYz99kg36l J7WhWaanXXNzigHbiPTsqKwUImeISe+vPLrW0Iov9yjIg9h+5Nej0rlsJ79bEn2fII+f TaJ/rk3BlU30o1EWXInGxPzMbvHjRb+EwmwTJ85mdN1JE6VLMMq7TKFu1k8yZPT7Nc1Z q4w58Ar7pUa29gIdssv15yMmTDhz2moUwjJnurDDQUbv1YgEoIEcG0sDzDlYJbefTJmJ EuCtJgNJ7TVizCNdEHuWwhZ1GuCGwWJX2rtQlBlZBIDwQLJr8CytCihy7wv5GjyueLBk hPrw== 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 v8si1200543ply.126.2018.11.26.11.54.58; Mon, 26 Nov 2018 11:55:16 -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 S1727022AbeK0Gs7 (ORCPT + 99 others); Tue, 27 Nov 2018 01:48:59 -0500 Received: from mx2.suse.de ([195.135.220.15]:35484 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726294AbeK0Gs7 (ORCPT ); Tue, 27 Nov 2018 01:48:59 -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 008D6AFAE; Mon, 26 Nov 2018 19:53:47 +0000 (UTC) Date: Mon, 26 Nov 2018 20:53:45 +0100 From: Michal Hocko To: Hugh Dickins Cc: 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 , Christoph Lameter , 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: <20181126195345.GI12455@dhcp22.suse.cz> References: 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 Mon 26-11-18 11:27:07, Hugh Dickins wrote: [...] > @@ -1049,25 +1056,44 @@ static void wake_up_page(struct page *page, int bit) > wake_up_page_bit(page, bit); > } > > +/* > + * A choice of three behaviors for wait_on_page_bit_common(): > + */ > +enum behavior { > + EXCLUSIVE, /* Hold ref to page and take the bit when woken, like > + * __lock_page() waiting on then setting PG_locked. > + */ > + SHARED, /* Hold ref to page and check the bit when woken, like > + * wait_on_page_writeback() waiting on PG_writeback. > + */ > + DROP, /* Drop ref to page before wait, no check when woken, > + * like put_and_wait_on_page_locked() on PG_locked. > + */ > +}; I like this. It makes to semantic much more clear. Thanks! -- Michal Hocko SUSE Labs