Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp149600imu; Tue, 27 Nov 2018 10:15:15 -0800 (PST) X-Google-Smtp-Source: AFSGD/Xd6+DeH9iEba4U4nSoblbdbxnPqxBQDNTJ6N8NgIR3yFeWiQO4lArbD65J+YxMLiCtfGuu X-Received: by 2002:a63:396:: with SMTP id 144mr30397456pgd.68.1543342514856; Tue, 27 Nov 2018 10:15:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543342514; cv=none; d=google.com; s=arc-20160816; b=YgQrsndWgpZkCIJ19VZzeJlWFkwuYIJ5OxRwzTdej4U6yapdJeS75tsbfZeUdpvGKi bjeA82xxodrtfxE7evFDyCCE8bycUHfEx1p2QUmUKnMeTaVuHByfS0jY1KoY00Ok5Tos 9175aowfoRBW6wWRHPnK6RUdbIXtS9JEzSnUAXT1ocyc3vWU6GJ3hcyzQgxDGaZbIOlR h58YRi0x8J8JhgboX7gORTbHJdXrhmcKZKLUAtgKZwnIAqkqu3gTUjY00MmYhZAwPDlI MWdmedtou3p7jNk9i+yp6FDeJrhpp7961n6clmSd5CIn5fMwPSphfQUQ6yx7UtaLl+P4 uD0w== 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=RKrob1IKXllljtP901kTqdVePcgUxEq8tg19bjgaUgs=; b=ODW2XN+UmdAmiZNb1NwmBS6Bn5chqmzJAkLbj9nRd6XYWYMHmtEn+Ck8zL6PL6XTtz AyRWrE/qP/+Q55rP1psU0s4k8ci8gIU7ZNBPHZqIeMHAVP8Vtt9EFx8FJh/B7KhsED2d 8zgSQ8c/sc8c4ylKhBnDmirCgsHYhbfgyUFvJ/ZwbZitzycjW8Ze8lpChh+c473+aRq4 mxPvPH5OjLOUj9ziyr6NW9PFyuCGMQ64M/Kj1Jbndzw1mdWafxA8W58rdIVOHjQyf7t3 q/7fa4WR/zZlBPm+69djKi54wUmrfQumGE9Y68dZGWMhE3KSCW+mwGo4eviiGYPF9bes oDCg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kI9KMl33; 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 d8si4272319pgl.386.2018.11.27.10.14.48; Tue, 27 Nov 2018 10:15:14 -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=fail header.i=@infradead.org header.s=bombadil.20170209 header.b=kI9KMl33; 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 S1728046AbeK1FJr (ORCPT + 99 others); Wed, 28 Nov 2018 00:09:47 -0500 Received: from bombadil.infradead.org ([198.137.202.133]:46980 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725872AbeK1FJr (ORCPT ); Wed, 28 Nov 2018 00:09:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20170209; h=In-Reply-To:Content-Type:MIME-Version :References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=RKrob1IKXllljtP901kTqdVePcgUxEq8tg19bjgaUgs=; b=kI9KMl33+XTB9FTJWvkl7e2up OQdGV+vn+Y+zXhyDbLGvvKnzIJ4a1KMOCvYbH5eIp0WIR4SCOclkvwiXa4QLpJXFL3xsVu17d8rtK wf6AuVOdtK5s6fgVGI20YAP9rqDYvq1gktqEjScLggvt6s3uqutIPHjxxpO7J6xOigC6YaqEEeFwZ f57uiqrNNujL8xta16rdbOHH69z0VJHj3E4KIUINdTKwKPZjo6e9jpyeKEVLQ6r4Y1mDaNVVPEd+t HpmNG1dVrQr5xUH+QGsAxxl8NGx/9GMRm8JhyUOrt4V36PLXYXk5nlSCBW886yO/1cuar+/NmVdPd V+NxBBMFw==; Received: from willy by bombadil.infradead.org with local (Exim 4.90_1 #2 (Red Hat Linux)) id 1gRhoy-0003Yg-4D; Tue, 27 Nov 2018 18:10:52 +0000 Date: Tue, 27 Nov 2018 10:10:51 -0800 From: Matthew Wilcox To: Mike Rapoport Cc: Hugh Dickins , Linus Torvalds , Andrew Morton , Baoquan He , Michal Hocko , 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: <20181127181051.GD10377@bombadil.infradead.org> References: <20181127105848.GD16502@rapoport-lnx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181127105848.GD16502@rapoport-lnx> User-Agent: Mutt/1.9.2 (2017-12-15) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Nov 27, 2018 at 12:58:48PM +0200, Mike Rapoport wrote: > > diff --git a/mm/filemap.c b/mm/filemap.c > > index 81adec8ee02c..575e16c037ca 100644 > > --- a/mm/filemap.c > > +++ b/mm/filemap.c > > @@ -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. > > + */ > > +}; > > Can we please make it: > > /** > * enum behavior - a choice of three behaviors for wait_on_page_bit_common() > */ The enum isn't used outside mm/filemap.c, so I'm not entirely sure that including kernel-doc for it is a good idea.