From: Jens Axboe <axboe-tSWWG44O7X1aa/9Udqfwiw@public.gmane.org>
To: Tejun Heo <tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org>
Cc: linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
kernel-team-b10kYP2dOMg@public.gmane.org
Subject: Re: [PATCH block/for-next] iocost: fix infinite loop bug in adjust_inuse_and_calc_cost()
Date: Mon, 14 Sep 2020 19:47:19 -0600 [thread overview]
Message-ID: <e9e616d2-4bba-43b4-e41f-3c73f65371aa@kernel.dk> (raw)
In-Reply-To: <20200914150513.GC865564-146+VewaZzwNjtGbbfXrCEEOCMrvLtNR@public.gmane.org>
On 9/14/20 9:05 AM, Tejun Heo wrote:
> adjust_inuse_and_calc_cost() is responsible for reducing the amount of
> donated weights dynamically in period as the budget runs low. Because we
> don't want to do full donation calculation in period, we keep latching up
> inuse by INUSE_ADJ_STEP_PCT of the active weight of the cgroup until the
> resulting hweight_inuse is satisfactory.
>
> Unfortunately, the adj_step calculation was reading the active weight before
> acquiring ioc->lock. Because the current thread could have lost race to
> activate the iocg to another thread before entering this function, it may
> read the active weight as zero before acquiring ioc->lock. When this
> happens, the adj_step is calculated as zero and the incremental adjustment
> loop becomes an infinite one.
>
> Fix it by fetching the active weight after acquiring ioc->lock.
Applied, thanks.
--
Jens Axboe
prev parent reply other threads:[~2020-09-15 1:47 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-14 15:05 [PATCH block/for-next] iocost: fix infinite loop bug in adjust_inuse_and_calc_cost() Tejun Heo
[not found] ` <20200914150513.GC865564-146+VewaZzwNjtGbbfXrCEEOCMrvLtNR@public.gmane.org>
2020-09-15 1:47 ` Jens Axboe [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=e9e616d2-4bba-43b4-e41f-3c73f65371aa@kernel.dk \
--to=axboe-tswwg44o7x1aa/9udqfwiw@public.gmane.org \
--cc=cgroups-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=kernel-team-b10kYP2dOMg@public.gmane.org \
--cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
--cc=tj-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.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;
as well as URLs for NNTP newsgroup(s).