linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
From: "Michal Nazarewicz" <mina86@mina86.com>
To: Dave Jones <davej@redhat.com>
Cc: Linux Kernel <linux-kernel@vger.kernel.org>, linux-mm@kvack.org
Subject: Re: decode GFP flags in oom killer output.
Date: Thu, 08 Mar 2012 01:08:38 +0100	[thread overview]
Message-ID: <op.watr0ors3l0zgt@mpn-glaptop> (raw)
In-Reply-To: <20120308000233.GA10695@redhat.com>

On Thu, 08 Mar 2012 01:02:33 +0100, Dave Jones <davej@redhat.com> wrote:

> On Thu, Mar 08, 2012 at 12:48:08AM +0100, Michal Nazarewicz wrote:
> > >  static void dump_header(struct task_struct *p, gfp_t gfp_mask, int order,
> > >  			struct mem_cgroup *memcg, const nodemask_t *nodemask)
> > >  {
> > > +	char gfp_string[80];
> >
> > For ~0, the string will be 256 characters followed by a NUL byte byte at the end.
> > This combination may make no sense, but the point is that you need to take length
> > of the buffer into account, probably by using snprintf() and a counter.
>
> alternatively, we could just use a bigger buffer here.

Allocating 257 bytes on stack does not seem like a good idea especially inside of
OOM killer, where probably quite a bit of the stack was already consumed prior to
reaching this function.

-- 
Best regards,                                         _     _
.o. | Liege of Serenely Enlightened Majesty of      o' \,=./ `o
..o | Computer Science,  Michał “mina86” Nazarewicz    (o o)
ooo +----<email/xmpp: mpn@google.com>--------------ooO--(_)--Ooo--

--
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/ .
Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>

  reply	other threads:[~2012-03-08  0:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-07 23:39 Dave Jones
2012-03-07 23:48 ` Michal Nazarewicz
2012-03-08  0:02   ` Dave Jones
2012-03-08  0:08     ` Michal Nazarewicz [this message]
2012-03-07 23:50 ` Jesper Juhl
2012-03-07 23:53 ` David Rientjes
2012-03-08  0:04 ` Joe Perches
2012-03-08  0:18   ` Michal Nazarewicz
2012-03-08 16:24 ` Mel Gorman

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=op.watr0ors3l0zgt@mpn-glaptop \
    --to=mina86@mina86.com \
    --cc=davej@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mm@kvack.org \
    /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