Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1703763

Re: suspicious __GFP_NOMEMALLOC in selinux

From Michal Hocko <mhocko@kernel.org>
Newsgroups linux.kernel
Subject Re: suspicious __GFP_NOMEMALLOC in selinux
Date 2017-08-04 10:00 +0200
Message-ID <uaFGx-4bb-3@gated-at.bofh.it> (permalink)
References (3 earlier) <ualeQ-6Uy-37@gated-at.bofh.it> <ualHP-770-1@gated-at.bofh.it> <ualRx-7bw-29@gated-at.bofh.it> <uamaR-7y1-5@gated-at.bofh.it> <uasSZ-3Ii-1@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu 03-08-17 14:17:26, Paul Moore wrote:
> On Thu, Aug 3, 2017 at 7:05 AM, Michal Hocko <mhocko@kernel.org> wrote:
> > On Thu 03-08-17 19:44:46, Tetsuo Handa wrote:
[...]
> >> When allocating thread is selected as an OOM victim, it gets TIF_MEMDIE.
> >> Since that function might be called from !in_interrupt() context, it is
> >> possible that gfp_pfmemalloc_allowed() returns true due to TIF_MEMDIE and
> >> the OOM victim will dip into memory reserves even when allocation failure
> >> is not a problem.
> >
> > Yes this is possible but I do not see any major problem with that.
> > I wouldn't add __GFP_NOMEMALLOC unless there is a real runaway of some
> > sort that could be abused.
> 
> Adding __GFP_NOMEMALLOC would not hurt anything would it?

I is not harmfull but I fail to see how it would be useful either and as
such it just adds a pointless gfp flag and confusion to whoever tries to
modify the code in future. Really the main purpose of __GFP_NOMEMALLOC
is to override the process scope PF_MEMALLOC. As such it is quite a hack
and the fewer users we have the better.

Btw. Should I resend the patch or somebody will take it from this email
thread?
-- 
Michal Hocko
SUSE Labs

Back to linux.kernel | Previous | NextPrevious in thread | Next in thread | Find similar | Unroll thread


Thread

suspicious __GFP_NOMEMALLOC in selinux Michal Hocko <mhocko@kernel.org> - 2017-08-02 13:00 +0200
  Re: suspicious __GFP_NOMEMALLOC in selinux Paul Moore <pmoore@redhat.com> - 2017-08-02 23:50 +0200
    Re: suspicious __GFP_NOMEMALLOC in selinux Michal Hocko <mhocko@kernel.org> - 2017-08-03 10:20 +0200
      Re: suspicious __GFP_NOMEMALLOC in selinux Mel Gorman <mgorman@suse.de> - 2017-08-03 11:00 +0200
      Re: suspicious __GFP_NOMEMALLOC in selinux Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2017-08-03 12:10 +0200
        Re: suspicious __GFP_NOMEMALLOC in selinux Michal Hocko <mhocko@kernel.org> - 2017-08-03 12:40 +0200
          Re: suspicious __GFP_NOMEMALLOC in selinux Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2017-08-03 12:50 +0200
            Re: suspicious __GFP_NOMEMALLOC in selinux Michal Hocko <mhocko@kernel.org> - 2017-08-03 13:10 +0200
              Re: suspicious __GFP_NOMEMALLOC in selinux Paul Moore <paul@paul-moore.com> - 2017-08-03 20:20 +0200
                Re: suspicious __GFP_NOMEMALLOC in selinux Michal Hocko <mhocko@kernel.org> - 2017-08-04 10:00 +0200
                Re: suspicious __GFP_NOMEMALLOC in selinux Paul Moore <paul@paul-moore.com> - 2017-08-04 19:20 +0200
                Re: suspicious __GFP_NOMEMALLOC in selinux Michal Hocko <mhocko@kernel.org> - 2017-08-07 09:00 +0200
                Re: suspicious __GFP_NOMEMALLOC in selinux Paul Moore <paul@paul-moore.com> - 2017-08-08 15:40 +0200
                Re: suspicious __GFP_NOMEMALLOC in selinux Michal Hocko <mhocko@kernel.org> - 2017-08-10 09:10 +0200
                Re: suspicious __GFP_NOMEMALLOC in selinux Paul Moore <paul@paul-moore.com> - 2017-08-10 15:50 +0200

csiph-web