lkml.org 
[lkml]   [2018]   [Nov]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCHi v2] mm: put_and_wait_on_page_locked() while page is migrated
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

\
 
 \ /
  Last update: 2018-11-27 22:09    [W:0.138 / U:0.376 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site