From: Andi Kleen <andi@firstfloor.org>
To: Alban Crequy <alban.crequy@collabora.co.uk>
Cc: "David S. Miller" <davem@davemloft.net>,
Eric Dumazet <eric.dumazet@gmail.com>,
Stephen Hemminger <shemminger@vyatta.com>,
Cyrill Gorcunov <gorcunov@openvz.org>,
Alexey Dobriyan <adobriyan@gmail.com>,
Lennart Poettering <lennart@poettering.net>,
Kay Sievers <kay.sievers@vrfy.org>,
Ian Molton <ian.molton@collabora.co.uk>,
netdev@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 4/9] AF_UNIX: find the recipients for multicast messages
Date: Mon, 22 Nov 2010 21:14:52 +0100 [thread overview]
Message-ID: <87hbf9uncz.fsf@basil.nowhere.org> (raw)
In-Reply-To: <1290450982-17480-4-git-send-email-alban.crequy@collabora.co.uk> (Alban Crequy's message of "Mon, 22 Nov 2010 18:36:17 +0000")
Alban Crequy <alban.crequy@collabora.co.uk> writes:
>+static DEFINE_SPINLOCK(unix_multicast_lock);
For DBUS it's probably ok, but I suspect for other usages
the global lock in the multipath fast path is going to hurt
sooner or later.
> +
> + /* Allocate for the set and hope the number of recipients does not
> + * change while the lock is released. If it changes, we have to try
> + * again... We allocate a bit more than needed, so if a _few_ members
> + * are added in a multicast group meanwhile, we don't always need to
> + * try again. */
> + recipient_cnt += 5;
> +
> + set = kmalloc(sizeof(struct sock_set)
> + + sizeof(struct sock_item) * recipient_cnt,
> + GFP_KERNEL);
FWIW for a large number of sockets this will likely run into
memory fragmentation issues. There are various workarounds like
fallback to vmalloc or use something like flex_arrays.
-Andi
--
ak@linux.intel.com -- Speaking for myself only.
next prev parent reply other threads:[~2010-11-22 20:14 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-11-22 18:34 [PATCH 0/9] RFC v2: Multicast and filtering features on AF_UNIX Alban Crequy
2010-11-22 18:36 ` [PATCH 1/9] AF_UNIX: Add constant for Unix socket options level Alban Crequy
2010-11-22 18:36 ` [PATCH 2/9] AF_UNIX: add setsockopt on Unix sockets Alban Crequy
2010-11-22 18:36 ` [PATCH 3/9] AF_UNIX: create, join and leave multicast groups with setsockopt Alban Crequy
2010-11-22 19:00 ` David Miller
2010-11-22 18:36 ` [PATCH 4/9] AF_UNIX: find the recipients for multicast messages Alban Crequy
2010-11-22 19:05 ` David Miller
2010-11-23 15:03 ` Alban Crequy
2010-11-23 16:08 ` Eric Dumazet
2010-11-23 16:56 ` Eric Dumazet
2010-11-23 17:47 ` Alban Crequy
2010-11-23 18:39 ` David Miller
2010-11-22 20:14 ` Andi Kleen [this message]
2010-11-22 18:36 ` [PATCH 5/9] AF_UNIX: Deliver message to several recipients in case of multicast Alban Crequy
2010-11-22 18:36 ` [PATCH 6/9] AF_UNIX: Apply Linux Socket Filtering to Unix sockets Alban Crequy
2010-11-22 18:36 ` [PATCH 7/9] AF_UNIX: Documentation on multicast Unix Sockets Alban Crequy
2010-11-22 19:07 ` Rémi Denis-Courmont
2010-11-22 20:09 ` Alban Crequy
2010-11-22 18:36 ` [PATCH 8/9] AF_UNIX: add options on multicast connected socket Alban Crequy
2010-11-22 18:36 ` [PATCH 9/9] AF_UNIX: implement poll(POLLOUT) for multicast sockets Alban Crequy
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=87hbf9uncz.fsf@basil.nowhere.org \
--to=andi@firstfloor.org \
--cc=adobriyan@gmail.com \
--cc=alban.crequy@collabora.co.uk \
--cc=davem@davemloft.net \
--cc=eric.dumazet@gmail.com \
--cc=gorcunov@openvz.org \
--cc=ian.molton@collabora.co.uk \
--cc=kay.sievers@vrfy.org \
--cc=lennart@poettering.net \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=shemminger@vyatta.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