mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: Davidlohr Bueso <davidlohr@hp.com>
Cc: m@silodev.com, stable@vger.kernel.org,
	linux-kernel@vger.kernel.org,
	Manfred Spraul <manfred@colorfullife.com>,
	dledford@redhat.com
Subject: Re: [PATCH] ipc,mqueue: remove limits for the amount of system-wide queues
Date: Tue, 11 Feb 2014 14:16:24 -0800	[thread overview]
Message-ID: <20140211141624.a24283a60496b445d8434e4f@linux-foundation.org> (raw)
In-Reply-To: <1391979963.1099.34.camel@buesod1.americas.hpqcorp.net>

On Sun, 09 Feb 2014 13:06:03 -0800 Davidlohr Bueso <davidlohr@hp.com> wrote:

> From: Davidlohr Bueso <davidlohr@hp.com>
> 
> Commit 93e6f119 (ipc/mqueue: cleanup definition names and locations) added
> global hardcoded limits to the amount of message queues that can be created.
> While these limits are per-namespace, reality is that it ends up breaking
> userspace applications. Historically users have, at least in theory, been able
> to create up to INT_MAX queues, and limiting it to just 1024 is way too low
> and dramatic for some workloads and use cases. For instance, Madars reports:
> 
> "This update imposes bad limits on our multi-process application. As our
> app uses approaches that each process opens its own set of queues (usually
> something about 3-5 queues per process). In some scenarios we might run up
> to 3000 processes or more (which of-course for linux is not a problem).
> Thus we might need up to 9000 queues or more. All processes run under one
> user."
> 
> Other affected users can be found in launchpad bug #1155695:
> https://bugs.launchpad.net/ubuntu/+source/manpages/+bug/1155695
> 
> Instead of increasing this limit, revert it entirely and fallback to the
> original way of dealing queue limits -- where once a user's resource limit
> is reached, and all memory is used, new queues cannot be created.
> 
> --- a/ipc/mq_sysctl.c
> +++ b/ipc/mq_sysctl.c
> @@ -22,6 +22,16 @@ static void *get_mq(ctl_table *table)
>  	return which;
>  }
>  
> +static int proc_mq_dointvec(ctl_table *table, int write,
> +			    void __user *buffer, size_t *lenp, loff_t *ppos)
> +{
> +	struct ctl_table mq_table;
> +	memcpy(&mq_table, table, sizeof(mq_table));
> +	mq_table.data = get_mq(table);
> +
> +	return proc_dointvec(&mq_table, write, buffer, lenp, ppos);
> +}
> +
>  static int proc_mq_dointvec_minmax(ctl_table *table, int write,
>  	void __user *buffer, size_t *lenp, loff_t *ppos)
>  {
>
> ...
>
> @@ -51,9 +59,7 @@ static ctl_table mq_sysctls[] = {
>  		.data		= &init_ipc_ns.mq_queues_max,
>  		.maxlen		= sizeof(int),
>  		.mode		= 0644,
> -		.proc_handler	= proc_mq_dointvec_minmax,
> -		.extra1		= &msg_queues_limit_min,
> -		.extra2		= &msg_queues_limit_max,
> +		.proc_handler	= proc_mq_dointvec,
>  	},

hm, afaict proc_mq_dointvec() isn't needed - proc_dointvec_minmax()
will do the right thing if ->extra1 and/or ->extra2 are NULL, so we can
still use proc_mq_dointvec_minmax().

Which has absolutely nothing at all to do with your patch, but makes me
think we could take a sharp instrument to the sysctl code...

      parent reply	other threads:[~2014-02-11 22:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-02-06 10:21 Max number of posix queues in vanilla kernel (/proc/sys/fs/mqueue/queues_max) m
2014-02-07 16:27 ` m
2014-02-07 20:11 ` Davidlohr Bueso
2014-02-07 21:24   ` Doug Ledford
2014-02-08 22:39     ` m
2014-02-09  4:17     ` Davidlohr Bueso
2014-02-09 16:12       ` Doug Ledford
2014-02-09 21:06   ` [PATCH] ipc,mqueue: remove limits for the amount of system-wide queues Davidlohr Bueso
2014-02-11 18:14     ` Doug Ledford
2014-02-11 22:16     ` Andrew Morton [this message]

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=20140211141624.a24283a60496b445d8434e4f@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=davidlohr@hp.com \
    --cc=dledford@redhat.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=m@silodev.com \
    --cc=manfred@colorfullife.com \
    --cc=stable@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

Powered by JetHome