[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20190108172945.GG31793@dhcp22.suse.cz>
Date: Tue, 8 Jan 2019 18:29:45 +0100
From: Michal Hocko <mhocko@...nel.org>
To: Guo Ren <guoren@...nel.org>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Guenter Roeck <linux@...ck-us.net>,
Linux List Kernel Mailing <linux-kernel@...r.kernel.org>
Subject: Re: Linux 5.0-rc1 (test results)
On Wed 09-01-19 00:16:59, Guo Ren wrote:
> Thx Michal,
>
> On Tue, Jan 08, 2019 at 04:40:31PM +0100, Michal Hocko wrote:
> > On Tue 08-01-19 17:51:07, Guo Ren wrote:
> > [...]
> > > static inline pte_t *pte_alloc_one_kernel(struct mm_struct *mm)
> > > {
> > > pte_t *pte;
> > > unsigned long i;
> > >
> > > pte = (pte_t *) __get_free_page(GFP_KERNEL | __GFP_RETRY_MAYFAIL);
> > > ^^^^^^^^^^^^^^^^^^^
> > > It's necessary ?
> > > x86 & arm don't use
> > > it.
> > > if (!pte)
> > > return NULL;
> >
> > That depends on whether you want OOM killer to be triggered for these
> > allocations. If you add the flag then the allocation bails out with a
> > failure rather than kill an oom victim.
>
> Yes, in page_alloc.c:
> if (gfp_mask & __GFP_RETRY_MAYFAIL)
> goto out;
> ...
> if (out_of_memory(&oc) || WARN_ON_ONCE(gfp_mask & __GFP_NOFAIL)) {
> ^^^^^^^^^^^^^ OOM kill victim
> ...
> if (gfp_mask & __GFP_NOFAIL)
> page = __alloc_pages_cpuset_fallback(gfp_mask, order,
> ALLOC_NO_WATERMARKS, ac);
> }
Btw. we have that nice documentation in gfp.h. I would encourage you to
read through that rather than try to imply the semantic from the
implementation.
> Seems it could affect the behavior of the system which is out of memory.
> OOM killer could help to get_page for current. So keep the same as x86 &
> arm here. I'll remove __GFP_RETRY_MAYFAIL in patch.
OK
--
Michal Hocko
SUSE Labs
Powered by blists - more mailing lists