Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp334752imu; Tue, 27 Nov 2018 13:10:21 -0800 (PST) X-Google-Smtp-Source: AFSGD/VbJPsQzrJO01ctGDCfNTkUFSNxz5YAujNwcr6bG5xgAuIHK5+pIB5pv7AlR3QoWUnzDDuS X-Received: by 2002:a17:902:b494:: with SMTP id y20mr32845920plr.178.1543353021358; Tue, 27 Nov 2018 13:10:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543353021; cv=none; d=google.com; s=arc-20160816; b=iUSkT/yZToyFi7uB4N3FdHzvL5CkmYON6ZuQtAgqS6l7I85ARn8C3v95JKPmk/eSw8 tnJiNdRkdHDF8Rd2iRZPOAuwONg4r/YIyhT0om0m/7PQBg14DFakfKDvfd+1iwkCyEM+ QtGJrz5v+ynCRQ5el6akn3RuC87gwlYhSdxaQhLWUJF4NECU6z8a2n/IjeFeN1m35IkG S2LlcdAbWgiOGUjESv5V/S86oL6fcb8LagJH5jeW2G67Mfg6vhXmbLyMFgBaL0wZGLU4 LlZrPtswIjNeyQbIhm+H0PUBwjuXR9cnWmNpCg6UsTkuLonoSYKEAF1Et7SGCKU2amOT F+Hw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date:dkim-signature; bh=1GHkoMMfRNkVBZTHiK4GuMAOAn4lMUU8z6RX9bBUWCc=; b=ASyYdSAMufsLcBlpVGrqxcKJNssnlaEUJ0hQV7kVWMgRZovO/lYKFsqVwP1SI5Pje7 HMhgRjieHeclbUuzDwJYHHlt2ccN7hn2nfAYxDIPof0uu1CMJSVBDT6OBNxI0nK0kllQ 6ymMAoCBISfgQPUy8VTtMpirl4vE72MW//OlCIXlBQkzCvFvwOTIO7ir0QvUre5GbDQi AsqlLjlGV6ifH6gm4ojZyTjiY/oUnldV1TIbROdt+UPhS92ztSovlO+Beh0QMTU03DXd kbZsY8Y6dqYg/yvJhaZVI7Fel5SE84KP1ciY83sERO6xPw6hxAdSOUNZU4pMr9jKegJa o0dQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b="Rwe8/YlI"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id g12si4595572pgd.567.2018.11.27.13.10.05; Tue, 27 Nov 2018 13:10:21 -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=@google.com header.s=20161025 header.b="Rwe8/YlI"; 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=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726622AbeK1IIQ (ORCPT + 99 others); Wed, 28 Nov 2018 03:08:16 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:36250 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726234AbeK1IIQ (ORCPT ); Wed, 28 Nov 2018 03:08:16 -0500 Received: by mail-pg1-f195.google.com with SMTP id n2so8430466pgm.3 for ; Tue, 27 Nov 2018 13:09:05 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:in-reply-to:message-id:references :user-agent:mime-version; bh=1GHkoMMfRNkVBZTHiK4GuMAOAn4lMUU8z6RX9bBUWCc=; b=Rwe8/YlIHozcBzSAGRPwqdt4qNcarycOyu8A0/X+bJ8y6mOMHcoD2irplDwzJID0Ri n/nVOsuD31igpwynT/myW/1kBIfW4GOqQBiW8c4nGXg1DzmRTpdwnV97llCBPdSpuaSb wqn0vfEkrHLUab69OhJA+StvSNX5GhalkDi1TC1EsLmt4fVEuFue19YsUYE0dk3U6tN+ RH/dHCzBI/RmZKsWV19XAHWM4PwfHfmDrZu5mCwM/lyh6iPH+iAOZF0B7TZ+VC3OK3Qu B8y2M7uGFjcmPQqSnXaJpaRdUVeJgGgw0pGSom+9LqA0sg9aDkGWKPx7y8nYfJF7y6I8 Sqcg== 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:in-reply-to:message-id :references:user-agent:mime-version; bh=1GHkoMMfRNkVBZTHiK4GuMAOAn4lMUU8z6RX9bBUWCc=; b=giaY36MXqS2NMLK37ePKWwd7+Gw8mwedzYDJwnOYRA+she+UlgumGRKZlvSxMdEP+Q OzCR8Y4bV5P02ta5/O0jj3B6tsiLo3cE+eiVKv4u4+3L4lqaMOWYPo/qn4LUiW0H7Eur /Gku9lUbnyMuD2dcmrH1jjgKCc9NkbbXNocKbihvyewMk799nI4iWVUIn5puF88CK/em dPX3H80thKrsF9etLqQi6duDHSnKmVqtHopuPDncXfmmxJmMYK7CdUnnoi9c0x6Maeoh 9zsrKzzZIxW2QL+lNMsPJpUIbO1BV6Zt1eXhvyE2USVmKUDFig4MdHhbwJ+4Zyn06dGe XIpg== X-Gm-Message-State: AA+aEWaEqW8OAuGZ4bC7uYwLW6iZmtoljdAfVvbnF/eHr7APAnGDf/Ux q9D0eGZv0B6doVGwZNBC77+d8Q== X-Received: by 2002:a63:104d:: with SMTP id 13mr30753655pgq.303.1543352944636; Tue, 27 Nov 2018 13:09:04 -0800 (PST) Received: from [100.112.89.103] ([104.133.8.103]) by smtp.gmail.com with ESMTPSA id g70sm10845279pfg.98.2018.11.27.13.09.02 (version=TLS1 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 27 Nov 2018 13:09:03 -0800 (PST) Date: Tue, 27 Nov 2018 13:08:50 -0800 (PST) From: Hugh Dickins X-X-Sender: hugh@eggly.anvils To: Mike Rapoport cc: Matthew Wilcox , 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 In-Reply-To: <20181127105848.GD16502@rapoport-lnx> Message-ID: References: <20181127105848.GD16502@rapoport-lnx> User-Agent: Alpine 2.11 (LSU 23 2013-08-11) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 27 Nov 2018, Mike Rapoport wrote: > On Mon, Nov 26, 2018 at 11:27:07AM -0800, Hugh Dickins wrote: > > > > +/* > > + * 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() > */ > enum behavior { > /** > * @EXCLUSIVE: Hold ref to page and take the bit when woken, > * like __lock_page() waiting on then setting %PG_locked. > */ > EXCLUSIVE, > /** > * @SHARED: Hold ref to page and check the bit when woken, > * like wait_on_page_writeback() waiting on %PG_writeback. > */ > SHARED, > /** > * @DROP: Drop ref to page before wait, no check when woken, > * like put_and_wait_on_page_locked() on %PG_locked. > */ > DROP, > }; I'm with Matthew, I'd prefer not: the first looks a more readable, less cluttered comment to me than the second: this is just an arg to an internal helper in mm/filemap.c, itself not kernel-doc'ed. But the comment is not there for me: if consensus is that the second is preferable, then sure, we can change it over. Hugh