From mboxrd@z Thu Jan 1 00:00:00 1970 From: Johannes Weiner Subject: Re: [PATCH 09/13] mm: memcontrol: generalize the socket accounting jump label Date: Mon, 30 Nov 2015 17:46:34 -0500 Message-ID: <20151130224634.GA19849@cmpxchg.org> References: <1448401925-22501-1-git-send-email-hannes@cmpxchg.org> <1448401925-22501-10-git-send-email-hannes@cmpxchg.org> <565CBAC2.3080804@akamai.com> <20151130215007.GA31903@cmpxchg.org> <565CCDA1.905@akamai.com> Mime-Version: 1.0 Return-path: Content-Disposition: inline In-Reply-To: <565CCDA1.905-JqFfY2XvxFXQT0dZR+AlfA@public.gmane.org> Sender: cgroups-owner-u79uwXL29TY76Z2rM5mHXA@public.gmane.org List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Jason Baron Cc: Andrew Morton , David Miller , Vladimir Davydov , Michal Hocko , Tejun Heo , Eric Dumazet , netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-mm-Bw31MaZKKs3YtjvyW6yDsg@public.gmane.org, cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, kernel-team-b10kYP2dOMg@public.gmane.org, "peterz-wEGCiKHe2LqWVfeAwA7xHQ@public.gmane.org" On Mon, Nov 30, 2015 at 05:28:49PM -0500, Jason Baron wrote: > On 11/30/2015 04:50 PM, Johannes Weiner wrote: > > On Mon, Nov 30, 2015 at 04:08:18PM -0500, Jason Baron wrote: > >> We're trying to move to the updated API, so this should be: > >> static_branch_unlikely(&memcg_sockets_enabled_key) > >> > >> see: include/linux/jump_label.h for details. > > > > Good point. There is another struct static_key in there as well. How > > about the following on top of this series? > > > > Looks fine - you may be able to make use of > 'static_branch_enable()/disable()' instead of the inc()/dec() to simply > set the branch direction, if you think its more readable. Although I > didn't look to see if it would be racy here. Thanks! We actually need the reference counting semantics for both these keys. It counts the number of active cgroups in existence that require the code behind those static branches. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-lf0-f52.google.com (mail-lf0-f52.google.com [209.85.215.52]) by kanga.kvack.org (Postfix) with ESMTP id CA2FD6B0038 for ; Mon, 30 Nov 2015 17:46:51 -0500 (EST) Received: by lfs39 with SMTP id 39so211998328lfs.3 for ; Mon, 30 Nov 2015 14:46:51 -0800 (PST) Received: from gum.cmpxchg.org (gum.cmpxchg.org. [85.214.110.215]) by mx.google.com with ESMTPS id 42si30628666lfx.24.2015.11.30.14.46.50 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Nov 2015 14:46:50 -0800 (PST) Date: Mon, 30 Nov 2015 17:46:34 -0500 From: Johannes Weiner Subject: Re: [PATCH 09/13] mm: memcontrol: generalize the socket accounting jump label Message-ID: <20151130224634.GA19849@cmpxchg.org> References: <1448401925-22501-1-git-send-email-hannes@cmpxchg.org> <1448401925-22501-10-git-send-email-hannes@cmpxchg.org> <565CBAC2.3080804@akamai.com> <20151130215007.GA31903@cmpxchg.org> <565CCDA1.905@akamai.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <565CCDA1.905@akamai.com> Sender: owner-linux-mm@kvack.org List-ID: To: Jason Baron Cc: Andrew Morton , David Miller , Vladimir Davydov , Michal Hocko , Tejun Heo , Eric Dumazet , netdev@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, "peterz@infradead.org" On Mon, Nov 30, 2015 at 05:28:49PM -0500, Jason Baron wrote: > On 11/30/2015 04:50 PM, Johannes Weiner wrote: > > On Mon, Nov 30, 2015 at 04:08:18PM -0500, Jason Baron wrote: > >> We're trying to move to the updated API, so this should be: > >> static_branch_unlikely(&memcg_sockets_enabled_key) > >> > >> see: include/linux/jump_label.h for details. > > > > Good point. There is another struct static_key in there as well. How > > about the following on top of this series? > > > > Looks fine - you may be able to make use of > 'static_branch_enable()/disable()' instead of the inc()/dec() to simply > set the branch direction, if you think its more readable. Although I > didn't look to see if it would be racy here. Thanks! We actually need the reference counting semantics for both these keys. It counts the number of active cgroups in existence that require the code behind those static branches. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Don't email: email@kvack.org From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755152AbbK3Wqv (ORCPT ); Mon, 30 Nov 2015 17:46:51 -0500 Received: from gum.cmpxchg.org ([85.214.110.215]:47006 "EHLO gum.cmpxchg.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753968AbbK3Wqt (ORCPT ); Mon, 30 Nov 2015 17:46:49 -0500 Date: Mon, 30 Nov 2015 17:46:34 -0500 From: Johannes Weiner To: Jason Baron Cc: Andrew Morton , David Miller , Vladimir Davydov , Michal Hocko , Tejun Heo , Eric Dumazet , netdev@vger.kernel.org, linux-mm@kvack.org, cgroups@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-team@fb.com, "peterz@infradead.org" Subject: Re: [PATCH 09/13] mm: memcontrol: generalize the socket accounting jump label Message-ID: <20151130224634.GA19849@cmpxchg.org> References: <1448401925-22501-1-git-send-email-hannes@cmpxchg.org> <1448401925-22501-10-git-send-email-hannes@cmpxchg.org> <565CBAC2.3080804@akamai.com> <20151130215007.GA31903@cmpxchg.org> <565CCDA1.905@akamai.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <565CCDA1.905@akamai.com> 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 On Mon, Nov 30, 2015 at 05:28:49PM -0500, Jason Baron wrote: > On 11/30/2015 04:50 PM, Johannes Weiner wrote: > > On Mon, Nov 30, 2015 at 04:08:18PM -0500, Jason Baron wrote: > >> We're trying to move to the updated API, so this should be: > >> static_branch_unlikely(&memcg_sockets_enabled_key) > >> > >> see: include/linux/jump_label.h for details. > > > > Good point. There is another struct static_key in there as well. How > > about the following on top of this series? > > > > Looks fine - you may be able to make use of > 'static_branch_enable()/disable()' instead of the inc()/dec() to simply > set the branch direction, if you think its more readable. Although I > didn't look to see if it would be racy here. Thanks! We actually need the reference counting semantics for both these keys. It counts the number of active cgroups in existence that require the code behind those static branches.