linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
To: Evgeniy Polyakov <johnpol@2ka.mipt.ru>
Cc: David Miller <davem@davemloft.net>,
	Ulrich Drepper <drepper@redhat.com>,
	Andrew Morton <akpm@osdl.org>,
	Evgeniy Polyakov <johnpol@2ka.mipt.ru>,
	netdev <netdev@vger.kernel.org>,
	Zach Brown <zach.brown@oracle.com>,
	Christoph Hellwig <hch@infradead.org>,
	Chase Venters <chase.venters@clientec.com>,
	Johann Borck <johann.borck@densedata.com>,
	linux-kernel@vger.kernel.org
Subject: [take21 0/4] kevent: Generic event handling mechanism.
Date: Fri, 27 Oct 2006 20:10:01 +0400	[thread overview]
Message-ID: <11619654014077@2ka.mipt.ru> (raw)
In-Reply-To: <1154985aa0591036@2ka.mipt.ru>


Generic event handling mechanism.

Consider for inclusion.

Changes from 'take20' patchset:
 * new ring buffer implementation
 * removed artificial limit on possible number of kevents
With this release and fixed userspace web server it was possible to 
achive 3960+ req/s with client connection rate of 4000 con/s
over 100 Mbit lan, data IO over network was about 10582.7 KB/s, which
is too close to wire speed if we get into account headers and the like.

Changes from 'take19' patchset:
 * use __init instead of __devinit
 * removed 'default N' from config for user statistic
 * removed kevent_user_fini() since kevent can not be unloaded
 * use KERN_INFO for statistic output

Changes from 'take18' patchset:
 * use __init instead of __devinit
 * removed 'default N' from config for user statistic
 * removed kevent_user_fini() since kevent can not be unloaded
 * use KERN_INFO for statistic output

Changes from 'take17' patchset:
 * Use RB tree instead of hash table. 
	At least for a web sever, frequency of addition/deletion of new kevent 
	is comparable with number of search access, i.e. most of the time events 
	are added, accesed only couple of times and then removed, so it justifies 
	RB tree usage over AVL tree, since the latter does have much slower deletion 
	time (max O(log(N)) compared to 3 ops), 
	although faster search time (1.44*O(log(N)) vs. 2*O(log(N))). 
	So for kevents I use RB tree for now and later, when my AVL tree implementation 
	is ready, it will be possible to compare them.
 * Changed readiness check for socket notifications.

With both above changes it is possible to achieve more than 3380 req/second compared to 2200, 
sometimes 2500 req/second for epoll() for trivial web-server and httperf client on the same
hardware.
It is possible that above kevent limit is due to maximum allowed kevents in a time limit, which is
4096 events.

Changes from 'take16' patchset:
 * misc cleanups (__read_mostly, const ...)
 * created special macro which is used for mmap size (number of pages) calculation
 * export kevent_socket_notify(), since it is used in network protocols which can be 
	built as modules (IPv6 for example)

Changes from 'take15' patchset:
 * converted kevent_timer to high-resolution timers, this forces timer API update at
	http://linux-net.osdl.org/index.php/Kevent
 * use struct ukevent* instead of void * in syscalls (documentation has been updated)
 * added warning in kevent_add_ukevent() if ring has broken index (for testing)

Changes from 'take14' patchset:
 * added kevent_wait()
    This syscall waits until either timeout expires or at least one event
    becomes ready. It also commits that @num events from @start are processed
    by userspace and thus can be be removed or rearmed (depending on it's flags).
    It can be used for commit events read by userspace through mmap interface.
    Example userspace code (evtest.c) can be found on project's homepage.
 * added socket notifications (send/recv/accept)

Changes from 'take13' patchset:
 * do not get lock aroung user data check in __kevent_search()
 * fail early if there were no registered callbacks for given type of kevent
 * trailing whitespace cleanup

Changes from 'take12' patchset:
 * remove non-chardev interface for initialization
 * use pointer to kevent_mring instead of unsigned longs
 * use aligned 64bit type in raw user data (can be used by high-res timer if needed)
 * simplified enqueue/dequeue callbacks and kevent initialization
 * use nanoseconds for timeout
 * put number of milliseconds into timer's return data
 * move some definitions into user-visible header
 * removed filenames from comments

Changes from 'take11' patchset:
 * include missing headers into patchset
 * some trivial code cleanups (use goto instead of if/else games and so on)
 * some whitespace cleanups
 * check for ready_callback() callback before main loop which should save us some ticks

Changes from 'take10' patchset:
 * removed non-existent prototypes
 * added helper function for kevent_registered_callbacks
 * fixed 80 lines comments issues
 * added shared between userspace and kernelspace header instead of embedd them in one
 * core restructuring to remove forward declarations
 * s o m e w h i t e s p a c e c o d y n g s t y l e c l e a n u p
 * use vm_insert_page() instead of remap_pfn_range()

Changes from 'take9' patchset:
 * fixed ->nopage method

Changes from 'take8' patchset:
 * fixed mmap release bug
 * use module_init() instead of late_initcall()
 * use better structures for timer notifications

Changes from 'take7' patchset:
 * new mmap interface (not tested, waiting for other changes to be acked)
	- use nopage() method to dynamically substitue pages
	- allocate new page for events only when new added kevent requres it
	- do not use ugly index dereferencing, use structure instead
	- reduced amount of data in the ring (id and flags), 
		maximum 12 pages on x86 per kevent fd

Changes from 'take6' patchset:
 * a lot of comments!
 * do not use list poisoning for detection of the fact, that entry is in the list
 * return number of ready kevents even if copy*user() fails
 * strict check for number of kevents in syscall
 * use ARRAY_SIZE for array size calculation
 * changed superblock magic number
 * use SLAB_PANIC instead of direct panic() call
 * changed -E* return values
 * a lot of small cleanups and indent fixes

Changes from 'take5' patchset:
 * removed compilation warnings about unused wariables when lockdep is not turned on
 * do not use internal socket structures, use appropriate (exported) wrappers instead
 * removed default 1 second timeout
 * removed AIO stuff from patchset

Changes from 'take4' patchset:
 * use miscdevice instead of chardevice
 * comments fixes

Changes from 'take3' patchset:
 * removed serializing mutex from kevent_user_wait()
 * moved storage list processing to RCU
 * removed lockdep screaming - all storage locks are initialized in the same function, so it was
learned 
	to differentiate between various cases
 * remove kevent from storage if is marked as broken after callback
 * fixed a typo in mmaped buffer implementation which would end up in wrong index calcualtion 

Changes from 'take2' patchset:
 * split kevent_finish_user() to locked and unlocked variants
 * do not use KEVENT_STAT ifdefs, use inline functions instead
 * use array of callbacks of each type instead of each kevent callback initialization
 * changed name of ukevent guarding lock
 * use only one kevent lock in kevent_user for all hash buckets instead of per-bucket locks
 * do not use kevent_user_ctl structure instead provide needed arguments as syscall parameters
 * various indent cleanups
 * added optimisation, which is aimed to help when a lot of kevents are being copied from
userspace
 * mapped buffer (initial) implementation (no userspace yet)

Changes from 'take1' patchset:
 - rebased against 2.6.18-git tree
 - removed ioctl controlling
 - added new syscall kevent_get_events(int fd, unsigned int min_nr, unsigned int max_nr,
			unsigned int timeout, void __user *buf, unsigned flags)
 - use old syscall kevent_ctl for creation/removing, modification and initial kevent 
	initialization
 - use mutuxes instead of semaphores
 - added file descriptor check and return error if provided descriptor does not match
	kevent file operations
 - various indent fixes
 - removed aio_sendfile() declarations.

Thank you.

Signed-off-by: Evgeniy Polyakov <johnpol@2ka.mipt.ru>



       reply	other threads:[~2006-10-27 16:11 UTC|newest]

Thread overview: 214+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <1154985aa0591036@2ka.mipt.ru>
2006-10-27 16:10 ` Evgeniy Polyakov [this message]
2006-10-27 16:10   ` [take21 1/4] kevent: Core files Evgeniy Polyakov
2006-10-27 16:10     ` [take21 2/4] kevent: poll/select() notifications Evgeniy Polyakov
2006-10-27 16:10       ` [take21 3/4] kevent: Socket notifications Evgeniy Polyakov
2006-10-27 16:10         ` [take21 4/4] kevent: Timer notifications Evgeniy Polyakov
2006-10-28 10:04       ` [take21 2/4] kevent: poll/select() notifications Eric Dumazet
2006-10-28 10:08         ` Evgeniy Polyakov
2006-10-28 10:28     ` [take21 1/4] kevent: Core files Eric Dumazet
2006-10-28 10:53       ` Evgeniy Polyakov
2006-10-28 12:36         ` Eric Dumazet
2006-10-28 13:03           ` Evgeniy Polyakov
2006-10-28 13:23             ` Eric Dumazet
2006-10-28 13:28               ` Evgeniy Polyakov
2006-10-28 13:34                 ` Eric Dumazet
2006-10-28 13:47                   ` Evgeniy Polyakov
2006-10-27 16:42   ` [take21 0/4] kevent: Generic event handling mechanism Evgeniy Polyakov
2006-11-07 11:26   ` Jeff Garzik
2006-11-07 11:46     ` Jeff Garzik
2006-11-07 11:58       ` Evgeniy Polyakov
2006-11-07 11:51     ` Evgeniy Polyakov
2006-11-07 12:17       ` Jeff Garzik
2006-11-07 12:29         ` Evgeniy Polyakov
2006-11-07 12:32       ` Jeff Garzik
2006-11-07 19:34         ` Andrew Morton
2006-11-07 20:52           ` David Miller
2006-11-07 21:38             ` Andrew Morton
2006-11-01 11:36 ` [take22 " Evgeniy Polyakov
2006-11-01 11:36   ` [take22 1/4] kevent: Core files Evgeniy Polyakov
2006-11-01 11:36     ` [take22 2/4] kevent: poll/select() notifications Evgeniy Polyakov
2006-11-01 11:36       ` [take22 3/4] kevent: Socket notifications Evgeniy Polyakov
2006-11-01 11:36         ` [take22 4/4] kevent: Timer notifications Evgeniy Polyakov
2006-11-01 13:06   ` [take22 0/4] kevent: Generic event handling mechanism Pavel Machek
2006-11-01 13:25     ` Evgeniy Polyakov
2006-11-01 16:05       ` Pavel Machek
2006-11-01 16:24         ` Evgeniy Polyakov
2006-11-01 18:13           ` Oleg Verych
2006-11-01 18:57             ` Evgeniy Polyakov
2006-11-02  2:12               ` Nate Diller
     [not found]                 ` <aaf959cb0611011829k36deda6ahe61bcb9bf8e612e1@mail.gmail.com>
2006-11-02  2:30                   ` zhou drangon
2006-11-02  7:46                     ` Eric Dumazet
2006-11-02  8:01                       ` Evgeniy Polyakov
2006-11-02  8:18                         ` Eric Dumazet
2006-11-02  8:46                           ` Evgeniy Polyakov
2006-11-02 11:33                             ` Eric Dumazet
2006-11-06 21:17                         ` Eric Dumazet
2006-11-07  8:32                           ` Evgeniy Polyakov
2006-11-07  9:18                           ` Evgeniy Polyakov
2006-11-07 12:09                             ` Evgeniy Polyakov
2006-11-09  7:48                               ` Evgeniy Polyakov
2006-11-03  2:42                       ` zhou drangon
2006-11-03  9:16                         ` Evgeniy Polyakov
2006-11-02  6:21                 ` Evgeniy Polyakov
2006-11-02 19:40                   ` Nate Diller
2006-11-03  8:42                     ` Evgeniy Polyakov
2006-11-03  8:57                       ` Pavel Machek
2006-11-03  9:04                         ` David Miller
2006-11-07 12:05                           ` Jeff Garzik
2006-11-03  9:13                         ` Evgeniy Polyakov
2006-11-05 11:19                           ` Pavel Machek
2006-11-05 11:43                             ` Evgeniy Polyakov
2006-11-07 12:02                 ` Jeff Garzik
2006-11-03 18:49               ` Oleg Verych
2006-11-04 10:24                 ` Evgeniy Polyakov
2006-11-04 17:47                 ` Evgeniy Polyakov
2006-11-01 16:07     ` James Morris
2006-11-07 16:50 ` [take23 0/5] " Evgeniy Polyakov
2006-11-07 16:50   ` [take23 1/5] kevent: Description Evgeniy Polyakov
2006-11-07 16:50     ` [take23 2/5] kevent: Core files Evgeniy Polyakov
2006-11-07 16:50       ` [take23 3/5] kevent: poll/select() notifications Evgeniy Polyakov
2006-11-07 16:50         ` [take23 4/5] kevent: Socket notifications Evgeniy Polyakov
2006-11-07 16:50           ` [take23 5/5] kevent: Timer notifications Evgeniy Polyakov
2006-11-07 22:53         ` [take23 3/5] kevent: poll/select() notifications Davide Libenzi
2006-11-08  8:45           ` Evgeniy Polyakov
2006-11-08 17:03             ` Evgeniy Polyakov
2006-11-07 22:16       ` [take23 2/5] kevent: Core files Andrew Morton
2006-11-08  8:24         ` Evgeniy Polyakov
2006-11-07 22:16     ` [take23 1/5] kevent: Description Andrew Morton
2006-11-08  8:23       ` Evgeniy Polyakov
2006-11-07 22:17   ` [take23 0/5] kevent: Generic event handling mechanism Andrew Morton
2006-11-08  8:21     ` Evgeniy Polyakov
2006-11-08 14:51       ` Eric Dumazet
2006-11-08 22:03         ` Andrew Morton
2006-11-08 22:44           ` Davide Libenzi
2006-11-08 23:07             ` Eric Dumazet
2006-11-08 23:56               ` Davide Libenzi
2006-11-09  7:24                 ` Eric Dumazet
2006-11-09  7:52                   ` Eric Dumazet
2006-11-09 17:12                     ` Davide Libenzi
2006-11-09  8:23 ` [take24 0/6] " Evgeniy Polyakov
2006-11-09  8:23   ` [take24 1/6] kevent: Description Evgeniy Polyakov
2006-11-09  8:23     ` [take24 2/6] kevent: Core files Evgeniy Polyakov
2006-11-09  8:23       ` [take24 3/6] kevent: poll/select() notifications Evgeniy Polyakov
2006-11-09  8:23         ` [take24 4/6] kevent: Socket notifications Evgeniy Polyakov
2006-11-09  8:23           ` [take24 5/6] kevent: Timer notifications Evgeniy Polyakov
2006-11-09  8:23             ` [take24 6/6] kevent: Pipe notifications Evgeniy Polyakov
2006-11-09  9:08         ` [take24 3/6] kevent: poll/select() notifications Eric Dumazet
2006-11-09  9:29           ` Evgeniy Polyakov
2006-11-09 18:51         ` Davide Libenzi
2006-11-09 19:10           ` Evgeniy Polyakov
2006-11-09 19:42             ` Davide Libenzi
2006-11-09 20:10               ` Davide Libenzi
2006-11-11 17:36   ` [take24 7/6] kevent: signal notifications Evgeniy Polyakov
2006-11-11 22:28   ` [take24 0/6] kevent: Generic event handling mechanism Ulrich Drepper
2006-11-13 10:54     ` Evgeniy Polyakov
2006-11-13 11:16       ` Evgeniy Polyakov
2006-11-20  0:02       ` Ulrich Drepper
2006-11-20  8:25         ` Evgeniy Polyakov
2006-11-20  8:43           ` Andrew Morton
2006-11-20  8:51             ` Evgeniy Polyakov
2006-11-20  9:15               ` Andrew Morton
2006-11-20  9:19                 ` Evgeniy Polyakov
2006-11-20 20:29           ` Ulrich Drepper
2006-11-20 21:46             ` Jeff Garzik
2006-11-20 21:52               ` Ulrich Drepper
2006-11-21  9:09                 ` Ingo Oeser
2006-11-22 11:38                 ` Michael Tokarev
2006-11-22 11:47                   ` Evgeniy Polyakov
2006-11-22 12:33                   ` Jeff Garzik
2006-11-21  9:53             ` Evgeniy Polyakov
2006-11-21 16:58               ` Ulrich Drepper
2006-11-21 17:43                 ` Evgeniy Polyakov
2006-11-21 18:46                   ` Evgeniy Polyakov
2006-11-21 20:01                     ` Jeff Garzik
2006-11-22 10:41                       ` Evgeniy Polyakov
2006-11-21 20:19                     ` Jeff Garzik
2006-11-22 10:39                       ` Evgeniy Polyakov
2006-11-22  7:38                     ` Ulrich Drepper
2006-11-22 10:44                       ` Evgeniy Polyakov
2006-11-22 21:02                         ` Ulrich Drepper
2006-11-23 12:23                           ` Evgeniy Polyakov
2006-11-23  8:52                         ` Kevent POSIX timers support Evgeniy Polyakov
2006-11-23 20:26                           ` Ulrich Drepper
2006-11-24  9:50                             ` Evgeniy Polyakov
2006-11-27 18:20                               ` Ulrich Drepper
2006-11-27 18:24                                 ` David Miller
2006-11-27 18:36                                   ` Ulrich Drepper
2006-11-27 18:49                                     ` David Miller
2006-11-28  9:16                                       ` Evgeniy Polyakov
2006-11-28 19:13                                         ` David Miller
2006-11-28 19:22                                           ` Evgeniy Polyakov
2006-12-12  1:36                                             ` David Miller
2006-12-12  5:31                                               ` Evgeniy Polyakov
2006-11-28  9:16                                 ` Evgeniy Polyakov
2006-12-13 13:21                           ` Tushar Adeshara
2006-12-13 13:27                             ` Evgeniy Polyakov
2006-11-22  7:33                   ` [take24 0/6] kevent: Generic event handling mechanism Ulrich Drepper
2006-11-22 10:38                     ` Evgeniy Polyakov
2006-11-22 22:22                       ` Ulrich Drepper
2006-11-23 12:18                         ` Evgeniy Polyakov
2006-11-23 22:23                           ` Ulrich Drepper
2006-11-24 10:57                             ` Evgeniy Polyakov
2006-11-27 19:12                               ` Ulrich Drepper
2006-11-28 11:00                                 ` Evgeniy Polyakov
2006-11-22 12:09                     ` Evgeniy Polyakov
2006-11-22 12:15                       ` Evgeniy Polyakov
2006-11-22 13:46                         ` Evgeniy Polyakov
2006-11-22 22:24                         ` Ulrich Drepper
2006-11-23 12:22                           ` Evgeniy Polyakov
2006-11-23 20:34                             ` Ulrich Drepper
2006-11-24 10:58                               ` Evgeniy Polyakov
2006-11-27 18:23                                 ` Ulrich Drepper
2006-11-28 10:13                                   ` Evgeniy Polyakov
2006-12-27 20:45                                     ` Ulrich Drepper
2006-12-28  9:50                                       ` Evgeniy Polyakov
2006-11-21 16:29 ` [take25 " Evgeniy Polyakov
2006-11-21 16:29   ` [take25 1/6] kevent: Description Evgeniy Polyakov
2006-11-21 16:29     ` [take25 2/6] kevent: Core files Evgeniy Polyakov
2006-11-21 16:29       ` [take25 3/6] kevent: poll/select() notifications Evgeniy Polyakov
2006-11-21 16:29         ` [take25 4/6] kevent: Socket notifications Evgeniy Polyakov
2006-11-21 16:29           ` [take25 5/6] kevent: Timer notifications Evgeniy Polyakov
2006-11-21 16:29             ` [take25 6/6] kevent: Pipe notifications Evgeniy Polyakov
2006-11-22 11:20               ` Eric Dumazet
2006-11-22 11:30                 ` Evgeniy Polyakov
2006-11-22 23:46     ` [take25 1/6] kevent: Description Ulrich Drepper
2006-11-23 11:52       ` Evgeniy Polyakov
2006-11-23 19:45         ` Ulrich Drepper
2006-11-24 11:01           ` Evgeniy Polyakov
2006-11-24 16:06             ` Ulrich Drepper
2006-11-24 16:14               ` Evgeniy Polyakov
2006-11-24 16:31                 ` Evgeniy Polyakov
2006-11-27 19:20                 ` Ulrich Drepper
2006-11-22 23:52     ` Ulrich Drepper
2006-11-23 11:55       ` Evgeniy Polyakov
2006-11-23 20:00         ` Ulrich Drepper
2006-11-23 21:49           ` Hans Henrik Happe
2006-11-23 22:34             ` Ulrich Drepper
2006-11-24 11:50               ` Evgeniy Polyakov
2006-11-24 16:17                 ` Ulrich Drepper
2006-11-24 11:46           ` Evgeniy Polyakov
2006-11-24 16:30             ` Ulrich Drepper
2006-11-24 16:49               ` Evgeniy Polyakov
2006-11-27 19:23                 ` Ulrich Drepper
2006-11-23 22:33     ` Ulrich Drepper
2006-11-23 22:48       ` Jeff Garzik
2006-11-23 23:45         ` Ulrich Drepper
2006-11-24  0:48           ` Eric Dumazet
2006-11-24  8:14             ` Andrew Morton
2006-11-24  8:33               ` Eric Dumazet
2006-11-24 15:26                 ` Ulrich Drepper
2006-11-24 13:07           ` Miquel van Smoorenburg
2006-11-24  0:14         ` Hans Henrik Happe
2006-11-24 12:05       ` Evgeniy Polyakov
2006-11-24 12:13         ` Evgeniy Polyakov
2006-11-27 19:43         ` Ulrich Drepper
2006-11-28 10:26           ` Evgeniy Polyakov
2006-11-30 19:14 ` [take26 0/8] kevent: Generic event handling mechanism Evgeniy Polyakov
2006-11-30 19:14   ` [take26 1/8] kevent: Description Evgeniy Polyakov
2006-11-30 19:14     ` [take26 2/8] kevent: Core files Evgeniy Polyakov
2006-11-30 19:14       ` [take26 3/8] kevent: poll/select() notifications Evgeniy Polyakov
2006-11-30 19:14         ` [take26 4/8] kevent: Socket notifications Evgeniy Polyakov
2006-11-30 19:14           ` [take26 5/8] kevent: Timer notifications Evgeniy Polyakov
2006-11-30 19:14             ` [take26 6/8] kevent: Pipe notifications Evgeniy Polyakov
2006-11-30 19:14               ` [take26 7/8] kevent: Signal notifications Evgeniy Polyakov
2006-11-30 19:14                 ` [take26 8/8] kevent: Kevent posix timer notifications Evgeniy Polyakov

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=11619654014077@2ka.mipt.ru \
    --to=johnpol@2ka.mipt.ru \
    --cc=akpm@osdl.org \
    --cc=chase.venters@clientec.com \
    --cc=davem@davemloft.net \
    --cc=drepper@redhat.com \
    --cc=hch@infradead.org \
    --cc=johann.borck@densedata.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=zach.brown@oracle.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;
as well as URLs for NNTP newsgroup(s).