From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758809AbbJHWP7 (ORCPT ); Thu, 8 Oct 2015 18:15:59 -0400 Received: from mail.linuxfoundation.org ([140.211.169.12]:33188 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754365AbbJHWP6 (ORCPT ); Thu, 8 Oct 2015 18:15:58 -0400 Date: Thu, 8 Oct 2015 15:15:57 -0700 From: Andrew Morton To: Davidlohr Bueso Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Davidlohr Bueso Subject: Re: [PATCH -next] mm/vmacache: inline vmacache_valid_mm() Message-Id: <20151008151557.0ea74baaafa753b7e86731d0@linux-foundation.org> In-Reply-To: <1444277879-22039-1-git-send-email-dave@stgolabs.net> References: <1444277879-22039-1-git-send-email-dave@stgolabs.net> X-Mailer: Sylpheed 3.4.1 (GTK+ 2.24.23; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 7 Oct 2015 21:17:59 -0700 Davidlohr Bueso wrote: > This function incurs in very hot paths and merely > does a few loads for validity check. Lets inline it, > such that we can save the function call overhead. > > ... > > --- a/mm/vmacache.c > +++ b/mm/vmacache.c > @@ -52,7 +52,7 @@ void vmacache_flush_all(struct mm_struct *mm) > * Also handle the case where a kernel thread has adopted this mm via use_mm(). > * That kernel thread's vmacache is not applicable to this mm. > */ > -static bool vmacache_valid_mm(struct mm_struct *mm) > +static inline bool vmacache_valid_mm(struct mm_struct *mm) > { > return current->mm == mm && !(current->flags & PF_KTHREAD); > } Yeah, I'll ingest my headgear if there's any vaguely recent compiler which isn't already inlining this.