All of lore.kernel.org
 help / color / mirror / Atom feed
From: Michal Hocko <mhocko@kernel.org>
To: Qing Huang <qing.huang@oracle.com>
Cc: Eric Dumazet <eric.dumazet@gmail.com>,
	David Miller <davem@davemloft.net>,
	tariqt@mellanox.com, haakon.bugge@oracle.com,
	yanjun.zhu@oracle.com, netdev@vger.kernel.org,
	linux-rdma@vger.kernel.org, linux-kernel@vger.kernel.org,
	gi-oh.kim@profitbricks.com,
	"santosh.shilimkar@oracle.com" <santosh.shilimkar@oracle.com>,
	Vlastimil Babka <vbabka@suse.cz>
Subject: Re: [PATCH V4] mlx4_core: allocate ICM memory in page size chunks
Date: Mon, 4 Jun 2018 08:27:37 +0200	[thread overview]
Message-ID: <20180604062737.GA19202@dhcp22.suse.cz> (raw)
In-Reply-To: <f0bfa913-1837-6c5d-6e77-2a188fd094e1@oracle.com>

On Fri 01-06-18 15:05:26, Qing Huang wrote:
> 
> 
> On 6/1/2018 12:31 AM, Michal Hocko wrote:
> > On Thu 31-05-18 19:04:46, Qing Huang wrote:
> > > 
> > > On 5/31/2018 2:10 AM, Michal Hocko wrote:
> > > > On Thu 31-05-18 10:55:32, Michal Hocko wrote:
> > > > > On Thu 31-05-18 04:35:31, Eric Dumazet wrote:
> > > > [...]
> > > > > > I merely copied/pasted from alloc_skb_with_frags() :/
> > > > > I will have a look at it. Thanks!
> > > > OK, so this is an example of an incremental development ;).
> > > > 
> > > > __GFP_NORETRY was added by ed98df3361f0 ("net: use __GFP_NORETRY for
> > > > high order allocations") to prevent from OOM killer. Yet this was
> > > > not enough because fb05e7a89f50 ("net: don't wait for order-3 page
> > > > allocation") didn't want an excessive reclaim for non-costly orders
> > > > so it made it completely NOWAIT while it preserved __GFP_NORETRY in
> > > > place which is now redundant. Should I send a patch?
> > > > 
> > > Just curious, how about GFP_ATOMIC flag? Would it work in a similar fashion?
> > > We experimented
> > > with it a bit in the past but it seemed to cause other issue in our tests.
> > > :-)
> > GFP_ATOMIC is a non-sleeping (aka no reclaim) context with an access to
> > memory reserves. So the risk is that you deplete those reserves and
> > cause issues to other subsystems which need them as well.
> > 
> > > By the way, we didn't encounter any OOM killer events. It seemed that the
> > > mlx4_alloc_icm() triggered slowpath.
> > > We still had about 2GB free memory while it was highly fragmented.
> > The compaction was able to make a reasonable forward progress for you.
> > But considering mlx4_alloc_icm is called with GFP_KERNEL resp. GFP_HIGHUSER
> > then the OOM killer is clearly possible as long as the order is lower
> > than 4.
> 
> The allocation was 256KB so the order was much higher than 4. The compaction
> seemed to be the root
> cause for our problem. It took too long to finish its work while putting
> mlx4_alloc_icm to sleep in a heavily
> fragmented memory situation . Will NORETRY flag avoid the compaction ops and
> fail the 256KB allocation
> immediately so mlx4_alloc_icm can enter adjustable lower order allocation
> code path quickly?

Costly orders should only perform a light compaction attempt unless
__GFP_RETRY_MAY_FAIL is used IIRC. CCing Vlastimil. So __GFP_NORETRY
shouldn't make any difference.
-- 
Michal Hocko
SUSE Labs

  reply	other threads:[~2018-06-04  6:27 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-23 23:22 [PATCH V4] mlx4_core: allocate ICM memory in page size chunks Qing Huang
2018-05-24  7:23 ` Gi-Oh Kim
2018-05-24  9:45 ` Tariq Toukan
2018-05-25 14:23 ` David Miller
2018-05-30  3:34   ` Eric Dumazet
2018-05-30  3:44     ` Eric Dumazet
2018-05-30  3:49       ` Eric Dumazet
2018-05-30 17:39         ` Qing Huang
2018-05-31  6:54         ` Michal Hocko
2018-05-31  8:35           ` Eric Dumazet
2018-05-31  8:55             ` Michal Hocko
2018-05-31  9:10               ` Michal Hocko
2018-06-01  2:04                 ` Qing Huang
2018-06-01  7:31                   ` Michal Hocko
2018-06-01 22:05                     ` Qing Huang
2018-06-04  6:27                       ` Michal Hocko [this message]
2018-06-04 12:40                         ` Vlastimil Babka
2018-06-05 18:51                           ` Qing Huang
2018-06-04 13:11                 ` Michal Hocko
2018-06-04 13:22                   ` Eric Dumazet
2018-06-05  8:32                     ` Michal Hocko
2018-05-30 17:53     ` Qing Huang

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=20180604062737.GA19202@dhcp22.suse.cz \
    --to=mhocko@kernel.org \
    --cc=davem@davemloft.net \
    --cc=eric.dumazet@gmail.com \
    --cc=gi-oh.kim@profitbricks.com \
    --cc=haakon.bugge@oracle.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-rdma@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=qing.huang@oracle.com \
    --cc=santosh.shilimkar@oracle.com \
    --cc=tariqt@mellanox.com \
    --cc=vbabka@suse.cz \
    --cc=yanjun.zhu@oracle.com \
    /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.