public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Shailabh Nagar <nagar@watson.ibm.com>
To: balbir@in.ibm.com
Cc: akpm@osdl.org, Jay Lan <jlan@engr.sgi.com>, linux-kernel@vger.kernel.org
Subject: Re: [PATCH 2.6.17-rc6-mm2] Fix exit race in per-task-delay-accounting
Date: Wed, 21 Jun 2006 10:14:43 -0400	[thread overview]
Message-ID: <44995453.8030005@watson.ibm.com> (raw)
In-Reply-To: <4498EB1B.1070002@in.ibm.com>

Balbir Singh wrote:
> Balbir Singh wrote:
> 
>> Hi, Andrew,
>>
>> This patch fixes a race in per-task-delay-accounting. This race
>> was reported by Jay Lan. I tested the patch using
>> cerebrus test control system for eight hours with getdelays running on
>> the side (for both push and pull of delay statistics).
>>
>> It fixed the problem that Jay Lan saw.

Balbir, Andrew,

I'd recommend holding off on including the patch for a bit
since the solution proposed uses a
a) global and b) taskstats related
mutex to solve a race that is in the delay accounting code.

The locking required to resolve this race is for the exiting task
(whose tsk->delays is being set to null) and that too only for
accessing its delay accounting field.

Using a global mutex that is also being used to serialize exits
may be unnecessarily
- increasing contention
- introducing dependency between taskstats (generic) and delay accounting
layers.

So if there is an inexpensive way of achieving this locking using
something localized and specific to delay accounting (the most obvious
way seems to be a tsk->delay_lock but that has the unpleasant aspect of adding
yet another field to struct task) we should explore that first.

--Shailabh

>>
>> Signed-off-by: Balbir Singh <balbir@in.ibm.com>
>> ---
>>
>>  include/linux/taskstats_kern.h |    1 +
>>  kernel/delayacct.c             |    5 ++++-
>>  kernel/taskstats.c             |    5 ++++-
>>  3 files changed, 9 insertions(+), 2 deletions(-)
>>
>> diff -puN kernel/taskstats.c~per-task-delay-accounting-fix-exit-race
>> kernel/taskstats.c
>> ---

      reply	other threads:[~2006-06-21 14:15 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-06-21  5:59 [PATCH 2.6.17-rc6-mm2] Fix exit race in per-task-delay-accounting Balbir Singh
2006-06-21  6:45 ` Balbir Singh
2006-06-21 14:14   ` Shailabh Nagar [this message]

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=44995453.8030005@watson.ibm.com \
    --to=nagar@watson.ibm.com \
    --cc=akpm@osdl.org \
    --cc=balbir@in.ibm.com \
    --cc=jlan@engr.sgi.com \
    --cc=linux-kernel@vger.kernel.org \
    /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