Re: [PATCH] mm, mempolicy: fix up gup usage in lookup_node
From: Peter Xu
Date: Tue Apr 21 2020 - 11:16:40 EST
On Tue, Apr 21, 2020 at 04:46:03PM +0200, Michal Hocko wrote:
> I thought I have explained that when we have discussed last time and the
> changelog is explaining that as well. Checking for impossible error code
> is simply confusing and provokes for copy&pasting this pattern. I
> wouldn't really bother if I haven't seen this cargo cult pattern in the
> so many times.
It's just my poor habit to avoid churns like this. Say, if the check is not
there, I definitely shouldn't add that check without explicit reason. However
if it's there already (and it's not an extremely hot path so no number to show
that it will bring any performance impact), then I won't touch it either
without a good reasoning. "Somebody could copy & paste the same code" isn't a
reason to me - that's something we can observe when reviewing a patch.
I've broken some code due to some tiny trivial small changes that I thought
won't hurt, and I've also been debugging for hours due to some "should be
trivial" patches from others. This is how the habit comes...
But it's not a strong opinion either. I'd be fine if the patch is liked by
others and Andrew would like to queue it.
Thanks,
--
Peter Xu