Return-Path: X-Original-To: apmail-mesos-reviews-archive@minotaur.apache.org Delivered-To: apmail-mesos-reviews-archive@minotaur.apache.org Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by minotaur.apache.org (Postfix) with SMTP id 21BE9181B6 for ; Mon, 1 Feb 2016 20:15:26 +0000 (UTC) Received: (qmail 51587 invoked by uid 500); 1 Feb 2016 20:14:27 -0000 Delivered-To: apmail-mesos-reviews-archive@mesos.apache.org Received: (qmail 51555 invoked by uid 500); 1 Feb 2016 20:14:27 -0000 Mailing-List: contact reviews-help@mesos.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: reviews@mesos.apache.org Delivered-To: mailing list reviews@mesos.apache.org Received: (qmail 51541 invoked by uid 99); 1 Feb 2016 20:14:27 -0000 Received: from reviews-vm.apache.org (HELO reviews.apache.org) (140.211.11.40) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 01 Feb 2016 20:14:27 +0000 Received: from reviews.apache.org (localhost [127.0.0.1]) by reviews.apache.org (Postfix) with ESMTP id 2BA7128A11F; Mon, 1 Feb 2016 20:14:26 +0000 (UTC) Content-Type: multipart/alternative; boundary="===============6737076091207061154==" MIME-Version: 1.0 Subject: Re: Review Request 42618: Modified the `cgroups/net_cls` isolator to use the `NetClsHandleMgr`. From: Jie Yu To: Jie Yu Cc: Avinash sridharan , mesos Date: Mon, 01 Feb 2016 20:14:26 -0000 Message-ID: <20160201201426.30946.29957@reviews.apache.org> X-ReviewBoard-URL: https://reviews.apache.org/ Auto-Submitted: auto-generated Sender: Jie Yu X-ReviewGroup: mesos X-Auto-Response-Suppress: DR, RN, OOF, AutoReply X-ReviewRequest-URL: https://reviews.apache.org/r/42618/ X-Sender: Jie Yu References: <20160131200643.30947.12512@reviews.apache.org> In-Reply-To: <20160131200643.30947.12512@reviews.apache.org> Reply-To: Jie Yu X-ReviewRequest-Repository: mesos --===============6737076091207061154== MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit ----------------------------------------------------------- This is an automatically generated e-mail. To reply, visit: https://reviews.apache.org/r/42618/#review117243 ----------------------------------------------------------- src/slave/containerizer/mesos/isolators/cgroups/net_cls.hpp (lines 38 - 39) What do we need this? Should we expose that using agent flags. src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 282 - 294) I would pull this into a helper function in src/linux/cgroup.hpp|cpp ``` Try cgroups::net_cls::classid(hierachy, cgroup); ``` This can be in a separate patch. src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 285 - 286) Please align the error message accordingly. ``` return Failure( "Unable to ..." + stringify(...)); ``` src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 292 - 293) Ditto here. src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 300 - 301) Ditto on alignment. Do you also need to clear 'infos' to be consistent? src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 329 - 334) For known orphans, you want to recovery the classid as well. Otherwise, those handles will be allocated to others while the known orphan containers are still using it. src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (line 413) s/netHandle/handle/ src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (line 418) We typically put '+' at the end of the previous line. src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 440 - 443) Can you try to see if writing a decimal number if fine as well? If not, we should move the helper function into cpp as a file local helper. src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (line 454) s/allocate/write/ src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 457 - 458) Ditto on error message alignment. src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 491 - 497) I don't think this is necessary. src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp (lines 499 - 503) You should do this after the cgroup has been destroyed. - Jie Yu On Jan. 31, 2016, 8:06 p.m., Avinash sridharan wrote: > > ----------------------------------------------------------- > This is an automatically generated e-mail. To reply, visit: > https://reviews.apache.org/r/42618/ > ----------------------------------------------------------- > > (Updated Jan. 31, 2016, 8:06 p.m.) > > > Review request for mesos and Jie Yu. > > > Bugs: MESOS-4345 > https://issues.apache.org/jira/browse/MESOS-4345 > > > Repository: mesos > > > Description > ------- > > The `NetClsHandleMgr` will be responsible for keeping track of the net_cls > handles that will be used by the net_cls cgroup subsystem. > > > Diffs > ----- > > src/slave/containerizer/mesos/isolators/cgroups/net_cls.hpp b4bc52114389d1c1efce2830f4292bd89bb0de7c > src/slave/containerizer/mesos/isolators/cgroups/net_cls.cpp ddc1bf0939e5e8995e6f34fe7b8509b51704f63e > > Diff: https://reviews.apache.org/r/42618/diff/ > > > Testing > ------- > > make and make check > > > Thanks, > > Avinash sridharan > > --===============6737076091207061154==--