From: kosaki.motohiro@gmail.com
To: linux-kernel@vger.kernel.org
Cc: akpm@linux-foundation.org,
KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
KOSAKI Motohiro <mkosaki@jp.fujitsu.com>,
Amerigo Wang <amwang@redhat.com>,
"Serge E. Hallyn" <serue@us.ibm.com>, Jiri Slaby <jslaby@suse.cz>,
Doug Ledford <dledford@redhat.com> (commit_signer:5/13=38%),
Joe Korty <joe.korty@ccur.com> (commit_signer:2/13=15%)
Subject: [resend][PATCH 2/3] mqueue: don't use kmalloc with KMALLOC_MAX_SIZE
Date: Fri, 9 Dec 2011 17:35:56 -0500 [thread overview]
Message-ID: <1323470163-8723-2-git-send-email-kosaki.motohiro@gmail.com> (raw)
In-Reply-To: <1323470163-8723-1-git-send-email-kosaki.motohiro@gmail.com>
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
KMALLOC_MAX_SIZE is no good threshold. It is extream high and
problematic. Unfortunately, some silly drivers depend on and
we can't change it. but any new code don't use such extream
ugly high order allocations. It bring us awful fragmentation
issue and system slowdown.
Signed-off-by: KOSAKI Motohiro <mkosaki@jp.fujitsu.com>
Acked-by: Doug Ledford <dledford@redhat.com>
Acked-by: Joe Korty <joe.korty@ccur.com>
Cc: Amerigo Wang <amwang@redhat.com>
Cc: Serge E. Hallyn <serue@us.ibm.com>
Cc: Jiri Slaby <jslaby@suse.cz>
---
ipc/mqueue.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/ipc/mqueue.c b/ipc/mqueue.c
index c246c83..315f84f 100644
--- a/ipc/mqueue.c
+++ b/ipc/mqueue.c
@@ -151,7 +151,7 @@ static struct inode *mqueue_get_inode(struct super_block *sb,
info->attr.mq_msgsize = attr->mq_msgsize;
}
mq_msg_tblsz = info->attr.mq_maxmsg * sizeof(struct msg_msg *);
- if (mq_msg_tblsz > KMALLOC_MAX_SIZE)
+ if (mq_msg_tblsz > PAGE_SIZE)
info->messages = vmalloc(mq_msg_tblsz);
else
info->messages = kmalloc(mq_msg_tblsz, GFP_KERNEL);
@@ -275,7 +275,7 @@ static void mqueue_evict_inode(struct inode *inode)
spin_lock(&info->lock);
for (i = 0; i < info->attr.mq_curmsgs; i++)
free_msg(info->messages[i]);
- if (info->attr.mq_maxmsg * sizeof(struct msg_msg *) > KMALLOC_MAX_SIZE)
+ if (is_vmalloc_addr(info->messages))
vfree(info->messages);
else
kfree(info->messages);
--
1.7.1
next prev parent reply other threads:[~2011-12-09 22:36 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-12-09 22:35 [resend][PATCH 1/3] mqueue: revert bump up DFLT_*MAX kosaki.motohiro
2011-12-09 22:35 ` kosaki.motohiro [this message]
2011-12-09 22:35 ` [resend][PATCH 3/3] mqueue: separate mqueue default value from maximum value kosaki.motohiro
2011-12-18 18:29 ` [resend][PATCH 1/3] mqueue: revert bump up DFLT_*MAX KOSAKI Motohiro
2011-12-18 18:29 ` KOSAKI Motohiro
2011-12-18 18:38 ` Andrew Morton
2012-03-14 21:28 ` Doug Ledford
2012-03-14 21:38 ` Andrew Morton
2012-03-14 21:45 ` Doug Ledford
2012-03-19 18:02 ` KOSAKI Motohiro
2012-03-19 18:16 ` Doug Ledford
2012-03-19 20:49 ` KOSAKI Motohiro
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=1323470163-8723-2-git-send-email-kosaki.motohiro@gmail.com \
--to=kosaki.motohiro@gmail.com \
--cc=akpm@linux-foundation.org \
--cc=amwang@redhat.com \
--cc=dledford@redhat.com \
--cc=joe.korty@ccur.com \
--cc=jslaby@suse.cz \
--cc=kosaki.motohiro@jp.fujitsu.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mkosaki@jp.fujitsu.com \
--cc=serue@us.ibm.com \
/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®