Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756040AbcCPUkN (ORCPT ); Wed, 16 Mar 2016 16:40:13 -0400 Received: from mail-pf0-f171.google.com ([209.85.192.171]:33224 "EHLO mail-pf0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755686AbcCPUkF (ORCPT ); Wed, 16 Mar 2016 16:40:05 -0400 Date: Wed, 16 Mar 2016 13:40:02 -0700 From: Tejun Heo To: Parav Pandit Cc: cgroups@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-rdma@vger.kernel.org, lizefan@huawei.com, Johannes Weiner , Doug Ledford , Liran Liss , "Hefty, Sean" , Jason Gunthorpe , Haggai Eran , Jonathan Corbet , james.l.morris@oracle.com, serge@hallyn.com, Or Gerlitz , Matan Barak , akpm@linux-foundation.org, linux-security-module@vger.kernel.org Subject: Re: [PATCHv9 1/3] rdmacg: Added rdma cgroup controller Message-ID: <20160316204002.GG21104@mtj.duckdns.org> References: <1456859137-13646-1-git-send-email-pandit.parav@gmail.com> <1456859137-13646-2-git-send-email-pandit.parav@gmail.com> <20160302173949.GG29826@mtj.duckdns.org> <20160305125215.GC3567@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.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1453 Lines: 40 Hello, Parav. Sorry about the delay. On Sat, Mar 12, 2016 at 11:49:03AM +0530, Parav Pandit wrote: > > For (1) shall I have one spin lock that is uses across multiple > > hierarchy and multiple cgroup. > > Essentially one global lock among all cgroup. During hierarchical > > charging, continue to use same lock it at each level. > > Would that work in this first release? > > I am waiting for your reply. > Shall one lock for all cgroup is ok with you? Yes, when you're locking up to the root each time, splitting locks at the bottom doesn't really achieve anything. It just makes things more expensive. > If this is ok. I will keep the code as it is, because it uses common > helper functions for max and current files. Hmmm... can you please try to refactor the common part to helpers? It's not a big thing but there were both styles across different controllers and helper based ones tend to be easier to follow. > >> 3 is fine but resource [un]charging is not hot path? > > charge/uncharge is hot path from cgroup perspective. > > Considering 1 to 4 devices in system rpool list would grow upto 4 > > entry deep at each cgroup level. > > I believe this is good enough to start with. O complexity wise its > > O(N). where N is number of devices in system. I see, but if that's the case, please drop the fine locking. The fine locking doesn't make much sense - as implemented it's slower and the whole thing is not hot. Thanks. -- tejun