From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f72.google.com (mail-ed1-f72.google.com [209.85.208.72]) by kanga.kvack.org (Postfix) with ESMTP id 3A8596B436E for ; Mon, 26 Nov 2018 14:53:50 -0500 (EST) Received: by mail-ed1-f72.google.com with SMTP id b3so2092204edi.0 for ; Mon, 26 Nov 2018 11:53:50 -0800 (PST) Received: from mx1.suse.de (mx2.suse.de. [195.135.220.15]) by mx.google.com with ESMTPS id y2-v6si462897ejj.125.2018.11.26.11.53.48 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 26 Nov 2018 11:53:48 -0800 (PST) Date: Mon, 26 Nov 2018 20:53:45 +0100 From: Michal Hocko 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: Sender: owner-linux-mm@kvack.org List-ID: 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 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