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


Groups > linux.kernel > #1400131

Re: [PATCH v5] mm: Add memory allocation watchdog kernel thread.

From Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Newsgroups linux.kernel
Subject Re: [PATCH v5] mm: Add memory allocation watchdog kernel thread.
Date 2016-05-12 17:10 +0200
Message-ID <ry0pr-8tw-1@gated-at.bofh.it> (permalink)
References <rwQ8P-2SQ-27@gated-at.bofh.it> <rwQ8O-2SQ-25@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


Hillf Danton wrote:
> > +struct memalloc_info {
> > +	/*
> > +	 * 0: not doing __GFP_RECLAIM allocation.
> > +	 * 1: doing non-recursive __GFP_RECLAIM allocation.
> > +	 * 2: doing recursive __GFP_RECLAIM allocation.
> > +	 */
> > +	u8 valid;
> > +	/*
> > +	 * bit 0: Will be reported as OOM victim.
> > +	 * bit 1: Will be reported as dying task.
> > +	 * bit 2: Will be reported as stalling task.
> > +	 * bit 3: Will be reported as exiting task.
> > +	 * bit 7: Will be reported unconditionally.
> > +	 */
> > +	u8 type;
> > +	/* Index used for memalloc_in_flight[] counter. */
> > +	u8 idx;
> 
> 	u8 __pad;	is also needed perhaps.
> 

Since this structure is not marked as __packed, I think that
the compiler will automatically pad it.

> The numbers assigned to type may be replaced with texts, 
> for instance,
> 	MEMALLOC_TYPE_VICTIM 
> 	MEMALLOC_TYPE_DYING 
> 	MEMALLOC_TYPE_STALLING
> 	MEMALLOC_TYPE_EXITING
> 	MEMALLOC_TYPE_REPORT
> 

I can define them as bit shift numbers. Thanks.



Michal, this version eliminated overhead of walking the process list
when nothing is wrong. You are aware of the possibility of
debug_show_all_locks() failing to report the culprit, aren't you?
So, what are unacceptable major problems for you?

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


Thread

Re: [PATCH v5] mm: Add memory allocation watchdog kernel thread. "Hillf Danton" <hillf.zj@alibaba-inc.com> - 2016-05-09 12:00 +0200
  Re: [PATCH v5] mm: Add memory allocation watchdog kernel thread. Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp> - 2016-05-12 17:10 +0200
    Re: [PATCH v5] mm: Add memory allocation watchdog kernel thread. Michal Hocko <mhocko@kernel.org> - 2016-05-12 18:40 +0200

csiph-web