Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759796AbcCDTvO (ORCPT ); Fri, 4 Mar 2016 14:51:14 -0500 Received: from mail5.windriver.com ([192.103.53.11]:35700 "EHLO mail5.wrs.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751431AbcCDTvN (ORCPT ); Fri, 4 Mar 2016 14:51:13 -0500 Message-ID: <56D9E72D.5060308@windriver.com> Date: Fri, 4 Mar 2016 13:51:09 -0600 From: Chris Friesen User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.3.0 MIME-Version: 1.0 To: lkml , Frederic Weisbecker Subject: question about logic of steal_account_process_tick() ? Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [172.25.39.6] Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 816 Lines: 19 I'm trying to wrap my head around how steal_account_process_tick() interacts with account_process_tick(). Suppose we have CONFIG_VIRT_CPU_ACCOUNTING_GEN=y and CONFIG_NO_HZ_IDLE, with a cpu hog on cpu0 to prevent it going idle. As I understand it, account_process_tick() will be called once per tick to decide whether that tick should be allocated against user/system/idle. However, it first calls steal_account_process_tick() and then returns if that returns a nonzero value. The thing is, steal_account_process_tick() returns units of cputime, which I think is nanoseconds on x86_64. So if we have a tiny amount of stolen time it seems like that will prevent a whole tick from being accounted into user/system/idle. I feel like I must be missing something here, can someone tell me what it is? Chris