Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752148AbbDZQJS (ORCPT ); Sun, 26 Apr 2015 12:09:18 -0400 Received: from mail-vn0-f43.google.com ([209.85.216.43]:46525 "EHLO mail-vn0-f43.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750775AbbDZQJO (ORCPT ); Sun, 26 Apr 2015 12:09:14 -0400 Date: Sun, 26 Apr 2015 12:09:09 -0400 From: Tejun Heo To: Aleksa Sarai Cc: Peter Zijlstra , lizefan@huawei.com, mingo@redhat.com, richard@nod.at, =?iso-8859-1?Q?Fr=E9d=E9ric?= Weisbecker , linux-kernel@vger.kernel.org, cgroups@vger.kernel.org Subject: Re: [PATCH v10 1/4] cgroups: use bitmask to filter for_each_subsys Message-ID: <20150426160909.GC1499@htj.duckdns.org> References: <1429446154-10660-1-git-send-email-cyphar@cyphar.com> <1429446154-10660-2-git-send-email-cyphar@cyphar.com> <20150422152551.GA10738@htj.duckdns.org> <20150422154212.GE3007@worktop.Skamania.guest> <20150422160258.GE10738@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 Content-Length: 1019 Lines: 27 Hello, On Mon, Apr 27, 2015 at 02:05:47AM +1000, Aleksa Sarai wrote: > In addition, there are a bunch of cgroup_* functions that use unsigned > ints for bitops (cgroup_calc_child_subsys_mask, rebind_subsystems, > cgroup_print_ss_mask). Is there a better solution to this problem, or > should I just switch back to my naive solution? Hmmmm... You can either convert all masks to ulong (which is fine) or do something like the following. #define for_each_subsys_which(ss_mask, ss, ssid) \ unsigned long __tmp_mask = (ss_mask); \ for_each_set_bit(ssid, &__tmp_mask, CGROUP_SUBSYS_COUNT)\ if ((ss) = group_subsys[ssid] && false) \ ; \ else Thanks. -- tejun -- 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/