From: Florian Weimer <fw-d32yF4oPJVt0XxTmqZlbVQ@public.gmane.org>
To: David Herrmann <dh.herrmann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
Cc: Andy Lutomirski <luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>,
Greg Kroah-Hartman
<gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>,
Arnd Bergmann <arnd-r2nGTMty4D4@public.gmane.org>,
"Eric W. Biederman"
<ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>,
One Thousand Gnomes
<gnomes-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org>,
Tom Gundersen <teg-B22kvLQNl6c@public.gmane.org>,
Jiri Kosina <jkosina-AlSwsSmVLrQ@public.gmane.org>,
Linux API <linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
"linux-kernel@vger.kernel.org"
<linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org>,
Daniel Mack <daniel-cYrQPVfZoowdnm+yROfE0A@public.gmane.org>,
Djalal Harouni <tixxdz-Umm1ozX2/EEdnm+yROfE0A@public.gmane.org>
Subject: Re: kdbus: add documentation
Date: Sun, 30 Nov 2014 18:22:31 +0100 [thread overview]
Message-ID: <87zjb8txgo.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <CANq1E4QJhbypbs1PueKdW7AmBPiiYEg1dN-fsAewDJap82feyg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> (David Herrmann's message of "Sun, 30 Nov 2014 18:12:39 +0100")
* David Herrmann:
> poll(2) and friends cannot return data for changed descriptors. I
> think a single trap for each KDBUS_CMD_MSG_RECV is acceptable. If this
> turns out to be a bottleneck, we can provide bulk-operations in the
> future. Anyway, I don't see how a _shared_ pool would change any of
> this?
I responded to Andy's messages because it seemed to be about
generalizing the pool functionality.
>> kernel could also queue the data for one specific recipient,
>> addressing the same issue that SO_REUSEPORT tries to solve (on poll
>> notification, the kernel does not know which recipient will eventually
>> retrieve the data, so it has to notify and wake up all of them).
>
> We already queue data only for the addressed recipients. We *do* know
> all recipients of a message at poll-notification time. We only wake up
> recipients that actually got a message queued.
Exactly, but poll on, say, UDP sockets, does not work this way. What
I'm trying to say is that this functionality is interesting for much
more than kdbus.
> Not sure how this is related to SO_REUSEPORT. Can you elaborate on
> your optimizations?
Without something like SO_REUSEPORT, it is a bad idea to have multiple
threads polling the same socket. The semantics are such that the
kernel has to wake *all* the waiting threads, and one of them will
eventually pick up the datagram with a separate system call. But the
kernel does not know which thread this will be.
With SO_REUSEPORT and a separately created socket for each polling
thread, the kernel will only signal one poll operation because it
assumes that any of the waiting threads will process the datagram, so
it's sufficient just to notify one of them.
kdbus behaves like the latter, but also saves the need to separately
obtain the datagram and related data from the kernel.
WARNING: multiple messages have this Message-ID (diff)
From: Florian Weimer <fw@deneb.enyo.de>
To: David Herrmann <dh.herrmann@gmail.com>
Cc: Andy Lutomirski <luto@amacapital.net>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Arnd Bergmann <arnd@arndb.de>,
"Eric W. Biederman" <ebiederm@xmission.com>,
One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>,
Tom Gundersen <teg@jklm.no>, Jiri Kosina <jkosina@suse.cz>,
Linux API <linux-api@vger.kernel.org>,
"linux-kernel\@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Daniel Mack <daniel@zonque.org>,
Djalal Harouni <tixxdz@opendz.org>
Subject: Re: kdbus: add documentation
Date: Sun, 30 Nov 2014 18:22:31 +0100 [thread overview]
Message-ID: <87zjb8txgo.fsf@mid.deneb.enyo.de> (raw)
In-Reply-To: <CANq1E4QJhbypbs1PueKdW7AmBPiiYEg1dN-fsAewDJap82feyg@mail.gmail.com> (David Herrmann's message of "Sun, 30 Nov 2014 18:12:39 +0100")
* David Herrmann:
> poll(2) and friends cannot return data for changed descriptors. I
> think a single trap for each KDBUS_CMD_MSG_RECV is acceptable. If this
> turns out to be a bottleneck, we can provide bulk-operations in the
> future. Anyway, I don't see how a _shared_ pool would change any of
> this?
I responded to Andy's messages because it seemed to be about
generalizing the pool functionality.
>> kernel could also queue the data for one specific recipient,
>> addressing the same issue that SO_REUSEPORT tries to solve (on poll
>> notification, the kernel does not know which recipient will eventually
>> retrieve the data, so it has to notify and wake up all of them).
>
> We already queue data only for the addressed recipients. We *do* know
> all recipients of a message at poll-notification time. We only wake up
> recipients that actually got a message queued.
Exactly, but poll on, say, UDP sockets, does not work this way. What
I'm trying to say is that this functionality is interesting for much
more than kdbus.
> Not sure how this is related to SO_REUSEPORT. Can you elaborate on
> your optimizations?
Without something like SO_REUSEPORT, it is a bad idea to have multiple
threads polling the same socket. The semantics are such that the
kernel has to wake *all* the waiting threads, and one of them will
eventually pick up the datagram with a separate system call. But the
kernel does not know which thread this will be.
With SO_REUSEPORT and a separately created socket for each polling
thread, the kernel will only signal one poll operation because it
assumes that any of the waiting threads will process the datagram, so
it's sufficient just to notify one of them.
kdbus behaves like the latter, but also saves the need to separately
obtain the datagram and related data from the kernel.
next prev parent reply other threads:[~2014-11-30 17:22 UTC|newest]
Thread overview: 75+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-11-21 5:02 [PATCH v2 00/13] Add kdbus implementation Greg Kroah-Hartman
2014-11-21 5:02 ` Greg Kroah-Hartman
2014-11-21 5:02 ` kdbus: add documentation Greg Kroah-Hartman
2014-11-21 8:29 ` Harald Hoyer
2014-11-30 8:56 ` Florian Weimer
[not found] ` <8761dxysl0.fsf-ZqZwdwZz9NfTBotR3TxKnbNAH6kLmebB@public.gmane.org>
2014-11-30 17:17 ` David Herrmann
2014-11-30 17:17 ` David Herrmann
[not found] ` <1416546149-24799-2-git-send-email-gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
2014-11-21 17:12 ` Andy Lutomirski
2014-11-21 17:12 ` Andy Lutomirski
2014-11-24 20:16 ` David Herrmann
2014-11-24 20:57 ` Andy Lutomirski
[not found] ` <CALCETrUfNG=YwwM2m78Ua4fUr9daE1omQwOSJQMKC6CTCa28fQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-26 11:55 ` David Herrmann
2014-11-26 11:55 ` David Herrmann
2014-11-26 15:30 ` Andy Lutomirski
[not found] ` <CALCETrV1vChd9m_AtFjPfddqvPK3z3cjROozWJ8HQHSGm5KWJQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-26 15:39 ` Andy Lutomirski
2014-11-26 15:39 ` Andy Lutomirski
2014-11-30 9:08 ` Florian Weimer
2014-11-30 9:08 ` Florian Weimer
2014-11-30 17:12 ` David Herrmann
[not found] ` <CANq1E4QJhbypbs1PueKdW7AmBPiiYEg1dN-fsAewDJap82feyg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-30 17:22 ` Florian Weimer [this message]
2014-11-30 17:22 ` Florian Weimer
2014-11-30 9:02 ` Florian Weimer
2014-11-30 9:02 ` Florian Weimer
[not found] ` <871tolysbb.fsf-ZqZwdwZz9NfTBotR3TxKnbNAH6kLmebB@public.gmane.org>
2014-11-30 17:15 ` David Herrmann
2014-11-30 17:15 ` David Herrmann
[not found] ` <CANq1E4RjwCVEVT7031CeiKrNvRFkLBZc4-X1uKdrdzpf=EwJ+A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-30 17:23 ` Florian Weimer
2014-11-30 17:23 ` Florian Weimer
[not found] ` <87vblwtxee.fsf-ZqZwdwZz9NfTBotR3TxKnbNAH6kLmebB@public.gmane.org>
2015-01-20 8:09 ` Michael Kerrisk (man-pages)
2015-01-20 8:09 ` Michael Kerrisk (man-pages)
[not found] ` <54BE0D56.5090301-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2015-01-20 8:25 ` Daniel Mack
2015-01-20 8:25 ` Daniel Mack
2015-01-20 12:54 ` Michael Kerrisk (man-pages)
2014-11-21 5:02 ` kdbus: add header file Greg Kroah-Hartman
2014-11-21 8:34 ` Harald Hoyer
2014-11-21 8:55 ` Daniel Mack
2014-11-21 5:02 ` kdbus: add driver skeleton, ioctl entry points and utility functions Greg Kroah-Hartman
2014-11-21 5:02 ` kdbus: add connection, queue handling and message validation code Greg Kroah-Hartman
2014-11-21 5:02 ` kdbus: add node and filesystem implementation Greg Kroah-Hartman
[not found] ` <1416546149-24799-7-git-send-email-gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
2014-11-21 15:55 ` Sasha Levin
2014-11-21 15:55 ` Sasha Levin
[not found] ` <546F606D.40407-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2014-11-21 16:13 ` David Herrmann
2014-11-21 16:13 ` David Herrmann
[not found] ` <CANq1E4QkXv9Ak6eT+NZPsy+5nTGKE8oypLvdr97cFcvmtigS_A-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-21 16:56 ` Greg Kroah-Hartman
2014-11-21 16:56 ` Greg Kroah-Hartman
[not found] ` <20141121165638.GA24866-U8xfFu+wG4EAvxtiuMwx3w@public.gmane.org>
2014-11-21 17:03 ` Sasha Levin
2014-11-21 17:03 ` Sasha Levin
[not found] ` <546F7077.4010200-QHcLZuEGTsvQT0dZR+AlfA@public.gmane.org>
2014-11-21 17:55 ` Greg Kroah-Hartman
2014-11-21 17:55 ` Greg Kroah-Hartman
2014-11-21 16:35 ` Andy Lutomirski
2014-11-21 16:41 ` Andy Lutomirski
[not found] ` <CALCETrW-RkhKa4n7X1HoPgmSuLV4V8YQ=FaSYVJ1YsHS=pJCSQ-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2014-11-21 16:53 ` David Herrmann
2014-11-21 16:53 ` David Herrmann
2014-11-21 5:02 ` kdbus: add code to gather metadata Greg Kroah-Hartman
[not found] ` <1416546149-24799-8-git-send-email-gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
2014-11-21 19:50 ` Andy Lutomirski
2014-11-21 19:50 ` Andy Lutomirski
[not found] ` <546F977B.7040500-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org>
2014-12-01 13:50 ` Daniel Mack
2014-12-01 13:50 ` Daniel Mack
2014-12-01 14:46 ` Andy Lutomirski
2014-11-21 5:02 ` kdbus: add code for notifications and matches Greg Kroah-Hartman
2014-11-21 5:02 ` kdbus: add code for buses, domains and endpoints Greg Kroah-Hartman
[not found] ` <1416546149-24799-10-git-send-email-gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
2014-11-21 8:14 ` Harald Hoyer
2014-11-21 8:14 ` Harald Hoyer
2014-11-21 8:39 ` Harald Hoyer
2014-11-21 5:02 ` kdbus: add name registry implementation Greg Kroah-Hartman
2014-11-21 5:02 ` kdbus: add policy database implementation Greg Kroah-Hartman
2014-11-21 5:02 ` kdbus: add Makefile, Kconfig and MAINTAINERS entry Greg Kroah-Hartman
2014-11-21 5:02 ` kdbus: add selftests Greg Kroah-Hartman
[not found] ` <1416546149-24799-1-git-send-email-gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org>
2014-11-21 5:02 ` kdbus: add connection pool implementation Greg Kroah-Hartman
2014-11-21 5:02 ` Greg Kroah-Hartman
2014-11-21 6:02 ` [PATCH v2 00/13] Add kdbus implementation Greg Kroah-Hartman
2014-11-21 6:02 ` Greg Kroah-Hartman
-- strict thread matches above, loose matches on Subject: below --
2014-10-29 22:00 [PATCH 00/12] " Greg Kroah-Hartman
2014-10-29 22:00 ` kdbus: add documentation Greg Kroah-Hartman
2014-10-30 12:20 ` Peter Meerwald
[not found] ` <alpine.DEB.2.02.1410301231040.32212-jW+XmwGofnusTnJN9+BGXg@public.gmane.org>
2014-11-02 1:29 ` Greg Kroah-Hartman
2014-11-02 1:29 ` Greg Kroah-Hartman
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=87zjb8txgo.fsf@mid.deneb.enyo.de \
--to=fw-d32yf4opjvt0xxtmqzlbvq@public.gmane.org \
--cc=arnd-r2nGTMty4D4@public.gmane.org \
--cc=daniel-cYrQPVfZoowdnm+yROfE0A@public.gmane.org \
--cc=dh.herrmann-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
--cc=ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org \
--cc=gnomes-qBU/x9rampVanCEyBjwyrvXRex20P6io@public.gmane.org \
--cc=gregkh-hQyY1W1yCW8ekmWlsbkhG0B+6BGkLq7r@public.gmane.org \
--cc=jkosina-AlSwsSmVLrQ@public.gmane.org \
--cc=linux-api-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=luto-kltTT9wpgjJwATOyAt5JVQ@public.gmane.org \
--cc=teg-B22kvLQNl6c@public.gmane.org \
--cc=tixxdz-Umm1ozX2/EEdnm+yROfE0A@public.gmane.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 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.