linux-man.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Michael Kerrisk (man-pages)" <mtk.manpages@gmail.com>
To: Mike Christie <mchristi@redhat.com>
Cc: Linux API <linux-api@vger.kernel.org>,
	Michal Hocko <mhocko@kernel.org>,
	Dave Chinner <david@fromorbit.com>,
	masato.suzuki@wdc.com, damien.lemoal@wdc.com,
	"Darrick J. Wong" <darrick.wong@oracle.com>,
	bvanassche@acm.org, linux-man <linux-man@vger.kernel.org>
Subject: Re: [PATCH 1/1] prctl.2: doc PR_SET/GET_IO_FLUSHER
Date: Wed, 1 Apr 2020 11:47:01 +0200	[thread overview]
Message-ID: <CAKgNAkhGxmbD6Owkg6JFRbT18jXOr7D8_6L62oSTmE6WNWSDZQ@mail.gmail.com> (raw)
In-Reply-To: <20200214125440.GA1839@dhcp22.suse.cz>

Mike,

Do you have a refresh of this patch, in the light of the comments?

Thanks,

Michael

On Fri, 14 Feb 2020 at 13:54, Michal Hocko <mhocko@kernel.org> wrote:
>
> On Thu 13-02-20 12:23:36, Mike Christie wrote:
> > This patch documents the PR_SET_IO_FLUSHER and PR_GET_IO_FLUSHER
> > prctl commands added to the linux kernel for 5.6 in commit:
> >
> > commit 8d19f1c8e1937baf74e1962aae9f90fa3aeab463
> > Author: Mike Christie <mchristi@redhat.com>
> > Date:   Mon Nov 11 18:19:00 2019 -0600
> >
> >     prctl: PR_{G,S}ET_IO_FLUSHER to support controlling memory reclaim
> >
> > Signed-off-by: Mike Christie <mchristi@redhat.com>
> > Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
> > ---
> >
> > V3:
> > - Replace emulation device example.
> >
> > V2:
> > - My initial patch for this was very bad. This version is almost 100%
> > taken word for word from Dave Chinner's review comments.
> >
> > Signed-off-by: Mike Christie <mchristi@redhat.com>
> > ---
> >  man2/prctl.2 | 25 +++++++++++++++++++++++++
> >  1 file changed, 25 insertions(+)
> >
> > diff --git a/man2/prctl.2 b/man2/prctl.2
> > index 720ec04e4..58d77bf2e 100644
> > --- a/man2/prctl.2
> > +++ b/man2/prctl.2
> > @@ -1381,6 +1381,30 @@ system call on Tru64).
> >  for information on versions and architectures.)
> >  Return unaligned access control bits, in the location pointed to by
> >  .IR "(unsigned int\ *) arg2" .
> > +.TP
> > +.B PR_SET_IO_FLUSHER (Since Linux 5.6)
> > +An IO_FLUSHER is a user process that the kernel uses to issue IO
> > +that cleans dirty page cache data and/or filesystem metadata. The
> > +kernel may need to clean this memory when under memory pressure in
> > +order to free it. This means there is potential for a memory reclaim
> > +recursion deadlock if the user process attempts to allocate memory
> > +and the kernel then blocks waiting for it to clean memory before it
> > +can make reclaim progress.
> > +
> > +The kernel avoids these recursion problems internally via a special
> > +process state that prevents recursive reclaim from issuing new IO.
>
> I would refrain from describing the internal implementation. The
> important part is that this flag tells the kernel that IO_FLUSHER
> process gets a special treatment to workaround the deadlock.
>
> So anytime a process is involved in the IO path and the kernel cannot
> make a forward progress without it then the flag should be set.
>
> --
> Michal Hocko
> SUSE Labs



-- 
Michael Kerrisk
Linux man-pages maintainer; http://www.kernel.org/doc/man-pages/
Linux/UNIX System Programming Training: http://man7.org/training/

  reply	other threads:[~2020-04-01  9:47 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-13 18:23 [PATCH 1/1] prctl.2: doc PR_SET/GET_IO_FLUSHER Mike Christie
2020-02-13 20:08 ` Darrick J. Wong
2020-02-13 20:14   ` Mike Christie
2020-02-14 12:54 ` Michal Hocko
2020-04-01  9:47   ` Michael Kerrisk (man-pages) [this message]
  -- strict thread matches above, loose matches on Subject: below --
2020-04-02  2:07 Mike Christie
2020-04-02  2:08 ` Mike Christie
     [not found] <20200210221557.8021-1-mchristi@redhat.com>
2020-02-11 14:17 ` Christian Brauner

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=CAKgNAkhGxmbD6Owkg6JFRbT18jXOr7D8_6L62oSTmE6WNWSDZQ@mail.gmail.com \
    --to=mtk.manpages@gmail.com \
    --cc=bvanassche@acm.org \
    --cc=damien.lemoal@wdc.com \
    --cc=darrick.wong@oracle.com \
    --cc=david@fromorbit.com \
    --cc=linux-api@vger.kernel.org \
    --cc=linux-man@vger.kernel.org \
    --cc=masato.suzuki@wdc.com \
    --cc=mchristi@redhat.com \
    --cc=mhocko@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).