On Tue 04-07-17 21:43:39, zbestahu wrote: > Michal wrote: > > > the existing percent > > > calculation using scale should be about rounding to intege, it > > > seems to be redundant, we can calculate it directly just like > > > "pressure = not_relaimed * 100 / scanned", no rounding issue. And > > > it's also better because of saving several arithmetic operations. > > > and you haven't explained why that change is so much better to change > > the behavior. > > it removes 3 below arithmetic instructions so it should be running faster. > add: scanned + reclaimed > mul: scale * reclaimed > udiv: reclaimed * scale /scanned That part is clear from the diff... What is not clear from the diff is your motivation. This path is not hot (we are in the reclaim which is a slow path) and few extra instructions are acceptable. Sure we can optimize it if the resulting code is working as expected. What I am asking (obviously unsuccessfully) is to describe _why_ it is better. This is a requirement for _each patch_. We are not changing the code "just because I like it more that way". -- Michal Hocko SUSE Labs -- 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>