linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: Chunyu Hu <chuhu@redhat.com>
To: Tetsuo Handa <penguin-kernel@i-love.sakura.ne.jp>
Cc: mhocko@suse.com, malat@debian.org, dvyukov@google.com,
	linux-mm@kvack.org, catalin marinas <catalin.marinas@arm.com>
Subject: Re: [PATCH] kmemleak: don't use __GFP_NOFAIL
Date: Wed, 30 May 2018 05:35:37 -0400 (EDT)	[thread overview]
Message-ID: <1730157334.5467848.1527672937617.JavaMail.zimbra@redhat.com> (raw)
In-Reply-To: <f3d58cbd-29ca-7a23-69e0-59690b9cd4fb@i-love.sakura.ne.jp>



----- Original Message -----
> From: "Tetsuo Handa" <penguin-kernel@i-love.sakura.ne.jp>
> To: "Chunyu Hu" <chuhu@redhat.com>
> Cc: mhocko@suse.com, malat@debian.org, dvyukov@google.com, linux-mm@kvack.org, "catalin marinas"
> <catalin.marinas@arm.com>
> Sent: Tuesday, May 29, 2018 9:46:59 PM
> Subject: Re: [PATCH] kmemleak: don't use __GFP_NOFAIL
> 
> On 2018/05/29 22:27, Chunyu Hu wrote:
> >>> I am not really familiar with the kmemleak code but the expectation that
> >>> you can make a forward progress in an unknown allocation context seems
> >>> broken to me. Why kmemleak cannot pre-allocate a pool of object_cache
> >>> and refill it from a reasonably strong contexts (e.g. in a sleepable
> >>> context)?
> >>
> >> Or, we can undo the original allocation if the kmemleak allocation failed?
> > 
> > If so, you are making kmemleak a fault injection trigger. But the original
> > purpose for adding GFP_NOFAIL[2] is just for making kmemleak avoid fault
> > injection.
> > (discussion in [1])
> 
> I don't think that applying fault injection to kmemleak allocations is bad
> (except that fault injection messages might be noisy).

Maybe we provide a way for user decide to apply fault inject to kmemleak or not 
is better, by adding another sys file in /sys/kernel/debug/failslab and the
fail_page_alloc.

> 
> > 
> > I'm trying with per task way for fault injection, and did some tries. In my
> > try, I removed this from NOFAIL kmemleak and kmemleak survived with the per
> > task fault injection helper (disable/enable of task). Maybe I can send
> > another
> > RFC for the api.
> 
> You could carry __GFP_NO_FAULT_INJECTION using per "struct task_struct" flag.

Thanks for this suggestion. 

I'm trying to reuse the make_it_fail field in task for fault injection. As adding
an extra memory alloc flag is not thought so good,  I think adding task flag
is either? 

> 
> But I think that undoing the original allocation if the kmemleak allocation
> failed
> has an advantage that it does not disable kmemleak when the system is under
> memory
> pressure (i.e. about to invoke the OOM killer); allowing us to test memory
> pressure
> conditions.

There should be benefit, this is redefining kmemleak's principle, currently it
won't affect other allocation directly, but if we free the other user's mem
alloc without thinking about the context seems also risk. 

> 
> 

-- 
Regards,
Chunyu Hu

  reply	other threads:[~2018-05-30  9:35 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-05-26  7:14 WARNING: CPU: 0 PID: 21 at ../mm/page_alloc.c:4258 __alloc_pages_nodemask+0xa88/0xfec Mathieu Malaterre
2018-05-28  8:34 ` Michal Hocko
2018-05-28 13:05   ` [PATCH] kmemleak: don't use __GFP_NOFAIL Tetsuo Handa
2018-05-28 13:24     ` Michal Hocko
2018-05-28 21:05       ` Tetsuo Handa
2018-05-29 13:27         ` Chunyu Hu
2018-05-29 13:46           ` Tetsuo Handa
2018-05-30  9:35             ` Chunyu Hu [this message]
2018-05-30 10:46               ` Michal Hocko
2018-05-30 11:42                 ` Chunyu Hu
2018-05-30 12:38                   ` Michal Hocko
2018-05-31 10:51                     ` Chunyu Hu
2018-05-31 11:35                       ` Michal Hocko
2018-05-31 12:28                         ` Chunyu Hu
2018-05-31 15:22                     ` Catalin Marinas
2018-05-31 18:41                       ` Michal Hocko
2018-06-01  1:50                         ` Chunyu Hu
2018-06-01  4:53                           ` Chunyu Hu
2018-06-04  8:41                             ` Dmitry Vyukov
2018-06-04 12:42                               ` Michal Hocko
2018-06-04 15:08                                 ` Catalin Marinas
2018-06-04 15:36                                   ` Dmitry Vyukov
2018-06-04 16:41                                     ` Catalin Marinas

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=1730157334.5467848.1527672937617.JavaMail.zimbra@redhat.com \
    --to=chuhu@redhat.com \
    --cc=catalin.marinas@arm.com \
    --cc=dvyukov@google.com \
    --cc=linux-mm@kvack.org \
    --cc=malat@debian.org \
    --cc=mhocko@suse.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    /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