Re: [PATCH] mm,oom: Reduce needless dereference.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue 08-03-16 13:30:32, Johannes Weiner wrote:
> On Tue, Mar 08, 2016 at 08:02:31PM +0900, Tetsuo Handa wrote:
> > Since we assigned mm = victim->mm before pr_err(),
> > we don't need to dereference victim->mm again at pr_err().
> > This saves a few instructions.
> > 
> > Signed-off-by: Tetsuo Handa <penguin-kernel@xxxxxxxxxxxxxxxxxxx>
> 
> Yes. Once we introduce a local variable for something, we should use
> it consistently to refer to that thing. Anything else is confusing.

The victim->mm association is stable here because of the task_lock but I
agree that this might be not obvious and reusing the local variable is
easier to read and understand. I doubt we care about the change in the
generated code as an argument though. So just for the sake of clean up

Acked-by: Michal Hocko <mhocko@xxxxxxxx>

> 
> Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx>
> 
> --
> 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>

-- 
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>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]