lkml.org 
[lkml]   [2013]   [Sep]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RESEND] mm/vmscan : use vmcan_swappiness( ) basing on MEMCG config to elimiate unnecessary runtime cost
On Mon, Aug 26, 2013 at 09:36:58PM +0800, larmbr wrote:
> Currently, we get the vm_swappiness via vmscan_swappiness(), which
> calls global_reclaim() to check if this is a global reclaim.
>
> Besides, the current implementation of global_reclaim() always returns
> true for the !CONFIG_MEGCG case, and judges the other case by checking
> whether scan_control->target_mem_cgroup is null or not.
>
> Thus, we could just use two versions of vmscan_swappiness() based on
> MEMCG Kconfig , to eliminate the unnecessary run-time cost for
> the !CONFIG_MEMCG at all, and to squash all memcg-related checking
> into the CONFIG_MEMCG version.

The compiler can easily detect that global_reclaim() always returns
true for !CONFIG_MEMCG during compile time and not even generate a
branch for this.

> 2 files changed, 12 insertions(+), 3 deletions(-)

You're adding more code for now gain.


\
 
 \ /
  Last update: 2013-09-04 01:01    [W:0.069 / U:0.812 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site