From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752846AbbCaWf3 (ORCPT ); Tue, 31 Mar 2015 18:35:29 -0400 Received: from mail.kernel.org ([198.145.29.136]:51714 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751457AbbCaWf0 (ORCPT ); Tue, 31 Mar 2015 18:35:26 -0400 Date: Tue, 31 Mar 2015 19:35:34 -0300 From: Arnaldo Carvalho de Melo To: David Ahern Cc: Yunlong Song , a.p.zijlstra@chello.nl, paulus@samba.org, mingo@redhat.com, linux-kernel@vger.kernel.org, wangnan0@huawei.com Subject: Re: [PATCH 3/9] perf sched replay: Alloc the memory of pid_to_task dynamically to adapt to the unexpected change of pid_max Message-ID: <20150331223534.GR9438@kernel.org> References: <1427809596-29559-1-git-send-email-yunlong.song@huawei.com> <1427809596-29559-4-git-send-email-yunlong.song@huawei.com> <551AB005.8080102@gmail.com> <20150331202515.GO9438@kernel.org> <551B1EFC.305@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <551B1EFC.305@gmail.com> X-Url: http://acmel.wordpress.com User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Em Tue, Mar 31, 2015 at 04:26:04PM -0600, David Ahern escreveu: > On 3/31/15 2:25 PM, Arnaldo Carvalho de Melo wrote: > >Humm, we already have an rb_tree for each task, its called > >machine->threads, and it has struct thread instances, that in turn have > >a ->priv point, can't it be used here? > I think that would require a lot of churn to the existing code. The command > could definitely use some modernizing, but it will take time. yeah, I've been there, some of the infrastructure changes here and there are related to this, i.e. how to make the core more useful for tools like 'sched' :-) I.e. at some point it should be just a struct thread descendant, i.e. something like: struct sched_thread { struc thread thread; sched specific fields; }; or have the sched specific fields accessible via thread->priv. The former may be better performance wise due to data locality, i.e. better cacheline usage. This is something I did, for instance, for perf_evsel/hists_evsel. - Arnaldo