From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933499AbbENPJV (ORCPT ); Thu, 14 May 2015 11:09:21 -0400 Received: from mail-qc0-f177.google.com ([209.85.216.177]:32806 "EHLO mail-qc0-f177.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932640AbbENPIc (ORCPT ); Thu, 14 May 2015 11:08:32 -0400 Date: Thu, 14 May 2015 11:08:28 -0400 From: Tejun Heo To: Aleksa Sarai Cc: lizefan@huawei.com, mingo@redhat.com, Peter Zijlstra , richard@nod.at, =?iso-8859-1?Q?Fr=E9d=E9ric?= Weisbecker , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [PATCH v10 3/4] cgroups: allow a cgroup subsystem to reject a fork Message-ID: <20150514150828.GG11388@htj.duckdns.org> References: <1429446154-10660-1-git-send-email-cyphar@cyphar.com> <1429446154-10660-4-git-send-email-cyphar@cyphar.com> <20150422155445.GD10738@htj.duckdns.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hello, Aleksa. On Thu, May 14, 2015 at 08:57:49PM +1000, Aleksa Sarai wrote: > >> +/* Ditto for the can_fork/cancel_fork/reapply_fork callbacks. */ > >> +static int need_canfork_callback __read_mostly; > >> +static int need_cancelfork_callback __read_mostly; > > > > And given that the reason we have these masks is avoiding iteration in > > relatively hot paths. Does cancelfork mask make sense? > > Do you still want me to remove it? I only added it because it made the > callback code more consistent for cancel_fork and can_fork. This doesn't make much sense to me. Why don't we have masks for other callbacks then? This way, we're breaking the consistency regarding why the mask is used in the first place. > > Maybe we want a helper callback which does > > > > if (CGROUP_PREFORK_START <= ssid && ssid < CGROUP_PREFORK_END) > > return &ss_state[ssid - CGROUP_PREFORK_START]; > > return NULL; > > What would be a nice name for it? I can't think of anything better > than __get_ss_private() and __get_ss_privatep(). Do we need the double underscores? subsys_prefork_priv()? Thanks. -- tejun