<head></head><body style="line-height: 1.5; font-size: 14px; color: rgba(38, 42, 51, 0.9); font-family: Source Han Sans;">
<div style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
" data-mce-style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
"><br></div><div style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
" data-mce-style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
"><br></div><div style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
" data-mce-style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
">Hi Joel,<span data-mce-type="bookmark" id="mce_2_start" data-mce-style="overflow:hidden;line-height:0px" style="overflow: hidden; line-height: 0px;"></span><br><br><div>Thank you for your suggestion!</div><div>Based on your suggestions, I made some modifications and sent the v3 version.</div><span data-mce-type="bookmark" id="mce_1_start" data-mce-style="overflow:hidden;line-height:0px" style="overflow: hidden; line-height: 0px;"></span><br></div><div style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
" data-mce-style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
">Best regards,<br>zhengbing<span data-mce-type="bookmark" id="mce_3_start" data-mce-style="overflow:hidden;line-height:0px" style="overflow: hidden; line-height: 0px;"></span><br data-mce-bogus="1"></div><div style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
" data-mce-style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
"><br></div><div class="mail-signature"> <div class="lingxi-signature-container" style="font-family: PingFang,Source Han Sans,sans-serif;"> <!-- 样式一,完整版 --> <table style="border-collapse: collapse;width: 100%;text-size-adjust:none !important;table-layout: fixed;" class="mce-item-table"> <tbody style="text-size-adjust:none !important;word-wrap:break-word; word-break:break-all;"> </tbody> </table> <!-- 样式二,无头像 --> <div id="lingxi-signature-v2-block" style="width: 100%;text-decoration: none;text-underline: none;"> <div id="lingxi-signature-v2-content" itemid="id" style="max-width: 95%;font-size: 14px;line-height: 16px;color: #7A8599;padding: 16px 16px 4px 0px;margin-left: 0px;" itemprop="5317106"> <div style="color: #232D47;border: none;margin-bottom:4px;font-size: 16px;line-height: 20px;text-underline: none;font-weight: bolder;" itemid="name">黄正兵</div> <div style="border: none;margin-bottom:8px;text-underline: none;">zhengbing.huang@easystack.cn</div> </div> </div> <!--办公品牌--> </div></div><div class="pre-mail-content"><div style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
" data-mce-style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
"><br></div><div style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
" data-mce-style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
"><br></div><div style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
" data-mce-style="font-family:Source Han Sans;font-size:14px;line-height:1.5;
"><br></div><div id="isReplyContent" style="margin: 0;"><div style="color: #7d8085">Original:</div><ul style="color: #7d8085; font-size:12px; padding-left: 20px"><li>From:Joel Colledge <<a href="mailto:joel.colledge@linbit.com">joel.colledge@linbit.com</a>></li><li>Date:2025-12-19 19:13:12(中国 (GMT+08:00))</li><li>To:zhengbing.huang<<a href="mailto:zhengbing.huang@easystack.cn">zhengbing.huang@easystack.cn</a>></li><li>Cc:drbd-dev<<a href="mailto:drbd-dev@lists.linbit.com">drbd-dev@lists.linbit.com</a>></li><li>Subject:Re: [PATCH v2] drbd: only send P_PEERS_IN_SYNC for up to 4 MiB in resync progress</li></ul><pre>> The solution is to ensure that P_PEERS_IN_SYNC within a range of 4 MiB is sent each time,
> and skip the sector where there is no reysnc.
This implementation causes some P_PEERS_IN_SYNC to be sent that are
not necessary. It is still an improvement compared the current
behavior, but it would be good to solve this cleanly while we are
working on this code.
In my test I cause the following sectors to be dirty:
offset 24568 sectors (== 12MiB - 4KiB), size 8 sectors
offset 40960 sectors (== 20MiB), size 8 sectors
I expect P_PEERS_IN_SYNC with offsets:
16384 sectors (== 8MiB)
40960 sectors (== 20MiB)
I observe P_PEERS_IN_SYNC with offsets:
0 sectors
16384 sectors (== 8MiB)
24576 sectors (== 12MiB)
40960 sectors (== 20MiB)
Perhaps the code would be simpler if you handle the case of
potentially calling drbd_queue_update_peers() for the previous
last_peers_in_sync_end position as a separate case?
> + for (; peers_in_sync_end - peer_device->last_peers_in_sync_end >= PEERS_IN_SYNC_STEP_SECT; ) {
This could be written as a while loop, but maybe it will change anyway
with the suggestion above. Perhaps we don't need a loop at all.
update_peers_for_range() already handles splitting the range up in
4MiB chunks.
Please ensure that your patches pass the checks from the Linux
upstream checkpatch.pl. Some of the lines are too long in this patch.
I know that the current code does not always pass. We are cleaning it
up as we work on it.
Joel
</pre></div></div>
</body>