public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Tejun Heo <tj@kernel.org>
To: Josh Snyder <joshs@netflix.com>
Cc: Peter Zijlstra <peterz@infradead.org>,
	Brendan Gregg <bgregg@netflix.com>,
	linux-block@vger.kernel.org, Jens Axboe <axboe@kernel.dk>,
	Balbir Singh <bsingharora@gmail.com>,
	Ingo Molnar <mingo@redhat.com>,
	open list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH v2] delayacct: Account blkio completion on the correct task
Date: Thu, 11 Jan 2018 10:04:05 -0800	[thread overview]
Message-ID: <20180111180405.GJ3460072@devbig577.frc2.facebook.com> (raw)
In-Reply-To: <1513613712-571-1-git-send-email-joshs@netflix.com>

Hello,

On Mon, Dec 18, 2017 at 04:15:10PM +0000, Josh Snyder wrote:
> Before commit e33a9bba85a8 ("sched/core: move IO scheduling accounting from
> io_schedule_timeout() into scheduler"), delayacct_blkio_end was called after
> context-switching into the task which completed I/O. This resulted in double
> counting: the task would account a delay both waiting for I/O and for time
> spent in the runqueue.
> 
> With e33a9bba85a8, delayacct_blkio_end is called by try_to_wake_up. In
> ttwu, we have not yet context-switched. This is more correct, in that the
> delay accounting ends when the I/O is complete. But delayacct_blkio_end
> relies upon `get_current()`, and we have not yet context-switched into the
> task whose I/O completed. This results in the wrong task having its delay
> accounting statistics updated.
> 
> Instead of doing that, pass the task_struct being woken to
> delayacct_blkio_end, so that it can update the statistics of the correct
> task.
> 
> Fixes: e33a9bba85a8 ("sched/core: move IO scheduling accounting from io_schedule_timeout() into scheduler")
> Signed-off-by: Josh Snyder <joshs@netflix.com>

Acked-by: Tejun Heo <tj@kernel.org>

Thanks.

-- 
tejun

  reply	other threads:[~2018-01-11 18:04 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-12-15 18:11 [PATCH] Pass the task_struct explicitly to delayacct_blkio_end Josh Snyder
2017-12-18 11:34 ` Peter Zijlstra
2017-12-18 16:15   ` [PATCH v2] delayacct: Account blkio completion on the correct task Josh Snyder
2018-01-11 18:04     ` Tejun Heo [this message]
2018-01-13  8:26     ` Balbir Singh
2018-01-16  3:52     ` [tip:sched/urgent] " tip-bot for Josh Snyder

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=20180111180405.GJ3460072@devbig577.frc2.facebook.com \
    --to=tj@kernel.org \
    --cc=axboe@kernel.dk \
    --cc=bgregg@netflix.com \
    --cc=bsingharora@gmail.com \
    --cc=joshs@netflix.com \
    --cc=linux-block@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=peterz@infradead.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