From: "Michal Nazarewicz" <mina86@mina86.com>
To: Dave Jones <davej@redhat.com>, Joe Perches <joe@perches.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:18:12 +0100 [thread overview]
Message-ID: <op.watsgmo13l0zgt@mpn-glaptop> (raw)
In-Reply-To: <1331165061.20565.19.camel@joe2Laptop>
On Thu, 08 Mar 2012 01:04:21 +0100, Joe Perches <joe@perches.com> wrote:
> On Wed, 2012-03-07 at 18:39 -0500, Dave Jones wrote:
>> +static void decode_gfp_mask(gfp_t gfp_mask, char *out_string)
>> +{
>> + unsigned int i;
>> +
>> + for (i = 0; i < 32; i++) {
>
> < sizeof(gfp_t * 8)
>
>> + if (gfp_mask & (1 << i)) {
>
> (gfp_t)1 << i
>
>> + if (gfp_flag_texts[i])
>> + out_string += sprintf(out_string, "%s ", gfp_flag_texts[i]);
>> + else
>> + out_string += sprintf(out_string, "reserved! ");
>
> not much use to exclamation points.
>
>> + }
>> + }
>> + out_string = "\0";
>
> out_string[-1] = 0;
Will break if gfp_mask == 0.
>> +}
>> +
--
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>
next prev parent reply other threads:[~2012-03-08 0:18 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
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 [this message]
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.watsgmo13l0zgt@mpn-glaptop \
--to=mina86@mina86.com \
--cc=davej@redhat.com \
--cc=joe@perches.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