History

dm log userspace: allow mark requests to piggyback on flush requests

In the cluster evironment, cluster write has poor performance because userspace_flush() has to contact a userspace program (cmirrord) for clear/mark/flush requests. But both mark and flush requests require cmirrord to communicate the message to all the cluster nodes for each flush call. This behaviour is really slow. To address this we now merge mark and flush requests together to reduce the kernel-userspace-kernel time. We allow a new directive, "integrated_flush" that can be used to instruct the kernel log code to combine flush and mark requests when directed by userspace. If not directed by userspace (due to an older version of the userspace code perhaps), the kernel will function as it did previously - preserving backwards compatibility. Additionally, flush requests are performed lazily when only clear requests exist.

Dongmao Zhang committed 12 years ago

Commit 5066a4d1 parent fca02842 files · +176 −50Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/dm-log-userspace.h+17−3
@@ -201,11 +201,18 @@ · 200 unmodified lines
201 * int (*flush)(struct dm_dirty_log *log);201 * int (*flush)(struct dm_dirty_log *log);
202 *202 *
203 * Payload-to-userspace:203 * Payload-to-userspace:
204 * None.204 * If the 'integrated_flush' directive is present in the constructor
205 * table, the payload is as same as DM_ULOG_MARK_REGION:
206 * uint64_t [] - region(s) to mark
207 * else
208 * None
205 * Payload-to-kernel:209 * Payload-to-kernel:
206 * None.210 * None.
207 *211 *
208 * No incoming or outgoing payload. Simply flush log state to disk.212 * If the 'integrated_flush' option was used during the creation of the
213 * log, mark region requests are carried as payload in the flush request.
214 * Piggybacking the mark requests in this way allows for fewer communications
215 * between kernel and userspace.
209 *216 *
210 * When the request has been processed, user-space must return the217 * When the request has been processed, user-space must return the
211 * dm_ulog_request to the kernel - setting the 'error' field and clearing218 * dm_ulog_request to the kernel - setting the 'error' field and clearing
@@ -385,8 +392,15 @@ · 173 unmodified lines
385 * version 2: DM_ULOG_CTR allowed to return a string containing a392 * version 2: DM_ULOG_CTR allowed to return a string containing a
386 * device name that is to be registered with DM via393 * device name that is to be registered with DM via
387 * 'dm_get_device'.394 * 'dm_get_device'.
395 * version 3: DM_ULOG_FLUSH is capable of carrying payload for marking
396 * regions. This "integrated flush" reduces the number of
397 * requests between the kernel and userspace by effectively
398 * merging 'mark' and 'flush' requests. A constructor table
399 * argument ('integrated_flush') is required to turn this
400 * feature on, so it is backwards compatible with older
401 * userspace versions.
388 */402 */
389#define DM_ULOG_REQUEST_VERSION 2403#define DM_ULOG_REQUEST_VERSION 3
390 404
391struct dm_ulog_request {405struct dm_ulog_request {
392 /*406 /*