All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serge@hallyn.com>
To: Doug Ledford <dledford@redhat.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	kosaki.motohiro@gmail.com,
	KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>,
	KOSAKI Motohiro <mkosaki@jp.fujitsu.com>,
	Amerigo Wang <amwang@redhat.com>,
	"Serge E. Hallyn" <serge.hallyn@canonical.com>,
	Jiri Slaby <jslaby@suse.cz>, Dave Hansen <haveblue@us.ibm.com>
Subject: Re: [Patch 6/8] mqueue: don't use kmalloc with KMALLOC_MAX_SIZE
Date: Wed, 18 Apr 2012 03:24:04 +0000	[thread overview]
Message-ID: <20120418032404.GC18830@mail.hallyn.com> (raw)
In-Reply-To: <a4466082257558adf6654facc633630c14b65033.1334676645.git.dledford@redhat.com>

Quoting Doug Ledford (dledford@redhat.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>

Looks reasonable to me, but that doesn't mean much.  Cc:d Dave Hansen
explicitly, he'd have a better idea.

> 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 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/

  reply	other threads:[~2012-04-18  3:23 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-04-17 15:46 [Patch 0/8] Fix POSIX mqueue open issue Doug Ledford
2012-04-17 15:46 ` [Patch 1/8] ipc/mqueue: cleanup definition names and locations Doug Ledford
2012-04-17 17:03   ` KOSAKI Motohiro
2012-04-18  3:14   ` Serge E. Hallyn
2012-04-17 15:46 ` [Patch 2/8] ipc/mqueue: switch back to using non-max values on create Doug Ledford
2012-04-17 22:17   ` Andrew Morton
2012-04-17 22:32     ` KOSAKI Motohiro
2012-04-17 23:00       ` Andrew Morton
2012-04-18 14:22         ` Doug Ledford
2012-04-17 15:46 ` [Patch 3/8] ipc/mqueue: enforce hard limits Doug Ledford
2012-04-17 15:46 ` [Patch 4/8] ipc/mqueue: update maximums for the mqueue subsystem Doug Ledford
2012-04-17 15:46 ` [Patch 5/8] mqueue: revert bump up DFLT_*MAX Doug Ledford
2012-04-18  3:22   ` Serge E. Hallyn
2012-04-18  3:37     ` KOSAKI Motohiro
2012-04-18 14:25     ` Doug Ledford
2012-04-18 15:33       ` Serge E. Hallyn
2012-04-17 15:46 ` [Patch 6/8] mqueue: don't use kmalloc with KMALLOC_MAX_SIZE Doug Ledford
2012-04-18  3:24   ` Serge E. Hallyn [this message]
2012-04-17 15:46 ` [Patch 7/8] mqueue: separate mqueue default value from maximum value v2 Doug Ledford
2012-04-18  3:30   ` Serge E. Hallyn
2012-04-17 15:46 ` [Patch 8/8] selftests: add mq_open_tests Doug Ledford

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=20120418032404.GC18830@mail.hallyn.com \
    --to=serge@hallyn.com \
    --cc=akpm@linux-foundation.org \
    --cc=amwang@redhat.com \
    --cc=dledford@redhat.com \
    --cc=haveblue@us.ibm.com \
    --cc=jslaby@suse.cz \
    --cc=kosaki.motohiro@gmail.com \
    --cc=kosaki.motohiro@jp.fujitsu.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mkosaki@jp.fujitsu.com \
    --cc=serge.hallyn@canonical.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.