All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
To: Michal Hocko <mhocko@kernel.org>, "Theodore Ts'o" <tytso@mit.edu>
Cc: linux-fsdevel@vger.kernel.org, Jan Kara <jack@suse.cz>,
	linux-mm@kvack.org
Subject: Re: [RFC PATCH] mm: retry writepages() on ENOMEM when doing an data integrity writeback
Date: Thu, 16 Mar 2017 19:18:19 +0900	[thread overview]
Message-ID: <b48b3f89-9bd4-c78c-7238-c28bf9be5a70@I-love.SAKURA.ne.jp> (raw)
In-Reply-To: <20170315130305.GJ32620@dhcp22.suse.cz>

On 2017/03/15 22:03, Michal Hocko wrote:
> On Wed 15-03-17 01:07:43, Theodore Ts'o wrote:
>> Unfortunately, this can indeed cause livelocks, since inside the
>> writepages() call, the file system is holding various mutexes, and
>> these mutexes may prevent the OOM killer from killing its targetted
>> victim if it is also holding on to those mutexes.
> 
> The victim might be looping inside do_writepages now instead (especially
> when the memory reserves are depleted), though. On the other hand the
> recent OOM killer changes do not rely on the oom victim exiting anymore.

True only if CONFIG_MMU=y.

> We try to reap as much memory from its address space as possible
> which alone should help us to move on. Even if that is not sufficient we
> will move on to another victim. So unless everything is in this path and
> all the memory is sitting unreachable from the reapable address space we
> should be safe.

If the caller is doing sync() or umount() syscall, isn't it reasonable
to bail out if fatal_signal_pending() is true because it is caller's
responsibility to check whether sync() or umount() succeeded? Though,
I don't know whether writepages() can preserve data for later retry by
other callers.

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2017-03-16 10:18 UTC|newest]

Thread overview: 50+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-03-05 13:35 [PATCH 0/3] mm/fs: get PG_error out of the writeback reporting business Jeff Layton
2017-03-05 13:35 ` Jeff Layton
2017-03-05 13:35 ` [PATCH 1/3] nilfs2: set the mapping error when calling SetPageError on writeback Jeff Layton
2017-03-05 13:35   ` Jeff Layton
2017-03-07 13:46   ` Ryusuke Konishi
2017-03-07 13:46     ` Ryusuke Konishi
2017-03-05 13:35 ` [PATCH 2/3] mm: don't TestClearPageError in __filemap_fdatawait_range Jeff Layton
2017-03-05 13:35   ` Jeff Layton
2017-03-05 13:35 ` [PATCH 3/3] mm: set mapping error when launder_pages fails Jeff Layton
2017-03-05 13:35   ` Jeff Layton
2017-03-05 14:40 ` [PATCH 0/3] mm/fs: get PG_error out of the writeback reporting business Jeff Layton
2017-03-05 14:40   ` Jeff Layton
2017-03-06 23:08   ` Ross Zwisler
2017-03-06 23:08     ` Ross Zwisler
2017-03-07 10:26     ` Jan Kara
2017-03-07 10:26       ` Jan Kara
2017-03-07 14:03       ` Jeff Layton
2017-03-07 14:03         ` Jeff Layton
2017-03-07 14:03         ` Jeff Layton
2017-03-07 15:59       ` Ross Zwisler
2017-03-07 15:59         ` Ross Zwisler
2017-03-07 16:17         ` Jan Kara
2017-03-07 16:17           ` Jan Kara
2017-03-09  2:57       ` Theodore Ts'o
2017-03-09  2:57         ` Theodore Ts'o
2017-03-09  9:04         ` Jan Kara
2017-03-09  9:04           ` Jan Kara
2017-03-09 10:47           ` Jeff Layton
2017-03-09 10:47             ` Jeff Layton
2017-03-09 10:47             ` Jeff Layton
2017-03-09 11:02             ` Jan Kara
2017-03-09 11:02               ` Jan Kara
2017-03-09 12:43               ` Jeff Layton
2017-03-09 12:43                 ` Jeff Layton
2017-03-09 12:43                 ` Jeff Layton
2017-03-09 13:22                 ` Brian Foster
2017-03-09 13:22                   ` Brian Foster
2017-03-09 13:22                   ` Brian Foster
2017-03-09 14:21                 ` Theodore Ts'o
2017-03-09 14:21                   ` Theodore Ts'o
2017-03-15  5:07           ` [RFC PATCH] mm: retry writepages() on ENOMEM when doing an data integrity writeback Theodore Ts'o
2017-03-15 11:59             ` Jan Kara
2017-03-15 14:09               ` Theodore Ts'o
2017-03-15 14:09                 ` Theodore Ts'o
2017-03-15 13:03             ` Michal Hocko
2017-03-16 10:18               ` Tetsuo Handa [this message]
2017-03-06  3:06 ` [PATCH 0/3] mm/fs: get PG_error out of the writeback reporting business NeilBrown
2017-03-06 11:43   ` Jeff Layton
2017-03-06 11:43     ` Jeff Layton
2017-03-06 11:43     ` Jeff Layton

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=b48b3f89-9bd4-c78c-7238-c28bf9be5a70@I-love.SAKURA.ne.jp \
    --to=penguin-kernel@i-love.sakura.ne.jp \
    --cc=jack@suse.cz \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    --cc=mhocko@kernel.org \
    --cc=tytso@mit.edu \
    /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.