[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20160809201441.GA2513@mail.hallyn.com>
Date: Tue, 9 Aug 2016 15:14:41 -0500
From: "Serge E. Hallyn" <serge@...lyn.com>
To: Tejun Heo <tj@...nel.org>
Cc: "Serge E. Hallyn" <serge@...lyn.com>, gregkh@...uxfoundation.org,
serge.hallyn@...ntu.com, linux-kernel@...r.kernel.org,
cgroups@...r.kernel.org, kernel-team@...com, hannes@...xchg.org,
lizefan@...wei.com
Subject: Re: [PATCH 2/4] kernfs: make kernfs_path*() behave in the style of
strlcpy()
Quoting Tejun Heo (tj@...nel.org):
> Hello, Serge.
>
> On Tue, Aug 09, 2016 at 10:33:05AM -0500, Serge E. Hallyn wrote:
> > > + for (i = depth_to - 1; i >= 0; i--) {
> > > + for (kn = kn_to, j = 0; j < i; j++)
> > > + kn = kn->parent;
> >
> > This is O(n^2) where n is the path depth. It's not a hot path, though, do
> > we care?
>
> I don't think it matters. It's a slow path and cgroup hierarchies
> aren't supposed to be super deep to begin with. If it ever does, we
> can replace the cgroup->ancestor_ids[] array with ancestor pointer
> array and walk that instead.
>
> Thanks.
Ok, thanks
Acked-by: Serge Hallyn <serge@...lyn.com>
Powered by blists - more mailing lists