All of lore.kernel.org
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
To: Dennis Dalessandro
	<dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: Doug Ledford <dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org>,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Mel Gorman
	<mgorman-3eNAlZScCAx27rWaFMvyedHuzzzSOjJt@public.gmane.org>,
	Jiri Kosina <jikos-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>,
	Or Gerlitz <ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
Subject: Re: [PATCH rdma-next V1 1/4] IB/IPoIB: Convert IPoIB to memalloc_noio_* calls
Date: Mon, 29 May 2017 20:01:49 +0300	[thread overview]
Message-ID: <20170529170149.GD17751@mtr-leonro.local> (raw)
In-Reply-To: <6f8f8d7b-40ba-f0ec-77cd-3c5b20dead23-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>

[-- Attachment #1: Type: text/plain, Size: 2721 bytes --]

On Mon, May 29, 2017 at 12:44:46PM -0400, Dennis Dalessandro wrote:
> On 5/23/2017 7:38 AM, Leon Romanovsky wrote:
> > From: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> >
> > Commit 21caf2fc1931 ("mm: teach mm by current context info to not do I/O
> > during memory allocation") added the memalloc_noio_(save|restore) functions
> > to enable people to modify the MM behavior by disabling I/O during memory
> > allocation. This was further extended in Fixes: 934f3072c17c ("mm: clear
> > __GFP_FS when PF_MEMALLOC_NOIO is set"). memalloc_noio_* functions prevent
> > allocation paths recursing back into the filesystem without explicitly
> > changing the flags for every allocation site.
> >
> > However the IPoIB hasn't been keeping up with the changes and missed
> > completely these memalloc_noio_* calls. This led to update of
> > allocation site with special QP creation flag, see commit 09b93088d750
> > ("IB: Add a QP creation flag to use GFP_NOIO allocations"), while this
> > flag is supported by small number of drivers in IB stack.
> >
> > Let's change it by updating to memalloc_noio_* calls and allow
> > for every driver underneath enjoy NOIO allocations.
> >
> > Signed-off-by: Leon Romanovsky <leonro-VPRAkNaXOzVWk0Htik3J/w@public.gmane.org>
> > Signed-off-by: Leon Romanovsky <leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
>
> Reviewed-by: Dennis Dalessandro <dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> > @@ -1131,10 +1127,11 @@ static int ipoib_cm_tx_init(struct ipoib_cm_tx *p, u32 qpn,
> >   			    struct sa_path_rec *pathrec)
> >   {
> >   	struct ipoib_dev_priv *priv = ipoib_priv(p->dev);
> > +	unsigned int noio_flag;
>
> >   	int ret;
> > -	p->tx_ring = __vmalloc(ipoib_sendq_size * sizeof *p->tx_ring,
> > -			       GFP_NOIO, PAGE_KERNEL);
> > +	noio_flag = memalloc_noio_save();
>
> NIT: Maybe just call this "flags" since there could be other flags in
> current->flags when calling memalloc_noio_save()

I didn't want to be different from other callers :)
➜  linux-rdma git:(master) ✗ git grep memalloc_noio_save
drivers/base/power/runtime.c:           noio_flag = memalloc_noio_save();
drivers/md/dm-bufio.c:          noio_flag = memalloc_noio_save();
drivers/md/dm-ioctl.c:  noio_flag = memalloc_noio_save();
drivers/usb/core/hub.c: noio_flag = memalloc_noio_save();
fs/ocfs2/cluster/tcp.c: noio_flag = memalloc_noio_save();
fs/ocfs2/cluster/tcp.c: noio_flag = memalloc_noio_save();
include/linux/sched/mm.h:static inline unsigned int memalloc_noio_save(void)
net/ceph/crypto.c:      noio_flag = memalloc_noio_save();
net/ceph/messenger.c:   noio_flag = memalloc_noio_save();

>
> -Denny

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  parent reply	other threads:[~2017-05-29 17:01 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-23 11:38 [PATCH rdma-next V1 0/4] Add support of NOIO allocations to IPoIB Leon Romanovsky
     [not found] ` <20170523113816.32657-1-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-05-23 11:38   ` [PATCH rdma-next V1 1/4] IB/IPoIB: Convert IPoIB to memalloc_noio_* calls Leon Romanovsky
     [not found]     ` <20170523113816.32657-2-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-05-29 16:44       ` Dennis Dalessandro
     [not found]         ` <6f8f8d7b-40ba-f0ec-77cd-3c5b20dead23-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2017-05-29 17:01           ` Leon Romanovsky [this message]
2017-05-23 11:38   ` [PATCH rdma-next V1 2/4] IB/{rdmavt, qib, hfi1}: Remove gfp flags argument Leon Romanovsky
     [not found]     ` <20170523113816.32657-3-leon-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
2017-06-02 19:21       ` Dennis Dalessandro
2017-05-23 11:38   ` [PATCH rdma-next V1 3/4] {net, IB}/mlx4: " Leon Romanovsky
2017-05-23 11:38   ` [PATCH rdma-next V1 4/4] IB/core: Remove NOIO QP create flag Leon Romanovsky
2017-06-19 13:35   ` [PATCH rdma-next V1 0/4] Add support of NOIO allocations to IPoIB Leon Romanovsky
2017-07-22 17:08   ` Doug Ledford

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=20170529170149.GD17751@mtr-leonro.local \
    --to=leon-dgejt+ai2ygdnm+yrofe0a@public.gmane.org \
    --cc=dennis.dalessandro-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=dledford-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org \
    --cc=jikos-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=mgorman-3eNAlZScCAx27rWaFMvyedHuzzzSOjJt@public.gmane.org \
    --cc=ogerlitz-VPRAkNaXOzVWk0Htik3J/w@public.gmane.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.