From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michal =?iso-8859-1?Q?Koutn=FD?= Subject: Re: [PATCH 2/2] sched/psi: iterate through cgroups directly Date: Wed, 8 Feb 2023 22:57:14 +0100 Message-ID: References: <20230208161654.99556-1-ryncsn@gmail.com> <20230208161654.99556-3-ryncsn@gmail.com> <20230208172956.GF24523@blackbody.suse.cz> Mime-Version: 1.0 Return-path: DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.com; s=susede1; t=1675893437; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=R2mYp1Col1qvN/xaX0VnWrTW38RiNgAM0en+DKPJ/Mc=; b=tV14ilvCkDpWV8xRNwzMQDPZSjnAg+2lNdLsFTQh7F++domXSJfT/KBw44/SU8cTabNdXf 3YGlGIDYBNgdX2Vmx2dV0c6RKLxrAGEeKVtAxV00qsjBSEeVvnK39r7pYqbTXEq3XJkumd 7VQy9xDVfrBv5ZwR3YnlvOVMhUidcHM= Content-Disposition: inline In-Reply-To: List-ID: Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: Johannes Weiner Cc: Kairui Song , Suren Baghdasaryan , Chengming Zhou , Tejun Heo , Ingo Molnar , Peter Zijlstra , cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Kairui Song On Wed, Feb 08, 2023 at 02:20:12PM -0500, Johannes Weiner wrote: > Hm, I don't think it does. It sets up *iter to point to the parent for > the _next() call, but it returns task_dfl_cgroup()->psi. The next call > does the same: cgroup = *iter, *iter = parent, return cgroup->psi. You are right. > It could be a bit more readable to have *iter always point to the > current cgroup - but no strong preference either way from me: A casually reading half-brain finds this more idiomatic :) I just hope the "preloading" of the parent via iter isn't crucial to the performance change. Kairui, I like this reorganization and its effect! Michal