Skip to contentSkip to conversation

zbd: Introduce thread zbd operations

PATCH Alexey Dobriyan 2 participants 2 messages Apr 27, 2020

lore
Share & tools
lore
#0 lore raw

Review

Quoted 8 lines
(quoted diff) +3 -5
-	if (td->o.zone_mode == ZONE_MODE_ZBD) {
-		ret = zbd_adjust_block(td, io_u);
-		if (ret == io_u_eof)
-			return 1;
-	}
+	ret = zbd_adjust_block(td, io_u);
+	if (ret == io_u_eof)
+		return 1;

This is cleaner code but probably won't result in performance changes because it is trading a branch and a regular function call to a branch and indirect function call.

#1 lore raw
Quoted 4 lines · Alexey Dobriyan
Quoted 4 lines
(quoted diff) +0 -4
-	if (td->o.zone_mode == ZONE_MODE_ZBD) {
-		ret = zbd_adjust_block(td, io_u);
-		if (ret == io_u_eof)
-			return 1;
Quoted 9 lines

Review

Quoted 4 lines
(quoted diff) +3 -1
-	}
+	ret = zbd_adjust_block(td, io_u);
+	if (ret == io_u_eof)
+		return 1;

This is cleaner code but probably won't result in performance changes because it is trading a branch and a regular function call to a branch and indirect function call.

Yes. I wondered how to best avoid overhead for the regular case. Tried different things but this one was the cleanest and probably has the least impact on zbd mode itself. I am starting to think that it may be better to have a zbd_fill_io_u() function called in place of the regular fill_io_u(). That would reduce the 3 conditionals we have for zbd to one only, and also allow more liberty with io_u adjustments for zbd without impacting the regular device case. Thoughts ?

Signature · 2 lines
Damien Le Moal
Western Digital Research