In brief
Optimizing writeback timers: on a normal Linux system, the pdflush process wakes up every five seconds to force dirty page cache pages back to their backing store on disk. This wakeup happens whether or not there is anything needing to be written back. Unnecessary wakeups are increasingly unwelcome, especially on systems where power consumption matters, so it would be nice to let pdflush sleep when there is nothing for it to do.
Artem Bityutskiy has put together a patch set to do just that. It changes the filesystem API to make it easier for the core VFS to know when a specific filesystem has dirty data. That information is then used to decide whether pdflush needs to be roused from its slumber. The idea seems good, but there's one little problem: this work conflicts with the per-BDI flusher threads patches by Jens Axboe. Jens's patches get rid of the pdflush timer and make a lot of other changes, so these two projects do not currently play well together. So Artem is headed back to the drawing board to base his work on top of Jens's patches instead of the mainline.
recvmmsg(). Arnaldo Carvalho de Melo has proposed a new system call for the socket API:
struct mmsghdr { struct msghdr msg_hdr; unsigned msg_len; }; ssize_t recvmmsg(int socket, struct mmsghdr *mmsg, int vlen, int flags);
The difference between this system call and recvmsg() is that it is able to accept multiple messages with a single call. That, in turn, reduces system call overhead in high-bandwidth network applications. The comments in the patch suggest that sendmmsg() is in the plans, but no implementation has been posted yet.
There was a suggestion that this
functionality could be obtained by extending recvmsg() with a new
message flag, rather than adding a new system call. But, as David Miller
pointed out, that won't work. The kernel
currently ignores unrecognized flags; that will make it impossible for user
space to determine whether a specific kernel supports multiple-message
receives or not. So the new system call is probably how this feature will
be added.
Index entries for this article | |
---|---|
Kernel | recvmmsg() |
Posted May 28, 2009 4:11 UTC (Thu)
by jengelh (guest, #33263)
[Link]
Posted May 28, 2009 6:44 UTC (Thu)
by ncm (guest, #165)
[Link]
Posted May 28, 2009 16:06 UTC (Thu)
by tstover (guest, #56283)
[Link]
Posted Jun 1, 2009 16:53 UTC (Mon)
by butlerm (subscriber, #13312)
[Link] (2 responses)
Posted Mar 8, 2010 17:47 UTC (Mon)
by 4utomat (guest, #61249)
[Link] (1 responses)
Posted Mar 21, 2012 23:29 UTC (Wed)
by gutschke (subscriber, #27910)
[Link]
If you don't want to specify a timeout, just pass NULL as an additional parameter. That should fix your program.
Re: In brief
10 Gbps pipes
recvmmsg() = great idea
In brief
There are numerous UDP style protocols that would benefit significantly from
this.
Has anyone got recvmmsg to work
On 2.6.33, the example above fails with errno=14 (Bad Address)
Has anyone got recvmmsg to work