From: Tejun Heo <tj@kernel.org>
To: "dbasehore ." <dbasehore@chromium.org>
Cc: Jan Kara <jack@suse.cz>, Alexander Viro <viro@zento.linux.org.uk>,
Andrew Morton <akpm@linux-foundation.org>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
"Darrick J. Wong" <darrick.wong@oracle.com>,
Kees Cook <keescook@chromium.org>,
linux-fsdevel@vger.kernel.org,
linux-kernel <linux-kernel@vger.kernel.org>,
linux-mm@kvack.org, bleung@chromium.org, sonnyrao@chromium.org,
Luigi Semenzato <semenzato@chromium.org>
Subject: Re: [PATCH] backing_dev: Fix hung task on sync
Date: Mon, 17 Mar 2014 10:40:20 -0400 [thread overview]
Message-ID: <20140317144020.GA13749@htj.dyndns.org> (raw)
In-Reply-To: <CAGAzgsqD0aRnDMMyDCUVii6Rv22f97G0irpzFBz4c_ukKsn2hg@mail.gmail.com>
Hello,
On Sun, Mar 16, 2014 at 12:13:55PM -0700, dbasehore . wrote:
> There's already behavior that is somewhat like that with the current
> implementation. If there's an item on a workqueue, it could run at any
> time. From the perspective of the driver/etc. that is using the
> workqueue, there should be no difference between work being on the
> workqueue and the kernel triggering a schedule right after the work is
> removed from the workqueue, but before the work function has done
> anything.
It is different. mod_delayed_work() *guarantees* that the target work
item will become pending for execution at least after the specified
time has passed. What you're suggesting removes any semantically
consistent meaning of the API.
> So to reiterate, calling mod_delayed_work on something that is already
> in the workqueue has two behaviors. One, the work is dispatched before
> mod_delayed_work can remove it from the workqueue. Two,
> mod_delayed_work removes it from the workqueue and sets the timer (or
> not in the case of 0). The behavior of the proposed change should be
> no different than the first behavior.
No, mod_delayed_work() does *one* thing - the work item is queued for
the specified delay no matter the current state of the work item. It
is *guaranteed* that the work item will go pending after the specified
time. That is the sole meaning of the API.
> This should not introduce new behavior from the perspective of the
> code using delayed_work. It is true that there is a larger window of
> time between when you call mod_delayed_work and when an already queued
> work item will run, but I don't believe that matters.
You're completely misunderstanding the API. Plesae re-read it and
understand what it does first.
Thanks.
--
tejun
--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@kvack.org. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@kvack.org"> email@kvack.org </a>
next prev parent reply other threads:[~2014-03-17 14:40 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-15 4:12 [PATCH] backing_dev: Fix hung task on sync Derek Basehore
2014-02-17 9:20 ` Jan Kara
2014-02-18 22:55 ` Tejun Heo
2014-02-19 9:27 ` Jan Kara
2014-02-19 19:01 ` Tejun Heo
2014-03-11 18:23 ` Andrew Morton
2014-03-11 20:19 ` Jan Kara
2014-03-15 20:22 ` dbasehore .
2014-03-16 14:59 ` Tejun Heo
2014-03-16 19:13 ` dbasehore .
2014-03-16 20:20 ` dbasehore .
2014-03-17 14:40 ` Tejun Heo [this message]
2014-03-17 20:53 ` dbasehore .
2014-03-17 20:59 ` Tejun Heo
2014-03-17 9:53 ` Jan Kara
2014-02-19 15:31 ` dbasehore .
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=20140317144020.GA13749@htj.dyndns.org \
--to=tj@kernel.org \
--cc=akpm@linux-foundation.org \
--cc=bleung@chromium.org \
--cc=darrick.wong@oracle.com \
--cc=dbasehore@chromium.org \
--cc=gregkh@linuxfoundation.org \
--cc=jack@suse.cz \
--cc=keescook@chromium.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=semenzato@chromium.org \
--cc=sonnyrao@chromium.org \
--cc=viro@zento.linux.org.uk \
/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).