From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754790Ab1I1PP6 (ORCPT ); Wed, 28 Sep 2011 11:15:58 -0400 Received: from mx2.parallels.com ([64.131.90.16]:48879 "EHLO mx2.parallels.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754748Ab1I1PP5 (ORCPT ); Wed, 28 Sep 2011 11:15:57 -0400 Message-ID: <4E8339EA.7070700@parallels.com> Date: Wed, 28 Sep 2011 12:14:50 -0300 From: Glauber Costa User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:6.0.2) Gecko/20110906 Thunderbird/6.0.2 MIME-Version: 1.0 To: Peter Zijlstra CC: , , , , Subject: Re: [RFD 3/9] Display /proc/stat information per cgroup References: <1316816432-9237-1-git-send-email-glommer@parallels.com> <1316816432-9237-4-git-send-email-glommer@parallels.com> <1317160096.21836.14.camel@twins> In-Reply-To: <1317160096.21836.14.camel@twins> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [187.46.219.221] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 09/27/2011 06:48 PM, Peter Zijlstra wrote: > On Fri, 2011-09-23 at 19:20 -0300, Glauber Costa wrote: >> +static inline void task_cgroup_account_field(struct task_struct *p, >> + cputime64_t tmp, int index) >> +{ >> + struct kernel_stat *kstat; >> + struct task_group *tg = task_group(p); >> + >> + do { >> + kstat = this_cpu_ptr(tg->cpustat); >> + kstat->cpustat[index] = cputime64_add(kstat->cpustat[index], >> + tmp); > > So aside from the cputime64_t nonsense you could actually write that as: > > __this_cpu_add(tg->cpustat[index], tmp); > > which should yield better asm I think, a quick grep seems to confirm > cputime64_t is indeed a u64 all over so its fair to just ignore that. Ok, It would indeed be better.