From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755977AbcL0UAt (ORCPT ); Tue, 27 Dec 2016 15:00:49 -0500 Received: from mail-yw0-f194.google.com ([209.85.161.194]:35242 "EHLO mail-yw0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752214AbcL0UAi (ORCPT ); Tue, 27 Dec 2016 15:00:38 -0500 Date: Tue, 27 Dec 2016 14:53:54 -0500 From: Tejun Heo To: gregkh@linuxfoundation.org, lizefan@huawei.com, hannes@cmpxchg.org Cc: linux-kernel@vger.kernel.org, cgroups@vger.kernel.org, kernel-team@fb.com Subject: Re: [PATCHSET] kernfs, cgroup: reimplement "cgroup.procs" reading for v2 Message-ID: <20161227195354.GC31771@htj.duckdns.org> References: <20161220161222.15234-1-tj@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161220161222.15234-1-tj@kernel.org> User-Agent: Mutt/1.7.1 (2016-10-04) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 20, 2016 at 11:12:17AM -0500, Tejun Heo wrote: > On cgroup v1, the pid listings in "cgroup.procs" and "tasks" are > sorted which adds a lot of complications and overhead. v2 doesn't > have such requirement and has been intentionally using a modified > sorting order so that the output doesn't look sorted to users. > > This patchset re-implements "cgroup.procs" reading for v2 which simply > keeps a css_task_iter open while the file is being read. Keeping the > iterator open makes it unnecessary to skip to the right position on > each read segment and associated errors - e.g. incorrectly skipping > over pids because earlier pids disappeared between the reads. > > Using persistent iterator across multiple read calls requires > ->release() callback to clean it up. kernfs operations > ->open/release() are added and piped through cftype. Applied to cgroup/for-4.11. -- tejun