mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Oleg Nesterov <oleg@tv-sign.ru>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: David Howells <dhowells@redhat.com>, linux-kernel@vger.kernel.org
Subject: [PATCH] coredump: binfmt_elf{,_fdpic}.c: don't abuse GFP_ATOMIC
Date: Sun, 1 Jun 2008 20:55:06 +0400	[thread overview]
Message-ID: <20080601165506.GA8880@tv-sign.ru> (raw)

kmalloc(GFP_ATOMIC) was needed because it was called under tasklist_lock.
The code was changed to use rcu_read_lock(), we can use GFP_KERNEL.

Signed-off-by: Oleg Nesterov <oleg@tv-sign.ru>

 binfmt_elf.c       |    4 ++--
 binfmt_elf_fdpic.c |    2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

--- 26-rc2/fs/binfmt_elf.c~NO_ATOMIC	2008-05-18 15:43:59.000000000 +0400
+++ 26-rc2/fs/binfmt_elf.c	2008-06-01 20:47:08.000000000 +0400
@@ -1524,7 +1524,7 @@ static int fill_note_info(struct elfhdr 
 		if (p->mm == dump_task->mm) {
 			t = kzalloc(offsetof(struct elf_thread_core_info,
 					     notes[info->thread_notes]),
-				    GFP_ATOMIC);
+				    GFP_KERNEL);
 			if (unlikely(!t)) {
 				rcu_read_unlock();
 				return 0;
@@ -1726,7 +1726,7 @@ static int fill_note_info(struct elfhdr 
 		rcu_read_lock();
 		do_each_thread(g, p)
 			if (current->mm == p->mm && current != p) {
-				ets = kzalloc(sizeof(*ets), GFP_ATOMIC);
+				ets = kzalloc(sizeof(*ets), GFP_KERNEL);
 				if (!ets) {
 					rcu_read_unlock();
 					return 0;
--- 26-rc2/fs/binfmt_elf_fdpic.c~NO_ATOMIC	2008-05-18 15:43:59.000000000 +0400
+++ 26-rc2/fs/binfmt_elf_fdpic.c	2008-06-01 20:47:20.000000000 +0400
@@ -1626,7 +1626,7 @@ static int elf_fdpic_core_dump(long sign
 		rcu_read_lock();
 		do_each_thread(g,p)
 			if (current->mm == p->mm && current != p) {
-				tmp = kzalloc(sizeof(*tmp), GFP_ATOMIC);
+				tmp = kzalloc(sizeof(*tmp), GFP_KERNEL);
 				if (!tmp) {
 					rcu_read_unlock();
 					goto cleanup;


             reply	other threads:[~2008-06-01 16:53 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-06-01 16:55 Oleg Nesterov [this message]
2008-06-01 20:21 ` Peter Zijlstra
2008-06-01 20:08   ` Oleg Nesterov

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=20080601165506.GA8880@tv-sign.ru \
    --to=oleg@tv-sign.ru \
    --cc=akpm@linux-foundation.org \
    --cc=dhowells@redhat.com \
    --cc=linux-kernel@vger.kernel.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

all inboxes | Powered by JetHome®