From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754427AbcHARRz (ORCPT ); Mon, 1 Aug 2016 13:17:55 -0400 Received: from gum.cmpxchg.org ([85.214.110.215]:55702 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754643AbcHARRY (ORCPT ); Mon, 1 Aug 2016 13:17:24 -0400 Date: Mon, 1 Aug 2016 13:17:17 -0400 From: Johannes Weiner To: Michal Hocko Cc: Vladimir Davydov , Andrew Morton , linux-mm@kvack.org, LKML Subject: Re: [PATCH] memcg: put soft limit reclaim out of way if the excess tree is empty Message-ID: <20160801171717.GB8724@cmpxchg.org> References: <1470045621-14335-1-git-send-email-mhocko@kernel.org> <20160801135757.GB19395@esperanza> <20160801141227.GI13544@dhcp22.suse.cz> <20160801150343.GA7603@cmpxchg.org> <20160801152454.GK13544@dhcp22.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20160801152454.GK13544@dhcp22.suse.cz> User-Agent: Mutt/1.6.2 (2016-07-01) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 01, 2016 at 05:24:54PM +0200, Michal Hocko wrote: > @@ -2564,7 +2559,13 @@ unsigned long mem_cgroup_soft_limit_reclaim(pg_data_t *pgdat, int order, > return 0; > > mctz = soft_limit_tree_node(pgdat->node_id); > - if (soft_limit_tree_empty(mctz)) > + > + /* > + * Do not even bother to check the largest node if the node root > + * is empty. Do it lockless to prevent lock bouncing. Races > + * are acceptable as soft limit is best effort anyway. > + */ > + if (RB_EMPTY_ROOT(&mctz->rb_root)) > return 0; Other than that, looks good. Please retain my Acked-by: Johannes Weiner in version 2.