LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: mhocko@suse.cz, akpm@linux-foundation.org
Cc: hannes@cmpxchg.org, david@fromorbit.com, mgorman@suse.de,
	riel@redhat.com, fengguang.wu@intel.com, linux-mm@kvack.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH 1/2] mm: Allow small allocations to fail
Date: Sun, 15 Mar 2015 14:43:37 +0900	[thread overview]
Message-ID: <201503151443.CFE04129.MVFOOStLFHFOQJ@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <1426107294-21551-2-git-send-email-mhocko@suse.cz>

Michal Hocko wrote:
> As this behavior is established for many years we cannot change it
> immediately. This patch instead exports a new sysctl/proc knob which
> tells allocator how much to retry. The higher the number the longer will
> the allocator loop and try to trigger OOM killer when the memory is too
> low. This implementation counts only those retries which involved OOM
> killer because we do not want to be too eager to fail the request.

I found that this patch conflicts with commit cc87317726f8 ("mm: page_alloc:
revert inadvertent !__GFP_FS retry behavior change") and thus counting retries
regardless of whether the OOM killer was involved, making !__GFP_FS allocation
to fail as eager as commit 9879de7373fc ("mm: page_alloc: embed OOM killing
naturally into allocation slowpath") did when sysctl_nr_alloc_retry == 1.

----------
XFS: possible memory allocation deadlock in xfs_buf_allocate_memory (mode:0x250)
XFS: possible memory allocation deadlock in xfs_buf_allocate_memory (mode:0x250)
warn_alloc_failed: 212565 callbacks suppressed
crond: page allocation failure: order:0, mode:0x2015a
rngd: page allocation failure: order:0, mode:0x2015a
CPU: 3 PID: 1667 Comm: rngd Not tainted 4.0.0-rc3+ #37
Hardware name: VMware, Inc. VMware Virtual Platform/440BX Desktop Reference Platform, BIOS 6.00 07/31/2013
 0000000000000000 00000000ce4cec53 0000000000000000 ffffffff815f30c4
 000000000002015a ffffffff8111063e ffff88007fffdb00 0000000000000000
 0000000000000040 ffff88007c223db0 0000000000000000 00000000ce4cec53
Call Trace:
 [<ffffffff815f30c4>] ? dump_stack+0x40/0x50
 [<ffffffff8111063e>] ? warn_alloc_failed+0xee/0x150
 [<ffffffff81113b03>] ? __alloc_pages_nodemask+0x623/0xa10
 [<ffffffff81150c57>] ? alloc_pages_current+0x87/0x100
 [<ffffffff8110d30d>] ? filemap_fault+0x1bd/0x400
 [<ffffffff812e3dbc>] ? radix_tree_next_chunk+0x5c/0x240
 [<ffffffff8112f85b>] ? __do_fault+0x4b/0xe0
 [<ffffffff81134465>] ? handle_mm_fault+0xc85/0x1640
 [<ffffffff81051c9a>] ? __do_page_fault+0x16a/0x430
 [<ffffffff81051f90>] ? do_page_fault+0x30/0x70
 [<ffffffff815fb03f>] ? error_exit+0x1f/0x60
 [<ffffffff815fae18>] ? page_fault+0x28/0x30
----------

If you want to count only those retries which involved OOM killer, you need
to do like

-			nr_retries++;
+			if (gfp_mask & __GFP_FS)
+				nr_retries++;

in this patch.

  parent reply	other threads:[~2015-03-15  5:43 UTC|newest]

Thread overview: 29+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-03-11 20:54 [PATCH 0/2] Move away from non-failing small allocations Michal Hocko
2015-03-11 20:54 ` [PATCH 1/2] mm: Allow small allocations to fail Michal Hocko
2015-03-12 12:54   ` Tetsuo Handa
2015-03-12 13:12     ` Michal Hocko
2015-03-15  5:43   ` Tetsuo Handa [this message]
2015-03-15 12:13     ` Michal Hocko
2015-03-15 13:06       ` Tetsuo Handa
2015-03-16  7:46         ` [PATCH 1/2 v2] " Michal Hocko
2015-03-16 21:11           ` Johannes Weiner
2015-03-17 10:25             ` Michal Hocko
2015-03-17 13:29               ` Johannes Weiner
2015-03-17 14:17                 ` Michal Hocko
2015-03-17 17:26                   ` Johannes Weiner
2015-03-17 19:41                     ` Michal Hocko
2015-03-18  9:10                       ` Vlastimil Babka
2015-03-18 12:04                         ` Michal Hocko
2015-03-18 12:36                         ` Tetsuo Handa
2015-03-18 11:35                       ` Tetsuo Handa
2015-03-17 11:13           ` Tetsuo Handa
2015-03-17 13:15             ` Michal Hocko
2015-03-18 11:33               ` Tetsuo Handa
2015-03-18 12:23                 ` Michal Hocko
2015-03-19 11:03                   ` Tetsuo Handa
2015-03-11 20:54 ` [PATCH 2/2] mmotm: Enable small allocation " Michal Hocko
2015-03-11 22:36 ` [PATCH 0/2] Move away from non-failing small allocations Sasha Levin
2015-03-16 22:38 ` Andrew Morton
2015-03-17  9:07   ` Michal Hocko
2015-03-17 14:06     ` Tetsuo Handa
2015-04-02 11:53       ` Tetsuo Handa

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=201503151443.CFE04129.MVFOOStLFHFOQJ@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=akpm@linux-foundation.org \
    --cc=david@fromorbit.com \
    --cc=fengguang.wu@intel.com \
    --cc=hannes@cmpxchg.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mgorman@suse.de \
    --cc=mhocko@suse.cz \
    --cc=riel@redhat.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 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).