Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753309AbbKPRw0 (ORCPT ); Mon, 16 Nov 2015 12:52:26 -0500 Received: from gum.cmpxchg.org ([85.214.110.215]:43894 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752488AbbKPRwY (ORCPT ); Mon, 16 Nov 2015 12:52:24 -0500 Date: Mon, 16 Nov 2015 12:52:04 -0500 From: Johannes Weiner To: Vladimir Davydov Cc: David Miller , Andrew Morton , Tejun Heo , Michal Hocko , netdev@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCH 05/14] net: tcp_memcontrol: protect all tcp_memcontrol calls by jump-label Message-ID: <20151116175204.GA32544@cmpxchg.org> References: <1447371693-25143-1-git-send-email-hannes@cmpxchg.org> <1447371693-25143-6-git-send-email-hannes@cmpxchg.org> <20151114163309.GL31308@esperanza> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20151114163309.GL31308@esperanza> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1282 Lines: 32 On Sat, Nov 14, 2015 at 07:33:10PM +0300, Vladimir Davydov wrote: > On Thu, Nov 12, 2015 at 06:41:24PM -0500, Johannes Weiner wrote: > > Move the jump-label from sock_update_memcg() and sock_release_memcg() > > to the callsite, and so eliminate those function calls when socket > > accounting is not enabled. > > I don't believe this patch's necessary, because these functions aren't > hot paths. Neither do I think it makes the code look better. Anyway, > it's rather a matter of personal preference, and the patch looks correct > to me, so Yeah, it's not a hotpath. What I like primarily about this patch I guess is that makes it more consistent how memcg entry is gated. You don't have to remember which functions have the checks in the caller and which have it in the function themselves. And I really hate the static inline void foo(void) { if (foo_enabled()) __foo() } in the headerfile pattern. > Reviewed-by: Vladimir Davydov Thanks, I appreciate you acking it despite your personal preference! -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/