<font size=2 face="Times New Roman">Hi Martin,</font>
<br>
<br><font size=2 face="Times New Roman">Nice to see you, May you success
in your team and our open source community.</font>
<br>
<br><font size=1 face="Times New Roman">You have put forward a good proposal
to queued more uevent messages by </font><font size=2 face="Times New Roman">kicking
uevent </font>
<br><font size=2 face="Times New Roman">processing thread</font><font size=1 face="Times New Roman">
</font><font size=2 face="Times New Roman">in a predefined time intervals</font><font size=1 face="Times New Roman">.
It is also a good idea to have such </font><font size=2 face="Times New Roman">intervals
</font>
<br><font size=1 face="Times New Roman">configuration.</font>
<br>
<br><font size=1 face="Times New Roman">As to</font><font size=2 face="Times New Roman">
process several uevents for the same physical devices, I think the opinions
</font>
<br><font size=2 face="Times New Roman">different between us is "FILTER"
or "MERGER". Personally, I think Merger is more </font>
<br><font size=2 face="Times New Roman">accuracy, for example, we receive
4 paths addition uevent messages from the same </font>
<br><font size=2 face="Times New Roman">physical devices:</font>
<br><font size=2 face="Times New Roman">1)uevent add sdb</font>
<br><font size=2 face="Times New Roman">2)uevent add sdc</font>
<br><font size=2 face="Times New Roman">3)uevent add sdd</font>
<br><font size=2 face="Times New Roman">4)uevent add sde</font>
<br>
<br><font size=2 face="Times New Roman">We cannot just filter the 1)2)3)
uevent messages but only process the 4)uevent message, </font>
<br><font size=2 face="Times New Roman">which would cause losing paths
of this multipath devices.</font>
<br>
<br><font size=2 face="Times New Roman">In my opionion, we should MERGE
the four uevent messages to one like:</font>
<br><font size=2 face="Times New Roman">1)uevent add sdb sdb sdd sde</font>
<br>
<br><font size=2 face="Times New Roman">And then uevent processing thread
only needs to process one uevent message, and it </font>
<br><font size=2 face="Times New Roman">only produce one DM addition uevent
messages(VS. now: one DM addition uevent </font>
<br><font size=2 face="Times New Roman">message and 3 DM change uevent
messages) which really reduce system consumption </font>
<br><font size=2 face="Times New Roman">(for example: avoid udev to process
every DM uevent messages DM kernel produced).</font>
<br>
<div><font size=2 face="Times New Roman">Regards,Tang</font>
<br>
<br>
<br>
<br><font size=1 color=#5f5f5f face="sans-serif">发件人:    
    </font><font size=1 face="sans-serif">Martin Wilck
<mwilck@suse.com></font>
<br><font size=1 color=#5f5f5f face="sans-serif">收件人:    
    </font><font size=1 face="sans-serif">dm-devel@redhat.com,
</font>
<br><font size=1 color=#5f5f5f face="sans-serif">日期:    
    </font><font size=1 face="sans-serif">2016/11/16
17:59</font>
<br><font size=1 color=#5f5f5f face="sans-serif">主题:    
   </font><font size=1 face="sans-serif">Re: [dm-devel]
Improve processing efficiency for addition and deletion of multipath devices</font>
<br><font size=1 color=#5f5f5f face="sans-serif">发件人:    
   </font><font size=1 face="sans-serif">dm-devel-bounces@redhat.com</font>
<br>
<hr noshade>
<br>
<br>
<br><tt><font size=2>Hi Tang,<br>
<br>
On Wed, 2016-11-16 at 16:45 +0800, tang.junhui@zte.com.cn wrote:<br>
<br>
> I think we can merger most of uevent messages and reduce most of<br>
> unnecessary DM change <br>
> uevent messages during creation/deletion of multipath devices by this<br>
> way. <br>
> The method you mentioned I think that it is a little complex, and
it<br>
> not reduce the DM <br>
> addition/change/deletion uevent messages which consumed system high<br>
> resource. <br>
<br>
Let me quickly introduce myself, I'm a new member of Hannes' team at<br>
SUSE and new on this ML.<br>
<br>
Apart from Hannes' proposal for more fine-grained locking, I can see<br>
the following options:<br>
<br>
 a) instead of kicking the uevent processing thread whenever anything<br>
is queued, kick it in predefined time intervals (1 second, say). The<br>
uevent processor would then accumulate all changes received since it<br>
had been kicked last, and apply DM changes only when necessary. This<br>
may need to be a config option because it could obviously lead to<br>
delayed device setup in some configurations.<br>
<br>
 b) the logic of a) could be improved by the uevent listener detecting<br>
"event storms" and waiting for them to end before kicking the<br>
processing thread. The details of the heuristics for "storms"
would<br>
need to be worked out, of course.<br>
<br>
 c) sometimes several uevents for the same physical path occur in
quick<br>
succession. Normally it should be sufficient to filter these such
that<br>
only the last event is processed.<br>
<br>
Regards,<br>
Martin<br>
<br>
-- <br>
Dr. Martin Wilck <mwilck@suse.com>, Tel. +49 (0)911 74053 2107<br>
SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton<br>
HRB 21284 (AG Nürnberg)<br>
<br>
--<br>
dm-devel mailing list<br>
dm-devel@redhat.com<br>
</font></tt><a href="https://www.redhat.com/mailman/listinfo/dm-devel"><tt><font size=2>https://www.redhat.com/mailman/listinfo/dm-devel</font></tt></a>
<br></div>