public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shailabh Nagar <nagar@watson.ibm.com>
To: Ingo Molnar <mingo@elte.hu>
Cc: Gerrit Huizenga <gh@us.ibm.com>, Andrew Morton <akpm@osdl.org>,
	linux-kernel@vger.kernel.org, ckrm-tech@lists.sourceforge.net,
	Chandra Seetharaman <sekharan@us.ibm.com>,
	Hubertus Franke <frankeh@us.ibm.com>,
	Shailabh Nagar <nagar@us.ibm.com>
Subject: Re: [ckrm-tech] Re: [patch 02/38] CKRM e18: Processor Delay Accounting
Date: Thu, 23 Jun 2005 13:55:57 -0400	[thread overview]
Message-ID: <42BAF7AD.2050208@watson.ibm.com> (raw)
In-Reply-To: <20050623093732.GA30848@elte.hu>

Ingo Molnar wrote:
> * Ingo Molnar <mingo@elte.hu> wrote:
> 
> 
>>* Gerrit Huizenga <gh@us.ibm.com> wrote:
>>
>>
>>>+#ifdef CONFIG_DELAY_ACCT
>>>+int task_running_sys(struct task_struct *p)
>>>+{
>>>+	return task_is_running(p);
>>>+}
>>>+EXPORT_SYMBOL_GPL(task_running_sys);
>>>+#endif
>>
>>why is this function defined, and why is it exported?

The wrapping of the macro and export of the function was
to allow its use by a module (crbce).

> 
> this:
> 
> +#define task_is_running(p)     (this_rq() == task_rq(p))
> 
> is totally bogus. What you are checking is not whether 'the task is 
> running', but it is a complex way of doing p->thread_info->cpu == 
> smp_processor_id(). This, combined with:
> 
> +               if (pdata == NULL)
> +                       /* some wierdo race condition .. simply ignore */
> +                       continue;
> +               if (thread->state == TASK_RUNNING) {
> +                       if (task_running_sys(thread)) {
> +                               atomic_inc((atomic_t *) &
> +                                          (PSAMPLE(pdata)->cpu_running));
> +                               run++;
> +                       } else {
> +                               atomic_inc((atomic_t *) &
> +                                          (PSAMPLE(pdata)->cpu_waiting));
> +                               wait++;
> +                       }
> +               }
> 
> yields completely incorrect code, and bogus data. If your goal is to 
> sample executing-on-cpu vs. on-runqueue-waiting-to-run states then you 
> should use the already existing task_curr(p) call.

Thanks. task_curr is what we needed.
Would exporting task_curr be ok or should we continue to wrap in a 
separate function ?


--Shailabh


  reply	other threads:[~2005-06-23 17:54 UTC|newest]

Thread overview: 59+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-23  6:15 [patch 00/38] CKRM e18: Updated core patches to 2.6.12 and included e17 changes Gerrit Huizenga
2005-06-23  6:15 ` [patch 01/38] CKRM e18: Core CKRM Event Callbacks Gerrit Huizenga
2005-06-23  6:15 ` [patch 02/38] CKRM e18: Processor Delay Accounting Gerrit Huizenga
2005-06-23  9:16   ` Ingo Molnar
2005-06-23  9:37     ` Ingo Molnar
2005-06-23 17:55       ` Shailabh Nagar [this message]
2005-06-24  7:20         ` [ckrm-tech] " Ingo Molnar
2005-06-24  7:32           ` Gerrit Huizenga
2005-06-23 20:44       ` Gerrit Huizenga
2005-06-23  6:15 ` [patch 03/38] CKRM e18: Core infrastructure Gerrit Huizenga
2005-06-23  6:15 ` [patch 04/38] CKRM e18: Resource Control File System (rcfs) Gerrit Huizenga
2005-06-27  7:56   ` [ckrm-tech] " KUROSAWA Takahiro
2005-06-23  6:15 ` [patch 05/38] CKRM e18: Classtype definitions for task class Gerrit Huizenga
2005-06-23  6:15 ` [patch 06/38] CKRM e18: Classtype definitions for socket class Gerrit Huizenga
2005-06-23  6:15 ` [patch 07/38] CKRM e18: Numtasks Controller Gerrit Huizenga
2005-06-28  5:54   ` [ckrm-tech] " Naoaki Maeda
2005-06-23  6:16 ` [patch 08/38] CKRM e18: Documentation Gerrit Huizenga
2005-06-26 21:24   ` Pavel Machek
2005-06-27 18:45     ` Gerrit Huizenga
2005-06-27 20:56       ` Pavel Machek
2005-06-23  6:16 ` [patch 09/38] CKRM e18: Add missing read_unlock Gerrit Huizenga
2005-06-23  6:16 ` [patch 10/38] CKRM e18: Move Callbacks from listenaq to socketclass Gerrit Huizenga
2005-06-23  6:16 ` [patch 11/38] CKRM e18: Change ipaddr_port syntax Gerrit Huizenga
2005-06-23  6:16 ` [patch 12/38] CKRM e18: Check to see if my guarantee is set to DONTCARE Gerrit Huizenga
2005-06-23  6:16 ` [patch 13/38] CKRM e18: Minor cosmetic cleanups in numtasks controller Gerrit Huizenga
2005-06-23  6:16 ` [patch 14/38] CKRM e18: undo removal of check in numtasks_put_ref_local Gerrit Huizenga
2005-06-23  6:16 ` [patch 15/38] CKRM e18: Rule Based Classification Engine, stub rcfs support Gerrit Huizenga
2005-06-23  6:16 ` [patch 16/38] CKRM e18: Rule Based Classification Engine, basic " Gerrit Huizenga
2005-06-23  6:16 ` [patch 17/38] CKRM e18: Rule Based Classification Engine, bitvector support for classification info Gerrit Huizenga
2005-06-23  6:16 ` [patch 18/38] CKRM e18: Rule Based Classification Engine, full CE Gerrit Huizenga
2005-06-23  6:16 ` [patch 19/38] CKRM e18: Rule Based Classification Engine, more advanced classification engine Gerrit Huizenga
2005-06-23  6:16 ` [patch 20/38] CKRM e18: Clean up typo in printk message Gerrit Huizenga
2005-06-23  6:16 ` [patch 21/38] CKRM e18: Fix for compiler warnings Gerrit Huizenga
2005-06-23  6:16 ` [patch 22/38] CKRM e18: Fix share calculation Gerrit Huizenga
2005-06-23  6:16 ` [patch 23/38] CKRM e18: Fix edge cases with empty lists and rule deletion Gerrit Huizenga
2005-06-23  6:16 ` [patch 24/38] CKRM e18: Add numtasks controller config file write support Gerrit Huizenga
2005-06-23  6:16 ` [patch 25/38] CKRM e18: Add fork rate control to the numtasks controller Gerrit Huizenga
2005-06-27  7:07   ` [ckrm-tech] " Naoaki Maeda
2005-06-27 13:27     ` Rogier Wolff
2005-06-28 14:11       ` Naoaki Maeda
2005-06-27 18:08     ` Gerrit Huizenga
2005-06-28 14:21       ` Naoaki Maeda
2005-06-27 19:05     ` Chandra Seetharaman
2005-06-28 14:11       ` Naoaki Maeda
2005-06-23  6:16 ` [patch 26/38] CKRM e18: Classification Engines - RBCE and CRBCE are mutually exclusive Gerrit Huizenga
2005-06-23  6:16 ` [patch 27/38] CKRM e18: make get_class global Gerrit Huizenga
2005-06-23  6:16 ` [patch 28/38] CKRM e18: Cleanups to CKRM initialization Gerrit Huizenga
2005-06-23  6:16 ` [patch 29/38] CKRM e18: Replace target file interface with a writable members file Gerrit Huizenga
2005-06-23  6:16 ` [patch 30/38] CKRM e18: use sizeof instead of #define for the array size in taskclass Gerrit Huizenga
2005-06-23  6:16 ` [patch 31/38] CKRM e18: Fix a bug in the use of classtype Gerrit Huizenga
2005-06-23  6:16 ` [patch 32/38] CKRM e18: Include taskdelays.h in crbce.h Gerrit Huizenga
2005-06-23  6:16 ` [patch 33/38] CKRM e18: Send timestamps to userspace in msecs instead of jiffies Gerrit Huizenga
2005-06-23  6:16 ` [patch 34/38] CKRM e18: Fix compile warnings and delete dead code Gerrit Huizenga
2005-06-23  6:16 ` [patch 35/38] CKRM e18: Fix a NULL dereference bug Gerrit Huizenga
2005-06-23  6:16 ` [patch 36/38] CKRM e18: Classification Engine Configuration Support cleanup Gerrit Huizenga
2005-06-23  6:16 ` [patch 37/38] CKRM e18: Use sizeof instead of define for the array size in RBCE Gerrit Huizenga
2005-06-23  6:16 ` [patch 38/38] CKRM e18: Delete target file from tc_magic.c Gerrit Huizenga
2005-06-23  6:36 ` [ckrm-tech] [patch 00/38] CKRM e18: Updated core patches to 2.6.12 and included e17 changes Jean-Pierre Dion
2005-06-23  6:43   ` Gerrit Huizenga

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=42BAF7AD.2050208@watson.ibm.com \
    --to=nagar@watson.ibm.com \
    --cc=akpm@osdl.org \
    --cc=ckrm-tech@lists.sourceforge.net \
    --cc=frankeh@us.ibm.com \
    --cc=gh@us.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@elte.hu \
    --cc=nagar@us.ibm.com \
    --cc=sekharan@us.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox