On Thu 17-08-17 19:12:40, Andrea Arcangeli wrote: > On Wed, Aug 16, 2017 at 03:23:29PM +0200, Michal Hocko wrote: > > Reviewed-by: Michal Hocko <mhocko@xxxxxxxx> > > Thanks for the review! > > There's this further possible microoptimization that can be folded on top. > > >From 76bf017f923581d15fe01249af92b0d757752a9f Mon Sep 17 00:00:00 2001 > From: Andrea Arcangeli <aarcange@xxxxxxxxxx> > Date: Thu, 17 Aug 2017 18:39:46 +0200 > Subject: [PATCH 1/1] mm: oom: let oom_reap_task and exit_mmap run > concurrently, add unlikely > > Microoptimization to fold before merging. > > Signed-off-by: Andrea Arcangeli <aarcange@xxxxxxxxxx> > --- > mm/mmap.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/mm/mmap.c b/mm/mmap.c > index 013170e5c8a4..ab0026a8acc4 100644 > --- a/mm/mmap.c > +++ b/mm/mmap.c > @@ -3003,7 +3003,7 @@ void exit_mmap(struct mm_struct *mm) > unmap_vmas(&tlb, vma, 0, -1); > > set_bit(MMF_OOM_SKIP, &mm->flags); > - if (tsk_is_oom_victim(current)) { > + if (unlikely(tsk_is_oom_victim(current))) { I dunno. This doesn't make any difference in the generated code for me (with gcc 6.4). If anything we might wan't to putt unlikely inside tsk_is_oom_victim. Or even go further and use a jump label to get any conditional paths out of way. > /* > * Wait for oom_reap_task() to stop working on this > * mm. Because MMF_OOM_SKIP is already set before > -- 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>