On Mon, Jan 10, 2011 at 12:19:25PM -0500, Mikulas Patocka wrote: > There are two approaches that I considered: > > 1. make a special work for unplug. After queuing each IO's work, cancel the > unplug work and queue it again (so that it will always be queued as a last > entry). Unfortunatelly, canceling a work is rather slow operation so I decided > to not use this approach. > > 2. use a special pointer that points to the last IO. When the IO is finished > and the pointer matches this IO, we know that it was the last IO and we should > unplug. This patch implements this approach. What about keeping a reference count of pending I/O requests in a shared structure, with the last decrement doing the unplug? -- To unsubscribe from this list: send the line "unsubscribe linux-net" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html