From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752690Ab2DRDXJ (ORCPT ); Tue, 17 Apr 2012 23:23:09 -0400 Received: from 50-56-35-84.static.cloud-ips.com ([50.56.35.84]:47546 "EHLO mail.hallyn.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751710Ab2DRDXI (ORCPT ); Tue, 17 Apr 2012 23:23:08 -0400 Date: Wed, 18 Apr 2012 03:24:04 +0000 From: "Serge E. Hallyn" To: Doug Ledford Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org, kosaki.motohiro@gmail.com, KOSAKI Motohiro , KOSAKI Motohiro , Amerigo Wang , "Serge E. Hallyn" , Jiri Slaby , Dave Hansen Subject: Re: [Patch 6/8] mqueue: don't use kmalloc with KMALLOC_MAX_SIZE Message-ID: <20120418032404.GC18830@mail.hallyn.com> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Quoting Doug Ledford (dledford@redhat.com): > From: KOSAKI Motohiro > > 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 > Acked-by: Doug Ledford > Acked-by: Joe Korty > Cc: Amerigo Wang > Cc: Serge E. Hallyn Looks reasonable to me, but that doesn't mean much. Cc:d Dave Hansen explicitly, he'd have a better idea. > Cc: Jiri Slaby > --- > ipc/mqueue.c | 4 ++-- > 1 files changed, 2 insertions(+), 2 deletions(-) > > diff --git a/ipc/mqueue.c b/ipc/mqueue.c > index 3ced596..f9f0782 100644 > --- a/ipc/mqueue.c > +++ b/ipc/mqueue.c > @@ -150,7 +150,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); > @@ -263,7 +263,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.7.6 > > -- > To unsubscribe from this list: send the line "unsubscribe linux-kernel" in > the body of a message to majordomo@vger.kernel.org > More majordomo info at http://vger.kernel.org/majordomo-info.html > Please read the FAQ at http://www.tux.org/lkml/