On Sun, 17 Feb 2013, Jiang Liu wrote: > There's typical usage of si_meminfo as below: > si_meminfo(&si); > threshold = si->totalram - si.totalhigh; > > It may cause underflow if memory hotplug races with si_meminfo() because > there's no mechanism to protect si_meminfo() from memory hotplug > operations. And some callers expects that si_meminfo() is a lightweight > operations. So introduce a lightweight mechanism to protect si_meminfo() > from memory hotplug operations. > Instead of this, I think it would be appropriate to add a comment that requires synchronization if two fields are going to be compared, i.e. use {lock,unlock}_memory_hotplug() in the caller to si_meminfo(), or appropriate underflow checking is done upon return. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@xxxxxxxxx. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: <a href=mailto:"dont@xxxxxxxxx"> email@xxxxxxxxx </a>